Prepare Android release and refine bookshelf

This commit is contained in:
Hadrian Burkhardt
2026-11-15 16:20:17 +01:00
parent fc71accb38
commit 062c798fcc
15 changed files with 530 additions and 193 deletions
+4 -4
View File
@@ -67,13 +67,13 @@ flutter build apk --debug --flavor qa
# Install explicitly with: adb install -r -s PATH_TO_QA_APK # Install explicitly with: adb install -r -s PATH_TO_QA_APK
# The review Huawei rejects SD app installs; use adb install -r -f there. # The review Huawei rejects SD app installs; use adb install -r -f there.
# Optimized development APK for the connected arm64 tablet # Production builds are intentionally blocked until mixed-age advertising is verified.
flutter build apk --release --flavor prod --target-platform android-arm64 # See docs/ANDROID_RELEASE.md for release configuration.
``` ```
The normal application ID remains `com.lumen.daily`; version 2.0.2 uses build number 11. The review APK is `artifacts/lumen-flutter-2.0.2-arm64.apk`. Build outputs, screenshots, local SDK paths, IDE state and private signing keys are ignored by Git. `pubspec.lock` is tracked for reproducible package resolution. The normal application ID remains `de.softwareapp_hb.lumen.daily`; version 2.0.2 uses build number 11. The review APK is `artifacts/lumen-flutter-2.0.2-arm64.apk`. Build outputs, screenshots, local SDK paths, IDE state and private signing keys are ignored by Git. `pubspec.lock` is tracked for reproducible package resolution.
The development release build currently uses the Android debug signing key so it can update the installed prototype. **Configure your private upload key before publishing.** No production signing material is included. Production releases require a private upload key and production AdMob IDs. See [Android release preparation](docs/ANDROID_RELEASE.md); the mixed-age advertising flow and store setup remain release blockers.
## Browser playtest ## Browser playtest
+62 -9
View File
@@ -1,9 +1,22 @@
import java.util.Base64
import java.util.Properties
plugins { plugins {
id("com.android.application") id("com.android.application")
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
id("dev.flutter.flutter-gradle-plugin") id("dev.flutter.flutter-gradle-plugin")
} }
val uploadProperties = Properties()
val uploadPropertiesPath = providers.gradleProperty("LUMEN_UPLOAD_PROPERTIES")
.orElse(providers.environmentVariable("LUMEN_UPLOAD_PROPERTIES"))
.orNull
if (uploadPropertiesPath != null) {
val propertiesFile = file(uploadPropertiesPath)
require(propertiesFile.isFile) { "Upload signing properties file does not exist." }
propertiesFile.inputStream().use { uploadProperties.load(it) }
}
android { android {
namespace = "com.lumen.daily" namespace = "com.lumen.daily"
compileSdk = flutter.compileSdkVersion compileSdk = flutter.compileSdkVersion
@@ -15,8 +28,7 @@ android {
} }
defaultConfig { defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId = "de.softwareapp_hb.lumen.daily"
applicationId = "com.lumen.daily"
// You can update the following values to match your application needs. // You can update the following values to match your application needs.
// For more information, see: https://flutter.dev/to/review-gradle-config. // For more information, see: https://flutter.dev/to/review-gradle-config.
minSdk = 24 minSdk = 24
@@ -30,19 +42,25 @@ android {
manifestPlaceholders["admobAppId"] = providers.gradleProperty("ADMOB_APP_ID").getOrElse("ca-app-pub-3940256099942544~3347511713") manifestPlaceholders["admobAppId"] = providers.gradleProperty("ADMOB_APP_ID").getOrElse("ca-app-pub-3940256099942544~3347511713")
} }
signingConfigs {
create("upload") {
uploadProperties.getProperty("storeFile")?.let { storeFile = file(it) }
storePassword = uploadProperties.getProperty("storePassword")
keyAlias = uploadProperties.getProperty("keyAlias")
keyPassword = uploadProperties.getProperty("keyPassword")
}
}
flavorDimensions += "edition" flavorDimensions += "edition"
productFlavors { productFlavors {
create("prod") { dimension = "edition" } create("prod") { dimension = "edition"; signingConfig = signingConfigs.getByName("upload") }
create("qa") { dimension = "edition"; applicationIdSuffix = ".qa"; versionNameSuffix = "-qa" } create("qa") { dimension = "edition"; applicationId = "com.lumen.daily.qa"; versionNameSuffix = "-qa" }
create("check") { dimension = "edition"; applicationIdSuffix = ".check"; versionNameSuffix = "-check" } create("check") { dimension = "edition"; applicationId = "com.lumen.daily.check"; versionNameSuffix = "-check" }
} }
buildTypes { buildTypes {
debug { signingConfig = signingConfigs.getByName("debug") }
release { release {
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
// Supply a private upload key before publishing. Never release with a debug key.
signingConfig = signingConfigs.getByName("debug")
} }
} }
} }
@@ -56,3 +74,38 @@ kotlin {
flutter { flutter {
source = "../.." source = "../.."
} }
// Never produce a production release with sample ad IDs or a debug key.
gradle.taskGraph.whenReady {
if (allTasks.any { it.project == project && it.name.contains("ProdRelease", ignoreCase = true) }) {
val appId = providers.gradleProperty("ADMOB_APP_ID").orNull ?: ""
val validAppId = Regex("ca-app-pub-[0-9]{16}~[0-9]{10}")
require(validAppId.matches(appId) && !appId.startsWith("ca-app-pub-3940256099942544~")) {
"Production release requires a real ADMOB_APP_ID Gradle property."
}
val defines = providers.gradleProperty("dart-defines").orNull.orEmpty()
.split(",").filter { it.isNotBlank() }.mapNotNull {
runCatching { String(Base64.getDecoder().decode(it), Charsets.UTF_8) }.getOrNull()
}.mapNotNull { value ->
val index = value.indexOf('=')
if (index < 0) null else value.substring(0, index) to value.substring(index + 1)
}.toMap()
val validUnitId = Regex("ca-app-pub-[0-9]{16}/[0-9]{10}")
for (name in listOf("ADMOB_REWARDED_ID", "ADMOB_INTERSTITIAL_ID")) {
val id = defines[name].orEmpty()
require(validUnitId.matches(id) && !id.startsWith("ca-app-pub-3940256099942544/")) {
"Production release requires a real $name Dart define."
}
}
for (name in listOf("storeFile", "storePassword", "keyAlias", "keyPassword")) {
require(!uploadProperties.getProperty(name).isNullOrBlank()) {
"Production release requires $name in the upload signing properties file."
}
}
require(file(uploadProperties.getProperty("storeFile")).isFile) {
"Production upload keystore does not exist."
}
// Remove only after the mixed-age flow and its device verification exist.
error("Production release blocked: mixed-age screening and Families ad handling are not yet verified.")
}
}
+7
View File
@@ -1,4 +1,11 @@
{ {
"Mara’s\nisland notebook": "Maras\nInselnotizbuch",
"Lumen uses open-source software and fonts. Choose a component to read its notices.": "Lumen verwendet Open-Source-Software und Schriftarten. Wähle eine Komponente, um ihre Lizenztexte zu lesen.",
"Lumen uses open-source software and fonts. Identical notices are shown once, with all associated components listed below.": "Lumen verwendet Open-Source-Software und Schriftarten. Identische Lizenztexte werden einmal angezeigt; die zugehörigen Komponenten stehen jeweils dabei.",
"View license notice": "Lizenztext anzeigen",
"Licenses could not be loaded.": "Die Lizenzen konnten nicht geladen werden.",
"Light the number of cells shown beside each row and above each column. Tap a cell to cycle through light, cross and empty. Mark every cell to finish; dotted cells are fixed clues.\n\nSome puzzles have overlapping areas with their own totals. A shared cell counts in every area it belongs to. Compare the totals to work out which cells to light.\n\nSpecial symbols add clues: matching stars have the same state; exactly one of a matching pair of lanterns is lit; and exactly two touching footprints are lit. Some totals are hidden: use the clue on the page to find them.\n\nStory puzzles reveal memories. Find a daily puzzle or explore island postcards from the bookshelf.": "Erhelle in jeder Zeile und Spalte genau so viele Felder, wie die Zahl daneben oder darüber angibt. Tippe auf ein Feld, um zwischen Licht, Kreuz und leer zu wechseln. Markiere alle Felder, um das Rätsel zu lösen; gepunktete Felder sind feste Vorgaben.\n\nEinige Rätsel enthalten überlappende Bereiche mit eigenen Summen. Ein gemeinsames Feld zählt in jedem Bereich, zu dem es gehört. Vergleiche die Summen, um herauszufinden, welche Felder leuchten.\n\nBesondere Symbole geben weitere Hinweise: Gleiche Sterne haben denselben Zustand; von zwei gleichen Laternen leuchtet genau eine; und genau zwei sich berührende Fußspuren leuchten. Manche Summen sind verborgen: Nutze den Hinweis auf der Seite, um sie zu finden.\n\nGeschichtenrätsel enthüllen Erinnerungen. Das Tagesrätsel und die Inselpostkarten findest du im Bücherregal.",
"Hints are optional. Watch a rewarded ad to reveal a cell and its explanation; your puzzle remains available if no ad can be shown. Streaks count consecutive daily completions on this device.": "Hinweise sind freiwillig. Sieh dir ein Werbevideo an, um ein Feld und seine Erklärung zu erhalten; dein Rätsel bleibt verfügbar, wenn keine Werbung gezeigt werden kann. Eine Serie zählt aufeinanderfolgende tägliche Abschlüsse auf diesem Gerät.",
"Settings": "Einstellungen", "Settings": "Einstellungen",
"A SMALL DAILY RITUAL": "EIN KLEINES TÄGLICHES RITUAL", "A SMALL DAILY RITUAL": "EIN KLEINES TÄGLICHES RITUAL",
"A careful repair": "Eine sorgsame Reparatur", "A careful repair": "Eine sorgsame Reparatur",
+7
View File
@@ -1,4 +1,11 @@
{ {
"Mara’s\nisland notebook": "Mara’s\nisland notebook",
"Lumen uses open-source software and fonts. Choose a component to read its notices.": "Lumen uses open-source software and fonts. Choose a component to read its notices.",
"Lumen uses open-source software and fonts. Identical notices are shown once, with all associated components listed below.": "Lumen uses open-source software and fonts. Identical notices are shown once, with all associated components listed below.",
"View license notice": "View license notice",
"Licenses could not be loaded.": "Licenses could not be loaded.",
"Light the number of cells shown beside each row and above each column. Tap a cell to cycle through light, cross and empty. Mark every cell to finish; dotted cells are fixed clues.\n\nSome puzzles have overlapping areas with their own totals. A shared cell counts in every area it belongs to. Compare the totals to work out which cells to light.\n\nSpecial symbols add clues: matching stars have the same state; exactly one of a matching pair of lanterns is lit; and exactly two touching footprints are lit. Some totals are hidden: use the clue on the page to find them.\n\nStory puzzles reveal memories. Find a daily puzzle or explore island postcards from the bookshelf.": "Light the number of cells shown beside each row and above each column. Tap a cell to cycle through light, cross and empty. Mark every cell to finish; dotted cells are fixed clues.\n\nSome puzzles have overlapping areas with their own totals. A shared cell counts in every area it belongs to. Compare the totals to work out which cells to light.\n\nSpecial symbols add clues: matching stars have the same state; exactly one of a matching pair of lanterns is lit; and exactly two touching footprints are lit. Some totals are hidden: use the clue on the page to find them.\n\nStory puzzles reveal memories. Find a daily puzzle or explore island postcards from the bookshelf.",
"Hints are optional. Watch a rewarded ad to reveal a cell and its explanation; your puzzle remains available if no ad can be shown. Streaks count consecutive daily completions on this device.": "Hints are optional. Watch a rewarded ad to reveal a cell and its explanation; your puzzle remains available if no ad can be shown. Streaks count consecutive daily completions on this device.",
"Settings": "Settings", "Settings": "Settings",
"A SMALL DAILY RITUAL": "A SMALL DAILY RITUAL", "A SMALL DAILY RITUAL": "A SMALL DAILY RITUAL",
"A careful repair": "A careful repair", "A careful repair": "A careful repair",
+45
View File
@@ -0,0 +1,45 @@
# Android release preparation
Status: **not ready for submission**. Lumen targets children and adults. Ad requests currently use child treatment and a G content rating for all users as an interim safeguard; a neutral age screen and verified age-specific consent and ad handling are not yet implemented. Do not ship ads to this audience until the chosen flow has been implemented, reviewed against current Play Families requirements, and tested on devices.
## Publisher decisions and accounts
- Working Play title: **Mara’s Island Notebook**. Review the [listing draft](PLAY_STORE_LISTING_DRAFT.md) and complete name and trademark checks before publication. Confirm the package ID before creating the listing: the current ID is `de.softwareapp_hb.lumen.daily`, and a package ID cannot be changed for an existing Play listing.
- Support contact: `softwareapp.hb@gmail.com`.
- Publish an accurate privacy policy on a publicly reachable, non-geofenced web page, and enter its URL in Play Console and in the app. The Gitea host and final URL are not yet supplied. Review disclosures against the actual ad SDK, consent, age handling, and any server logs; do not treat the browser playtest privacy text as the production Android policy.
- Create/link the Android AdMob app, rewarded and interstitial units. Configure and test Privacy & messaging for applicable regions.
- Add the developer website in Play Console and publish the exact AdMob-provided `app-ads.txt` at the domain root. Complete AdMob verification and app readiness review. A Gitea repository page alone may not serve the required file at the domain root.
- Complete Play Console's ads, target audience, privacy policy, data safety, content rating and app access declarations using actual app and SDK behavior. If a personal developer account is subject to testing requirements, complete its required closed test before requesting production access.
## Upload signing
Use the existing upload key if this package has ever been published. For a new listing, establish and securely back up an upload key and use Play App Signing. Never commit a keystore or passwords. Provide an external properties file containing:
```properties
storeFile=/absolute/path/to/upload-keystore.jks
storePassword=YOUR_STORE_PASSWORD
keyAlias=YOUR_KEY_ALIAS
keyPassword=YOUR_KEY_PASSWORD
```
Set `LUMEN_UPLOAD_PROPERTIES` to that file's absolute path. Restrict access to the file. Production release variants use this upload key; debug variants use debug signing. The production build checks for a non-test AdMob application ID and both ad unit IDs, and rejects missing signing configuration. These checks validate format and common test IDs; they cannot establish ownership or that an ID is live. A separate explicit build blocker remains in place until the mixed-age flow is implemented and verified.
When all release blockers have been resolved and the AdMob settings are available, supply `ADMOB_APP_ID` as a Gradle property (for example via `ORG_GRADLE_PROJECT_ADMOB_APP_ID`) and build:
```sh
flutter build appbundle --release --flavor prod \
--dart-define=ADMOB_REWARDED_ID=YOUR_REWARDED_UNIT_ID \
--dart-define=ADMOB_INTERSTITIAL_ID=YOUR_INTERSTITIAL_UNIT_ID
```
Ad unit IDs are included in the compiled app and are not signing secrets. Do not put passwords in command-line arguments or version control. The version code must be greater than every previously uploaded version for the same package.
## Before submission
- Verify the final AAB's package, version code, target API, signing certificate, advertising configuration and size. Test the Play-delivered build from an internal testing track on physical devices, including a fresh install and upgrade from the previous release where applicable.
- Test consent grant, denial, update/revocation, offline/no-fill, rewarded completion and cancellation, and interstitial lifecycle. Use Google test ads or registered test devices, never live ad interaction.
- For the mixed-age audience, verify the neutral age screen, child and unknown-age data handling, certified ad SDK versions and any mediation partners, ad content suitability, and region-specific privacy requirements before advertising.
- Check accessibility, tablet and phone layouts, audio, stories, offline play, and progress persistence. Confirm store listing text, screenshots, icon, category, age rating, support contact and privacy URL match the final app.
- Confirm permission and SDK data disclosures with the Google Play SDK Index and actual merged release manifest; verify whether advertising ID permission is present and declare it accurately.
References: [Play app content](https://support.google.com/googleplay/android-developer/answer/9859455), [Families policy](https://support.google.com/googleplay/android-developer/answer/9893335), [test ads](https://developers.google.com/admob/flutter/test-ads), [app-ads.txt](https://support.google.com/admob/answer/14538460), [target API](https://support.google.com/googleplay/android-developer/answer/11926878).
+32
View File
@@ -0,0 +1,32 @@
# Google Play listing draft
Working title: **Mara’s Island Notebook**
This title is a working choice, not a confirmed clearance. Check Google Play, relevant trademark registers and other markets before publishing. The Android application ID remains `de.softwareapp_hb.lumen.daily`; confirm whether that ID has already been registered before creating a listing.
## Short description
Solve gentle logic puzzles and uncover an island's forgotten memories.
## Full description
A storm has scattered memories across the island. Open Mara’s notebook, follow the trail from Gran’s cottage to the lighthouse, and restore the pictures hidden in each puzzle.
Light the right cells using the clues beside each row and column. As the story unfolds, overlapping areas and special symbols introduce new ways to think. Take your time, explore the pages and return to unfinished patterns whenever you like.
- Read illustrated stories and uncover memories as you solve.
- Find a fresh daily puzzle and collect island postcards.
- Use undo and optional explained hints when you need a little help.
- Save your reading place and puzzle progress on your device.
The app includes advertising. [Confirm the final ad formats, placement and requirements after the mixed-age flow is complete.]
## Support
softwareapp.hb@gmail.com
Privacy policy URL: [to be supplied after the policy is finalized and hosted]
## Release review
Review the name, copy, screenshots, content rating, audience declarations and ad descriptions against the final build. This draft is not a submitted listing. See [Android release preparation](ANDROID_RELEASE.md).
+37
View File
@@ -0,0 +1,37 @@
# Privacy policy draft — not ready to publish
This is a working draft for the Android app. Replace bracketed items, verify the actual release configuration and SDK data practices, and review the policy for all intended audiences and regions before publishing. Do not represent the draft as a completed disclosure.
## [App name] privacy policy
Last updated: [date]
[Publisher legal name] operates [App name], an illustrated story and puzzle game. Contact: softwareapp.hb@gmail.com.
### Information stored on your device
The app stores game progress, puzzle marks, reading positions, settings and local play statistics on your device. [Confirm which statistics are retained and for how long.] Uninstalling the app removes its local app data. [Confirm behavior for all supported devices and backups.]
### Advertising and consent
The app uses Google AdMob to provide [describe the final ad formats and placements]. Google and its service providers may process information about the device, app interactions and ads to provide, secure and measure advertising. The exact data and purposes depend on the final SDK configuration, region and consent settings. [Complete using the final SDK data disclosures, consent configuration and mediation partners.] See [Google's privacy policy](https://policies.google.com/privacy).
[Explain how to access privacy options, withdraw consent where applicable, and any relevant advertising controls. Verify the wording against the released app.]
### Children and families
The app is intended for children and adults. [Describe the finalized neutral age screen, how any age information is processed and retained, how ads and consent work for children and unknown-age users, and applicable parental rights. Do not publish until this accurately reflects the implemented flow and has been reviewed.]
### Other services and hosting
[Identify any other third-party services, data they collect, hosting access logs, retention and deletion practices. Distinguish Android app behavior from website behavior.]
### Your choices and contact
[Describe applicable access, deletion and other privacy rights and how to exercise them. Include response and verification procedures.]
For privacy questions, contact softwareapp.hb@gmail.com.
### Changes
[Explain how changes to this policy will be communicated and update the date above.]
+13 -64
View File
@@ -29,6 +29,7 @@ import 'services/narrator.dart';
import 'services/progress.dart'; import 'services/progress.dart';
import 'ui/board.dart'; import 'ui/board.dart';
import 'ui/library.dart'; import 'ui/library.dart';
import 'ui/licenses.dart';
import 'ui/discovery.dart'; import 'ui/discovery.dart';
import 'ui/paper.dart'; import 'ui/paper.dart';
@@ -835,42 +836,7 @@ class _NotebookState extends State<Notebook> with WidgetsBindingObserver {
], ],
), ),
divider(), divider(),
folio('A SMALL DAILY RITUAL'),
action('Island postcards', g.showPostcards),
writing(
DateFormat(
'EEEE, d MMMM',
Localizations.localeOf(context).languageCode,
).format(DateTime.now()),
size: 27,
),
action(
'Play today’s puzzle →',
() => g.startDaily(DateTime.now()),
),
gap(),
folio('BY THE COTTAGE WINDOW'),
writing(
'A few spare pages for practice. For overlapping-area puzzles, follow the notebook’s story.',
size: 22,
color: muted,
),
action(
'Difficulty · ${g.difficulty.label} ▾',
chooseDifficulty,
),
action(
'Practice · ${g.difficulty.label} · Level ${g.practiceLevel}',
() => unawaited(g.startPractice()),
),
action('How to play', rules), action('How to play', rules),
action(
'Open-source licenses',
() => showLicensePage(
context: context,
applicationName: 'Lumen',
),
),
gap(), gap(),
writing( writing(
'Leave a light in the window.', 'Leave a light in the window.',
@@ -896,6 +862,7 @@ class _NotebookState extends State<Notebook> with WidgetsBindingObserver {
('Sound & atmosphere', soundSettings), ('Sound & atmosphere', soundSettings),
('Recording speed', speed), ('Recording speed', speed),
('Privacy & advertising', privacy), ('Privacy & advertising', privacy),
('Open-source licenses', openSourceLicenses),
if (kDebugMode || appFlavor == 'qa' || appFlavor == 'check') if (kDebugMode || appFlavor == 'qa' || appFlavor == 'check')
('Playtest report', playtestReport), ('Playtest report', playtestReport),
]) ])
@@ -910,6 +877,10 @@ class _NotebookState extends State<Notebook> with WidgetsBindingObserver {
), ),
); );
void openSourceLicenses() => Navigator.of(
context,
).push(MaterialPageRoute<void>(builder: (_) => const OpenSourceLicenses()));
Future<void> playtestReport() => showDialog<void>( Future<void> playtestReport() => showDialog<void>(
context: context, context: context,
builder: (c) => AlertDialog( builder: (c) => AlertDialog(
@@ -1921,40 +1892,18 @@ class _NotebookState extends State<Notebook> with WidgetsBindingObserver {
); );
} }
Future<void> chooseDifficulty() async {
await showDialog<void>(
context: context,
builder: (c) => SimpleDialog(
title: CopyText('Classic practice pace', style: hand(29)),
children: [
for (final d in Difficulty.values)
SimpleDialogOption(
onPressed: () {
g.selectDifficulty(d);
Navigator.pop(c);
},
child: CopyText(
'${CopyScope.text(context, d.label)} — ${CopyScope.text(context, d.description)}',
style: hand(23),
),
),
],
),
);
}
void rules() { void rules() {
final text = CopyScope.text( final rulesText = CopyScope.text(
context, context,
'Light exactly as many cells as the number beside each row and above each column.\n\nTap to cycle: empty → light → crossed out → empty. Mark every cell to finish. Small dots mark fixed clues.\n\nA, B and C are overlapping areas with their own totals. Shared cells count in both areas. Compare clues and subtract their shared parts to find new deductions.\n\nEvery story grid reveals an object. Later pages require area comparisons; all are solvable without guessing. Classic practice grades the length of simpler row and column chains.\n\nWatch a rewarded ad for each explained hint. Hints are optional, and your puzzle remains available if no ad can be shown. Streaks count consecutive daily completions on this device.', 'Light the number of cells shown beside each row and above each column. Tap a cell to cycle through light, cross and empty. Mark every cell to finish; dotted cells are fixed clues.\n\nSome puzzles have overlapping areas with their own totals. A shared cell counts in every area it belongs to. Compare the totals to work out which cells to light.\n\nSpecial symbols add clues: matching stars have the same state; exactly one of a matching pair of lanterns is lit; and exactly two touching footprints are lit. Some totals are hidden: use the clue on the page to find them.\n\nStory puzzles reveal memories. Find a daily puzzle or explore island postcards from the bookshelf.',
); );
message( final hintText = CopyScope.text(
'Find the light', context,
kIsWeb kIsWeb
? '${text.substring(0, text.lastIndexOf('\n\n'))}\n\n${CopyScope.text(context, 'Hints are free in this browser playtest. Each hint reveals one cell and explains the deduction. Streaks count consecutive daily completions in this browser.')}' ? 'Hints are free in this browser playtest. Each hint reveals one cell and explains the deduction. Streaks count consecutive daily completions in this browser.'
: text, : 'Hints are optional. Watch a rewarded ad to reveal a cell and its explanation; your puzzle remains available if no ad can be shown. Streaks count consecutive daily completions on this device.',
close: 'Got it',
); );
message('Find the light', '$rulesText\n\n$hintText', close: 'Got it');
} }
Future<void> privacy() async { Future<void> privacy() async {
+10 -1
View File
@@ -43,8 +43,17 @@ class Ads {
defaultTargetPlatform == TargetPlatform.iOS); defaultTargetPlatform == TargetPlatform.iOS);
Future<void> start() async { Future<void> start() async {
if (!supported) return; if (!supported) return;
// Until neutral age screening is implemented, treat all users as children
// and configure the SDK before consent or ad initialization.
await MobileAds.instance.updateRequestConfiguration(
RequestConfiguration(
ageRestrictedTreatment: AgeRestrictedTreatment.child,
maxAdContentRating: MaxAdContentRating.g,
),
);
if (_disposed) return;
ConsentInformation.instance.requestConsentInfoUpdate( ConsentInformation.instance.requestConsentInfoUpdate(
ConsentRequestParameters(), ConsentRequestParameters(tagForUnderAgeOfConsent: true),
() { () {
ConsentForm.loadAndShowConsentFormIfRequired((_) => _initialize()); ConsentForm.loadAndShowConsentFormIfRequired((_) => _initialize());
}, },
+38 -2
View File
@@ -139,8 +139,44 @@ class LibraryBookCard extends StatelessWidget {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch, crossAxisAlignment: CrossAxisAlignment.stretch,
children: [ children: [
// A cloth-bound cover with a recessed illustrated panel. The if (story.id == 'mara-island' && story.coverAsset != null)
// artwork keeps its natural proportions inside each book. Center(
child: AspectRatio(
aspectRatio: 1.5,
child: Stack(
fit: StackFit.expand,
children: [
Image.asset(
artworkAsset(story.coverAsset!),
fit: BoxFit.contain,
excludeFromSemantics: true,
errorBuilder: (_, _, _) =>
Icon(Icons.menu_book, size: 64, color: light),
),
Center(
child: FractionallySizedBox(
widthFactor: .49,
child: ExcludeSemantics(
child: FittedBox(
fit: BoxFit.scaleDown,
child: CopyText(
'Mara’s\nisland notebook',
textAlign: TextAlign.center,
style: const TextStyle(
fontFamily: 'MaraHand',
fontSize: 28,
color: Color(0xff5e5140),
),
),
),
),
),
),
],
),
),
)
else
Container( Container(
height: 276, height: 276,
padding: const EdgeInsets.fromLTRB(22, 20, 14, 20), padding: const EdgeInsets.fromLTRB(22, 20, 14, 20),
+71
View File
@@ -0,0 +1,71 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'translation.dart';
/// Group all distinct notices by component, removing exact duplicates.
Future<Map<String, Set<String>>> collectLicenseNotices(
Stream<LicenseEntry> entries,
) async {
final notices = <String, Set<String>>{};
await for (final entry in entries) {
final text = entry.paragraphs.map((p) => p.text).join('\n\n').trim();
if (text.isEmpty) continue;
for (final package in entry.packages.toSet()) {
notices.putIfAbsent(package, () => <String>{}).add(text);
}
}
return notices;
}
class OpenSourceLicenses extends StatefulWidget {
const OpenSourceLicenses({super.key});
@override
State<OpenSourceLicenses> createState() => _OpenSourceLicensesState();
}
class _OpenSourceLicensesState extends State<OpenSourceLicenses> {
late final notices = collectLicenseNotices(LicenseRegistry.licenses);
@override
Widget build(BuildContext context) => Scaffold(
appBar: AppBar(title: const CopyText('Open-source licenses')),
body: FutureBuilder<Map<String, Set<String>>>(
future: notices,
builder: (context, snapshot) {
if (snapshot.hasError) {
return const Center(child: CopyText('Licenses could not be loaded.'));
}
if (!snapshot.hasData) {
return const Center(child: CircularProgressIndicator());
}
final entries = snapshot.data!.entries.toList()
..sort((a, b) => a.key.toLowerCase().compareTo(b.key.toLowerCase()));
return ListView(
padding: const EdgeInsets.all(20),
children: [
const CopyText(
'Lumen uses open-source software and fonts. Choose a component to read its notices.',
),
const SizedBox(height: 16),
for (final entry in entries)
Card(
child: ExpansionTile(
title: Text(entry.key),
subtitle: const CopyText('View license notice'),
children: [
for (final notice in entry.value)
Padding(
padding: const EdgeInsets.all(16),
child: SelectableText(notice),
),
],
),
),
],
);
},
),
);
}
+31 -9
View File
@@ -98,27 +98,49 @@ class ShelfActivities extends StatelessWidget {
style: const TextStyle(fontFamily: 'sans-serif', fontSize: 15), style: const TextStyle(fontFamily: 'sans-serif', fontSize: 15),
), ),
const SizedBox(height: 12), const SizedBox(height: 12),
Wrap( SizedBox(
spacing: 12, width: double.infinity,
runSpacing: 8, child: FilledButton.icon(
children: [
FilledButton.icon(
key: const ValueKey('shelf-daily'), key: const ValueKey('shelf-daily'),
onPressed: () => game.startDaily(DateTime.now()), onPressed: () => game.startDaily(DateTime.now()),
style: FilledButton.styleFrom(
minimumSize: const Size(0, 64),
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 16),
),
icon: Icon( icon: Icon(
game.todaySolved ? Icons.check : Icons.wb_sunny_outlined, game.todaySolved ? Icons.check : Icons.wb_sunny_outlined,
size: 24,
), ),
label: CopyText( label: CopyText(
game.todaySolved ? 'Revisit today’s puzzle' : 'Today’s puzzle', game.todaySolved ? 'Revisit today’s puzzle' : 'Today’s puzzle',
style: const TextStyle(
fontFamily: 'sans-serif',
fontSize: 20,
fontWeight: FontWeight.w600,
), ),
), ),
OutlinedButton.icon( ),
),
const SizedBox(height: 12),
SizedBox(
width: double.infinity,
child: OutlinedButton.icon(
key: const ValueKey('shelf-postcards'), key: const ValueKey('shelf-postcards'),
onPressed: onPostcards, onPressed: onPostcards,
icon: const Icon(Icons.local_post_office_outlined), style: OutlinedButton.styleFrom(
label: const CopyText('Island postcards'), minimumSize: const Size(0, 64),
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 16),
),
icon: const Icon(Icons.local_post_office_outlined, size: 24),
label: const CopyText(
'Island postcards',
style: TextStyle(
fontFamily: 'sans-serif',
fontSize: 20,
fontWeight: FontWeight.w600,
),
),
), ),
],
), ),
const SizedBox(height: 8), const SizedBox(height: 8),
CopyText( CopyText(
+1 -1
View File
@@ -2,7 +2,7 @@
"""Read-only game-progress smoke check of the installed Flutter app; no fixtures/reset.""" """Read-only game-progress smoke check of the installed Flutter app; no fixtures/reset."""
import argparse,re,subprocess,time,xml.etree.ElementTree as ET import argparse,re,subprocess,time,xml.etree.ElementTree as ET
from pathlib import Path from pathlib import Path
p=argparse.ArgumentParser();p.add_argument('--serial',required=True);p.add_argument('--package',default='com.lumen.daily');p.add_argument('--expect-fresh',action='store_true');a=p.parse_args() p=argparse.ArgumentParser();p.add_argument('--serial',required=True);p.add_argument('--package',default='de.softwareapp_hb.lumen.daily');p.add_argument('--expect-fresh',action='store_true');a=p.parse_args()
assert re.fullmatch(r'[a-zA-Z0-9_.]+',a.package) assert re.fullmatch(r'[a-zA-Z0-9_.]+',a.package)
base=['/home/ubuntu/Android/Sdk/platform-tools/adb','-s',a.serial];out=Path('artifacts/flutter-check');out.mkdir(parents=True,exist_ok=True) base=['/home/ubuntu/Android/Sdk/platform-tools/adb','-s',a.serial];out=Path('artifacts/flutter-check');out.mkdir(parents=True,exist_ok=True)
def adb(*args):return subprocess.check_output(base+list(args)) def adb(*args):return subprocess.check_output(base+list(args))
+18
View File
@@ -0,0 +1,18 @@
import 'package:flutter/foundation.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:lumen/ui/licenses.dart';
void main() {
test('each component keeps distinct notices without duplicates', () async {
final notices = await collectLicenseNotices(
Stream.fromIterable([
LicenseEntryWithLineBreaks(['First', 'Second'], 'Shared notice'),
LicenseEntryWithLineBreaks(['First'], 'Shared notice'),
LicenseEntryWithLineBreaks(['First'], 'Different notice'),
]),
);
expect(notices.length, 2);
expect(notices['First'], {'Shared notice', 'Different notice'});
expect(notices['Second'], {'Shared notice'});
});
}
+58 -7
View File
@@ -13,6 +13,7 @@ import 'package:lumen/main.dart';
import 'package:lumen/services/ads.dart'; import 'package:lumen/services/ads.dart';
import 'package:lumen/services/progress.dart'; import 'package:lumen/services/progress.dart';
import 'package:lumen/ui/postcards.dart'; import 'package:lumen/ui/postcards.dart';
import 'package:lumen/ui/licenses.dart';
import 'postcards_test.dart' show solve; import 'postcards_test.dart' show solve;
@@ -268,9 +269,41 @@ void main() {
}, },
); );
testWidgets( testWidgets('shelf activity buttons remain large on a small screen', (
'shelf daily play preserves the book leaf and returns to the shelf', tester,
(tester) async { ) async {
tester.view.physicalSize = const Size(320, 700);
tester.view.devicePixelRatio = 1;
addTearDown(tester.view.reset);
final book = (await tester.runAsync(Book.load))!;
final game = Game(book, Progress.memory());
await tester.pumpWidget(
MaterialApp(
home: MediaQuery(
data: const MediaQueryData(
size: Size(320, 700),
textScaler: TextScaler.linear(1.5),
),
child: Scaffold(
body: SingleChildScrollView(
child: ShelfActivities(game: game, onPostcards: () {}),
),
),
),
),
);
await tester.pumpAndSettle();
for (final key in ['shelf-daily', 'shelf-postcards']) {
final size = tester.getSize(find.byKey(ValueKey(key)));
expect(size.width, greaterThan(250));
expect(size.height, greaterThanOrEqualTo(64));
}
expect(tester.takeException(), isNull);
});
testWidgets('daily play and postcards are on the shelf, not the book page', (
tester,
) async {
tester.view.physicalSize = const Size(600, 960); tester.view.physicalSize = const Size(600, 960);
tester.view.devicePixelRatio = 1; tester.view.devicePixelRatio = 1;
addTearDown(tester.view.reset); addTearDown(tester.view.reset);
@@ -300,16 +333,34 @@ void main() {
} }
await tester.pumpAndSettle(); await tester.pumpAndSettle();
await capture(tester, 'shelf'); await capture(tester, 'shelf');
expect(find.text('Open-source licenses'), findsNothing);
await tester.tap(find.text('Settings'));
await tester.pumpAndSettle();
await tester.tap(find.text('Open-source licenses'));
await tester.pumpAndSettle();
expect(find.byType(OpenSourceLicenses), findsOneWidget);
await tester.pageBack();
await tester.pumpAndSettle();
expect(find.byKey(const ValueKey('shelf-activities')), findsOneWidget);
expect(find.byKey(const ValueKey('shelf-daily')), findsOneWidget);
await tester.tap(find.byKey(const ValueKey('shelf-postcards')));
await tester.pumpAndSettle();
expect(g.screen, Screen.postcards);
await tester.binding.handlePopRoute();
await tester.pumpAndSettle();
await tester.tap(find.byKey(const ValueKey('shelf-daily'))); await tester.tap(find.byKey(const ValueKey('shelf-daily')));
await tester.pumpAndSettle(); await tester.pumpAndSettle();
expect(g.mode, Mode.daily); expect(g.mode, Mode.daily);
expect(store.text('flutter_screen'), 'story');
await tester.binding.handlePopRoute(); await tester.binding.handlePopRoute();
await tester.pumpAndSettle(); await tester.pumpAndSettle();
expect(g.screen, Screen.library); expect(g.screen, Screen.library);
expect(store.text('notebook_last_page'), book.pages[2].id); g.home();
await tester.pumpAndSettle();
expect(find.text('Play today’s puzzle →'), findsNothing);
expect(find.text('Island postcards'), findsNothing);
expect(find.textContaining('Practice ·'), findsNothing);
expect(find.textContaining('Difficulty ·'), findsNothing);
expect(tester.takeException(), isNull); expect(tester.takeException(), isNull);
await tester.pumpWidget(const SizedBox()); await tester.pumpWidget(const SizedBox());
}, });
);
} }