@blotch/angular-lynx-native 22.3.1 → 22.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +47 -15
- package/dist/android/project.d.ts +114 -1
- package/dist/android/project.d.ts.map +1 -1
- package/dist/android/project.js +440 -5
- package/dist/eject.d.ts +15 -1
- package/dist/eject.d.ts.map +1 -1
- package/dist/eject.js +14 -2
- package/dist/features.d.ts +70 -0
- package/dist/features.d.ts.map +1 -0
- package/dist/features.js +115 -0
- package/dist/files.d.ts +24 -0
- package/dist/files.d.ts.map +1 -0
- package/dist/files.js +41 -0
- package/dist/generate.d.ts +34 -3
- package/dist/generate.d.ts.map +1 -1
- package/dist/generate.js +78 -19
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +16 -2
- package/dist/ios/build.d.ts.map +1 -1
- package/dist/ios/build.js +8 -2
- package/dist/ios/frameworks.d.ts +6 -5
- package/dist/ios/frameworks.d.ts.map +1 -1
- package/dist/ios/frameworks.js +46 -15
- package/dist/ios/project.d.ts +192 -11
- package/dist/ios/project.d.ts.map +1 -1
- package/dist/ios/project.js +823 -33
- package/dist/options.d.ts +208 -1
- package/dist/options.d.ts.map +1 -1
- package/dist/options.js +154 -0
- package/dist/permissions.d.ts +18 -1
- package/dist/permissions.d.ts.map +1 -1
- package/dist/permissions.js +79 -4
- package/dist/plugins.d.ts +245 -0
- package/dist/plugins.d.ts.map +1 -0
- package/dist/plugins.js +1244 -0
- package/package.json +1 -1
- package/templates/android/README.md +46 -5
- package/templates/android/angular-lynx.properties +2 -0
- package/templates/android/app/build.gradle.kts +78 -11
- package/templates/android/app/src/main/AndroidManifest.xml +19 -3
- package/templates/android/app/src/main/java/dev/angularlynx/shell/AngularLynxPlugins.kt +13 -0
- package/templates/android/app/src/main/java/dev/angularlynx/shell/AudioRecorderModule.kt +520 -0
- package/templates/android/app/src/main/java/dev/angularlynx/shell/BarcodeScannerModule.kt +144 -0
- package/templates/android/app/src/main/java/dev/angularlynx/shell/BiometricsModule.kt +433 -0
- package/templates/android/app/src/main/java/dev/angularlynx/shell/BitmapPresenter.kt +98 -0
- package/templates/android/app/src/main/java/dev/angularlynx/shell/BitmapRendererContext.kt +175 -0
- package/templates/android/app/src/main/java/dev/angularlynx/shell/BluetoothModule.kt +1288 -0
- package/templates/android/app/src/main/java/dev/angularlynx/shell/CalendarModule.kt +127 -0
- package/templates/android/app/src/main/java/dev/angularlynx/shell/Canvas2DContext.kt +1557 -0
- package/templates/android/app/src/main/java/dev/angularlynx/shell/Canvas2DOps.kt +63 -0
- package/templates/android/app/src/main/java/dev/angularlynx/shell/CanvasFilter.kt +357 -0
- package/templates/android/app/src/main/java/dev/angularlynx/shell/CanvasUI.kt +4 -3
- package/templates/android/app/src/main/java/dev/angularlynx/shell/EdgeToEdgeOverlay.kt +24 -0
- package/templates/android/app/src/main/java/dev/angularlynx/shell/EngineThreadHint.kt +156 -0
- package/templates/android/app/src/main/java/dev/angularlynx/shell/FilePickerModule.kt +263 -0
- package/templates/android/app/src/main/java/dev/angularlynx/shell/GeolocationModule.kt +557 -0
- package/templates/android/app/src/main/java/dev/angularlynx/shell/HapticsModule.kt +82 -0
- package/templates/android/app/src/main/java/dev/angularlynx/shell/HostElementUI.kt +331 -0
- package/templates/android/app/src/main/java/dev/angularlynx/shell/ImagePickerModule.kt +143 -0
- package/templates/android/app/src/main/java/dev/angularlynx/shell/ImagePipeline.kt +83 -0
- package/templates/android/app/src/main/java/dev/angularlynx/shell/MainActivity.kt +523 -9
- package/templates/android/app/src/main/java/dev/angularlynx/shell/ModuleBytes.kt +58 -0
- package/templates/android/app/src/main/java/dev/angularlynx/shell/MotionModule.kt +332 -0
- package/templates/android/app/src/main/java/dev/angularlynx/shell/NetworkStatus.kt +121 -0
- package/templates/android/app/src/main/java/dev/angularlynx/shell/NfcModule.kt +274 -0
- package/templates/android/app/src/main/java/dev/angularlynx/shell/PermissionRequests.kt +35 -0
- package/templates/android/app/src/main/java/dev/angularlynx/shell/PhotoLibraryModule.kt +355 -0
- package/templates/android/app/src/main/java/dev/angularlynx/shell/ShareTargetModule.kt +234 -0
- package/templates/android/app/src/main/java/dev/angularlynx/shell/ShellApplication.kt +7 -8
- package/templates/android/app/src/main/java/dev/angularlynx/shell/ShellModule.kt +58 -4
- package/templates/android/app/src/main/java/dev/angularlynx/shell/StoreReviewModule.kt +66 -0
- package/templates/android/app/src/main/java/dev/angularlynx/shell/SystemFontFamilies.kt +68 -0
- package/templates/android/app/src/main/java/dev/angularlynx/shell/TrackingModule.kt +74 -0
- package/templates/android/app/src/main/java/dev/angularlynx/shell/VideoFrameTarget.kt +429 -0
- package/templates/android/app/src/main/java/dev/angularlynx/shell/VideoUI.kt +676 -0
- package/templates/android/app/src/main/java/dev/angularlynx/shell/WebGLContext.kt +128 -13
- package/templates/android/app/src/main/java/dev/angularlynx/shell/WebGLModule.kt +493 -65
- package/templates/android/app/src/main/java/dev/angularlynx/shell/WifiModule.kt +429 -0
- package/templates/android/app/src/main/res/values/biometrics.xml +9 -0
- package/templates/android/app/src/main/res/values/share_target.xml +11 -0
- package/templates/android/app/src/main/res/xml/backup_rules.xml +5 -3
- package/templates/android/app/src/main/res/xml/data_extraction_rules.xml +6 -3
- package/templates/android/app/src/main/res/xml/share_paths.xml +7 -2
- package/templates/android/build.gradle.kts +1 -1
- package/templates/android/gradle/wrapper/gradle-wrapper.properties +2 -2
- package/templates/ios/App/AngularLynxBitmapRendererContext.m +188 -0
- package/templates/ios/App/AngularLynxCanvas2DContext.m +2467 -0
- package/templates/ios/App/AngularLynxCanvas2DOps.h +61 -0
- package/templates/ios/App/AngularLynxPlugins.swift +22 -0
- package/templates/ios/App/AngularLynxVideo.h +37 -0
- package/templates/ios/App/AngularLynxVideo.m +435 -0
- package/templates/ios/App/AngularLynxWebGL.h +69 -7
- package/templates/ios/App/AngularLynxWebGL.m +538 -29
- package/templates/ios/App/AngularLynxWebGLContext.m +148 -46
- package/templates/ios/App/AnimationFrameRate.swift +66 -0
- package/templates/ios/App/AppDelegate.swift +37 -3
- package/templates/ios/App/AppleSignInButton.swift +106 -0
- package/templates/ios/App/AppleSignInModule.swift +222 -0
- package/templates/ios/App/AudioRecorderModule.swift +433 -0
- package/templates/ios/App/BarcodeScannerModule.swift +284 -0
- package/templates/ios/App/BiometricsModule.swift +256 -0
- package/templates/ios/App/BluetoothModule.swift +1086 -0
- package/templates/ios/App/CalendarModule.swift +158 -0
- package/templates/ios/App/FilePickerModule.swift +240 -0
- package/templates/ios/App/GeolocationModule.swift +455 -0
- package/templates/ios/App/HapticsModule.swift +90 -0
- package/templates/ios/App/HostElementUI.swift +270 -0
- package/templates/ios/App/ImagePickerModule.swift +160 -1
- package/templates/ios/App/Info.plist +2 -0
- package/templates/ios/App/LynxViewController.swift +274 -9
- package/templates/ios/App/MotionModule.swift +430 -0
- package/templates/ios/App/NetworkStatus.swift +41 -0
- package/templates/ios/App/NfcModule.swift +346 -0
- package/templates/ios/App/PhotoLibraryModule.swift +169 -0
- package/templates/ios/App/ShareTargetModule.swift +150 -0
- package/templates/ios/App/ShellModule.swift +17 -0
- package/templates/ios/App/StoreReviewModule.swift +61 -0
- package/templates/ios/App/TrackingModule.swift +121 -0
- package/templates/ios/App/WifiModule.swift +237 -0
- package/templates/ios/App/XElementRegistry.swift +13 -3
- package/templates/ios/ShareExtension/Info.plist +42 -0
- package/templates/ios/ShareExtension/ShareViewController.swift +387 -0
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@ User documentation: [Publishing your App](../website/docs/guide/building-for-pro
|
|
|
6
6
|
|
|
7
7
|
## What it does
|
|
8
8
|
|
|
9
|
-
1. **Generates** the native project from `templates/ios` or `templates/android` into the project's folder in Angular's build cache (`.angular/cache/<Angular version>/<project>/lynx-native/<platform>`, which `ng new` already gitignores and `ng cache clean` clears), writing the app options from `angular.json` into the few files the templates mark for it. It regenerates only when a hash of its inputs changes (this package's version, the template, the options, the icon and splash images), so Xcode and Gradle keep their incremental state.
|
|
9
|
+
1. **Generates** the native project from `templates/ios` or `templates/android` into the project's folder in Angular's build cache (`.angular/cache/<Angular version>/<project>/lynx-native/<platform>`, which `ng new` already gitignores and `ng cache clean` clears), writing the app options from `angular.json` into the few files the templates mark for it. An app without `permissions.bluetooth` gets no Bluetooth module (`BluetoothModule.swift`, `BluetoothModule.kt`): App Store Connect flags an app whose code uses CoreBluetooth without `NSBluetoothAlwaysUsageDescription`, so such an app ships no Bluetooth code on either platform. It regenerates only when a hash of its inputs changes (this package's version, the template, the options, the icon and splash images), so Xcode and Gradle keep their incremental state.
|
|
10
10
|
2. **Copies** `dist/` (without the web bundle) into the project.
|
|
11
11
|
3. **Builds** it with `xcodebuild` or Gradle and copies the binaries to `dist/<platform>/`.
|
|
12
12
|
4. **Runs** it, with `--run` (`src/ios/run.ts`, `src/android/run.ts`): picks a simulator, emulator or phone (`--device`, else a running one, else the newest iPhone simulator or the first AVD) and starts it before step 3, so it boots while the app compiles; then installs the app and opens it. iOS uses `simctl` and shows the simulator in DeviceHub (`devices://device/open?id=<UDID>`) or, before Xcode 27.1, the Simulator app. When `--device` names a paired iPhone (`src/ios/iphone.ts`, found with `devicectl list devices`), step 3 builds a development-signed `-sdk iphoneos` app for it instead (`ios.teamId`, `-allowProvisioningUpdates`), and `devicectl` installs and opens it. Android uses the SDK's `adb` and `emulator` and opens the launcher activity by component.
|
|
@@ -21,35 +21,67 @@ Both are one full-screen `LynxView` running `main.lynx.bundle`; Angular Router d
|
|
|
21
21
|
|
|
22
22
|
Both run Lynx's engine thread, where the main thread's JavaScript, and so the whole Angular app, runs with layout and Lynx's animator, off the platform's UI thread: Lynx's `MostOnTASM` thread strategy (`setThreadStrategyForRender(.mostOnTASM)`, `setThreadStrategyForRendering(ThreadStrategyForRendering.MOST_ON_TASM)`), where Lynx's default, and Lynx Explorer's, is `AllOnUI`. So change detection, a screen being built or a busy event handler doesn't freeze what UIKit and Android run themselves: a scroll view's momentum, typing in a text field, a web view. The cost is that the element tree reaches the screen a step later, after the flush crosses to the UI thread, and UI methods with it: the build plugin turns on Lynx's pending invokes (`enableElementInvokeUIMethodPendingTask`), which send a method after the flush that makes the element's UI. A `<list>` needs `enable-async-list` under this strategy, which the runtime sets on every list. The main-thread modules run on the engine thread too (below).
|
|
23
23
|
|
|
24
|
+
On Android 12 and later the shell also tells Android when that thread has work coming (`EngineThreadHint.kt`). The engine thread works in bursts (a tap's handler, a navigation, a page to build), and Android's scheduler picks a thread's core and the core's frequency from how busy the thread has been, so each burst starts on a slow core. The shell keeps a performance hint session (`PerformanceHintManager`) for the thread, as Android keeps one for the UI thread and RenderThread itself, and reports to it at every touch: a finger going down or lifting, and a move no more often than the system reads reports. On a Pixel 9 Pro Fold a pushed page's first render came 22 ms after the tap's handler, where it took 44 ms, for about 60 mJ more energy a push. The reports stop with the touches, and Android lets the thread back down by itself.
|
|
25
|
+
|
|
24
26
|
Release builds log only Lynx's warnings and errors. Lynx's iOS frameworks and Android AARs are built for release, where Lynx logs at INFO: a line for every touch move, hit test, flush, layout, event listener and main-thread module call, written as it's logged (`NSLog` on iOS, a call from native code into `android.util.Log` on Android), mostly on the engine thread and, during a touch, on the UI thread. So `AppDelegate` calls `SetMinimumLoggingLevel(.warning)` before anything else, under `#if !DEBUG`, and `ShellApplication` calls `LLog.setMinimumLoggingLevel(LLog.WARN)` when the app isn't debuggable, after `LynxEnv`'s init, which loads the native library the call needs. The development build (`ng serve --platform`) keeps every line. The app's JavaScript errors still reach the system log, since Lynx logs them as errors, and its `console` output is unchanged: Lynx writes that whatever the level.
|
|
25
27
|
|
|
26
|
-
Both send the same global props, which the runtime's services read: `platform`, `theme` (again whenever the phone switches between light and dark), `appLocale` (the phone's language as a BCP 47 tag), `appTimeZone` (its time zone's IANA name, which the `intl` build option's `Intl.DateTimeFormat` uses), `isNotchScreen`, `edgeToEdge`, the safe-area insets `safeAreaTop`, `safeAreaBottom`, `safeAreaLeft` and `safeAreaRight` (again whenever they change), `osVersion` (which Lynx leaves out of the main thread's `SystemInfo`), the accessibility settings `reduceMotion`, `reduceTransparency` (iOS only) and `increaseContrast`, again whenever the user changes one, and `initialURL`, the link that started the app, if one did, with one of angular.json's `deepLinkSchemes` or an https link to its `appLinkDomains` (the scene's `connectionOptions.urlContexts`, or for a Universal Link its web browsing `userActivities`, on iOS, the launch intent's data on Android, unless the app was reopened from Recents), which `LynxLinking.getInitialURL()` returns and the router starts at. Android 12 and later also send `dynamicColors`, the wallpaper's Material 3 color roles in light and dark (`DynamicColors.kt`), again when the user changes their wallpaper or colors. Lynx Explorer sends `theme` and `isNotchScreen` too, but no `appLocale`, `appTimeZone`, `osVersion` or
|
|
28
|
+
Both send the same global props, which the runtime's services read: `platform`, `theme` (again whenever the phone switches between light and dark), `appLocale` (the phone's language as a BCP 47 tag), `appTimeZone` (its time zone's IANA name, which the `intl` build option's `Intl.DateTimeFormat` uses), `isNotchScreen`, `edgeToEdge`, the safe-area insets `safeAreaTop`, `safeAreaBottom`, `safeAreaLeft` and `safeAreaRight` (again whenever they change), `osVersion` (which Lynx leaves out of the main thread's `SystemInfo`), the accessibility settings `reduceMotion`, `reduceTransparency` (iOS only) and `increaseContrast`, again whenever the user changes one, `textScale` (the user's text size, `1` at the default: Dynamic Type's body size over its default on iOS, the font scale on Android, capped by angular.json's `textScaling.max`, `1` with `"textScaling": false`), again whenever it changes, `appState` (`active`, `inactive` or `background`, which `LynxAppState` reads, again as the scene's activation changes on iOS and as the activity starts, resumes, pauses and stops, or another window takes the focus, on Android), `online` (whether the phone has a route to the internet, which `LynxNetwork` reads: `NWPathMonitor`'s path is `satisfied` on iOS, which means a connection can be tried rather than that it succeeds, and is sent as online until the monitor's first path; on Android the default network has the internet capability and Android has validated it, so a captive portal counts as offline; again whenever it changes, `NetworkStatus.swift` and `NetworkStatus.kt`), and `initialURL`, the link that started the app, if one did, with one of angular.json's `deepLinkSchemes` or an https link to its `appLinkDomains` (the scene's `connectionOptions.urlContexts`, or for a Universal Link its web browsing `userActivities`, on iOS, the launch intent's data on Android, unless the app was reopened from Recents), which `LynxLinking.getInitialURL()` returns and the router starts at. Android 12 and later also send `dynamicColors`, the wallpaper's Material 3 color roles in light and dark (`DynamicColors.kt`), again when the user changes their wallpaper or colors. Lynx Explorer sends `theme` and `isNotchScreen` too, but no `appLocale`, `appTimeZone`, `osVersion`, accessibility settings, `textScale`, `appState` or `online`. Both shells also set the `LynxView`'s font scale to `textScale`, at launch and with `updateFontScale` when it changes (Android keeps the activity through a font size change: the manifest's `configChanges` lists `fontScale`). The build tells Lynx to scale only `sp` lengths by it and writes the page's root font size in `sp`, so every `rem` follows the phone's text size and a `px` size stays as written. See [`templates/android/README.md`](templates/android/README.md) for the Android shell's details.
|
|
29
|
+
|
|
30
|
+
Both register the native modules the runtime's services call, which Lynx Explorer doesn't have: `AngularLynxWebAuth` (`WebAuthModule.swift`, `WebAuthModule.kt`) opens `LynxWebAuthSession`'s sign-in page, in `ASWebAuthenticationSession` on iOS and a Custom Tab on Android, and returns the URL it redirects to. `AngularLynxLocalStorage` (`LocalStorageModule.swift`, `LocalStorageModule.kt`) keeps `LynxLocalStorage`'s values in a `UserDefaults` suite and a `SharedPreferences` file of their own. `AngularLynxSecureStorage` (`SecureStorageModule.swift`, `SecureStorageModule.kt`) keeps `LynxSecureStorage`'s in the Keychain on iOS and, on Android, in `SharedPreferences`, each value encrypted with AES-GCM by an Android Keystore key, a file Auto Backup leaves out (`res/xml/backup_rules.xml`, `data_extraction_rules.xml`). `AngularLynxLinking` (`LinkingModule.swift`, `LinkingModule.kt`) opens `LynxLinking`'s links: `openURL` with `UIApplication.open` and an `ACTION_VIEW` intent, `openInApp` in `SFSafariViewController` and a Custom Tab, and `canOpenURL` with `UIApplication.canOpenURL` and `resolveActivity`, which answer only for the schemes the generator writes from angular.json's `canOpenURLSchemes` (with `http`, `https`, `mailto`, `tel` and `sms`) into Info.plist's `LSApplicationQueriesSchemes` and the manifest's `<queries>`. It also has `takeURLs`, which hands `LynxLinking.onURL()` and the router the links that open the app while it's running: `SceneDelegate.scene(_:openURLContexts:)` and `scene(_:continue:)` (a Universal Link), and `MainActivity.onNewIntent` (after a waiting web sign-in has had its redirect) keep each one (`LinkCenter` in `LinkingModule.swift`, the module's companion on Android) and send the `angularLynxURL` global event, which the runtime answers by taking them, as `LynxShortcuts` does. `AngularLynxImagePicker` (`ImagePickerModule.swift`, `ImagePickerModule.kt`) lets the person pick a photo for `LynxImagePicker`, with `PHPickerViewController` on iOS and the Photo Picker on Android, neither of which needs a permission, and calls back with it as base64, re-encoded as an upright JPEG when the app asks for a smaller one or the photo is a format such as HEIC. Its `takePhoto` opens the camera for `pick({ source: 'camera' })`, `UIImagePickerController` on iOS and the phone's camera app on Android (`ActivityResultContracts.TakePicture`, into the share `FileProvider`'s `angular-lynx-camera` cache folder, after asking for `CAMERA` through `PermissionHost`), and always re-encodes the photo as an upright JPEG. Only an app whose angular.json sets `permissions.camera` has it (ITMS-90683, as for the scanner below): the generator's `leaveOut` takes out the lines between `// angular-lynx:image-picker-camera` markers in `ImagePickerModule.swift`, `ImagePickerModule.kt` and `MainActivity.kt`, and the camera folder from `res/xml/share_paths.xml`, so the runtime finds no `takePhoto` and rejects with `unavailable`. `AngularLynxShare` (`ShareModule.swift`, `ShareModule.kt`) opens `LynxShare`'s share sheet, `UIActivityViewController` on iOS and an `ACTION_SEND` chooser on Android, with the files written to temporary files on iOS and shared through a `FileProvider` on Android. Save Image on iOS needs `NSPhotoLibraryAddUsageDescription`, which the generator always writes (angular.json's `permissions.savePhotos`, with a default). `AngularLynxPhotoLibrary` (`PhotoLibraryModule.swift`, `PhotoLibraryModule.kt`) saves `LynxPhotoLibrary`'s image or video straight to the library: `PHAssetCreationRequest` with add-only access on iOS, and a MediaStore insert into `Pictures/<app name>` or `Movies/<app name>` on Android 10 and later, which needs no permission (it answers `unavailable` before Android 10). Only an app whose angular.json sets `permissions.savePhotos` has it: the generator's `leaveOut` deletes it from the others, with its registration between `MainActivity`'s `// angular-lynx:photo-library` markers, and iOS registers it by name. `permissions.photos` is iOS only (`NSPhotoLibraryUsageDescription`): Android declares nothing for it, since nothing in the shells reads the library and Google Play rejects `READ_MEDIA_IMAGES` without a core need. `AngularLynxBarcodeScanner` (`BarcodeScannerModule.swift`, `BarcodeScannerModule.kt`) reads a QR code or a barcode for `LynxBarcodeScanner` with the platform's own scanner, VisionKit's `DataScannerViewController` on iOS (16 and later) and Google's code scanner from Play services on Android (`play-services-code-scanner`, which needs no camera permission), and calls back with `{ format, value }`. Only an app whose angular.json sets `permissions.camera` has it: App Store Connect flags an app whose code uses the camera without `NSCameraUsageDescription` (ITMS-90683), so the generator's `configure` deletes the module from every other app, on Android with the library between `app/build.gradle.kts`'s `// angular-lynx:barcode-scanner` markers, and the shells register it by name (`NSClassFromString("AngularLynxBarcodeScannerModule")`, `Class.forName`), which builds either way. `AngularLynxShell` (`ShellModule.swift`, `ShellModule.kt`) has `hideSplashScreen`, which the runtime's `LynxSplashScreen` calls once the app's first screen is drawn (at Angular's first frame, or when `provideSplashScreen()` says): the phone takes a launch screen down at the app's first frame, which is the empty LynxView, so the iOS shell keeps a copy of it over the LynxView (`SplashScreen.swift`, the `LaunchBackground` color and `LaunchImage` image the generator writes from angular.json's `splash`) and Android's `MainActivity` keeps AndroidX's splash screen up (`installSplashScreen()`, `setKeepOnScreenCondition`), each fading it out when it's called, or five seconds after the app starts. It has `collectGarbage`, which the runtime calls once the app has released about a screen's worth of elements and settled: it reports moderate memory pressure with `LynxEnv.trimMemory`, which makes Lynx run a full collection of the main thread's JavaScript heap, freeing what PrimJS's routine collections leave behind of the screens that went. It has `markEvent(name)`, which marks a moment the app names in a system trace: an `os_signpost` event named `Mark` with the name as its message, in the Points of Interest category Instruments shows (os_signpost's names are fixed when the shell is compiled), and on Android an instant `Trace` section of that name, which Perfetto shows, and a `Mark <name> at <ns> ns` line in logcat, with `SystemClock.elapsedRealtimeNanos()` at the call (logcat shows no trace sections), as its `reportFullyDrawn` logs `Fully Drawn at <ns> ns` beside the system's own `Fully drawn` line, which gives no clock time. The runtime doesn't call it; the benchmark apps mark their mount screen's start with it (`benchmarks/SPEC.md`), for the harness to time the screen apart from the launch. On Android it also connects the back button. Both shells report the system's memory warnings to `trimMemory` too, and leaving the screen. `AngularLynxShortcuts` (`ShortcutsModule.swift`, `ShortcutsModule.kt`) keeps the shortcuts the person ran until the runtime's `LynxShortcuts` takes them, with `take`, at startup and each time the shell sends the `angularLynxShortcut` global event, so the shortcut that started the app isn't lost and none is handled twice. The generator writes angular.json's `shortcuts` as App Intents on iOS (`App/AppShortcuts.swift`, with an `AppShortcutsProvider`: Xcode's App Intents step reads the titles and phrases out of the compiled code, so they have to be source), which Siri, Spotlight and the Shortcuts app run, and as static shortcuts on Android (`res/xml/shortcuts.xml`, with the titles in `res/values/shortcuts.xml`), in the menu a long press on the app's icon opens. Android starts a static shortcut's activity in a cleared task, which would end the running app, so they point at `ShortcutActivity`, which has a task of its own and passes the shortcut on to `MainActivity`.
|
|
27
31
|
|
|
28
|
-
|
|
32
|
+
`AngularLynxBiometrics` (`BiometricsModule.swift`, `BiometricsModule.kt`) is `LynxBiometrics`' prompt and the store for `LynxSecureStorage`'s `requireBiometrics` values (issue #918). `availability` reports the sensor (`LAContext.biometryType`; on Android `BiometricManager.canAuthenticate(BIOMETRIC_STRONG)` and the package manager's fingerprint, face and iris features), whether a face or finger is enrolled, and whether the phone has a passcode. `authenticate` shows `LAContext.evaluatePolicy` (biometrics only, with the "Enter Password" fallback hidden, or `.deviceOwnerAuthentication` with `allowDeviceCredential`) or AndroidX's `BiometricPrompt`, strong biometrics only, which is why `MainActivity` is a `FragmentActivity`. The store keeps each value on iOS as a Keychain item of its own service with `SecAccessControl(.biometryCurrentSet)` and `kSecAttrAccessibleWhenPasscodeSetThisDeviceOnly`, read with an `LAContext` whose `localizedReason` is the app's (a missing key is found from its attributes first, which don't ask), and on Android sealed with AES-GCM under a key of its own, which RSA-OAEP wraps under a Keystore key pair that needs a strong biometric for each use (`setUserAuthenticationRequired`, `setInvalidatedByBiometricEnrollment`): storing uses the public key and doesn't prompt, and reading unwraps through `BiometricPrompt`'s `CryptoObject`. Enrolling a new face or finger invalidates the item or the pair, and the values then read as none. Only an app with angular.json's `permissions.biometrics` has the module: the generator (`leaveOut`) deletes `BiometricsModule.swift` (`IOS_BIOMETRICS_SOURCES`), or `BiometricsModule.kt` (`ANDROID_BIOMETRICS_SOURCES`), `res/values/biometrics.xml` (the prompt's default reason, which it writes from the permission) and the lines between the `// angular-lynx:biometrics` markers of `MainActivity.kt` and `app/build.gradle.kts` (its registration and AndroidX Biometric) from the others, and LynxViewController registers it by its Objective-C name (`AngularLynxBiometricsModule`). That keeps `LocalAuthentication` out of an iOS app with no `NSFaceIDUsageDescription`, without which Face ID fails.
|
|
29
33
|
|
|
30
34
|
Only the development build (`ng serve --platform`) loads from a dev server: the code is in `App/DevServer.swift` and `App/DevServerModules.swift` under `#if DEBUG`, and in the debug source set on Android (`app/src/debug`, with a no-op `DevServer` in `app/src/release`), so a release build can't be pointed anywhere else. `DevServer` reads the URL from the launch argument or intent extra and keeps it (`UserDefaults`, `SharedPreferences`), so the app opened from the home screen loads from the same server. The loaders (`BundleResourceFetcher.swift`, `ResourceFetchers.kt`) and `AngularLynxAssets` then fetch every relative URL, and on Android every URL on the address the bundle was built with, from the dev server instead of the app, uncached. When the bundle itself doesn't load, `DevServer` covers the page with a message and loads it again every two seconds. rspeedy's live reload client talks to Lynx DevTool, which the shells don't have: `NativeModules.LynxWebSocketModule` (through `@lynx-js/websocket`) for the dev server's socket and `NativeModules.LynxDevToolSetModule.invokeCdp` for a full reload (a DevTool protocol `Page.reload`). The development build registers modules under those names (`DevWebSocketModule`, `DevReloadModule`): a WebSocket with `URLSessionWebSocketTask` and OkHttp that sends the same `websocketOpen`, `websocketMessage`, `websocketClosed` and `websocketFailed` global events as Lynx DevTool's, and a `Page.reload` that loads the bundle again, as DevTool's `LynxPageReloadHelper` does. URLSession sends an empty `Sec-WebSocket-Protocol` header for an empty protocol list, which the dev server refuses, so the iOS socket passes none then. On Android, the debug build's `network_security_config.xml` allows plain HTTP to any host, since the app's own `fetch()` of an imported file goes to the address the bundle was built with; the release build's allows it to `localhost` alone.
|
|
31
35
|
|
|
32
36
|
`AngularLynxClipboard` (`ClipboardModule.swift`, `ClipboardModule.kt`) copies `LynxClipboard`'s text to `UIPasteboard.general` on iOS and `ClipboardManager` on Android, and reads it back.
|
|
33
37
|
|
|
34
|
-
|
|
38
|
+
`AngularLynxFilePicker` (`FilePickerModule.swift`, `FilePickerModule.kt`) is `LynxFilePicker`'s document picker and save screen (issue #924): `UIDocumentPickerViewController(forOpeningContentTypes:asCopy:)` and `(forExporting:asCopy:)` on iOS, with the runtime's types (MIME types, `image/*` families, `.ext` extensions) as `UTType`s, and `ACTION_OPEN_DOCUMENT` and `ACTION_CREATE_DOCUMENT` on Android, through one `StartActivityForResult` launcher in `MainActivity`, with extensions looked up in `MimeTypeMap`. Neither needs a permission. A pick sums the documents' sizes before reading any and answers `too-large` over the runtime's `maxBytes`; the bytes go each way as base64. An app opts in with angular.json's `filePicker`: without it, the generator deletes both files and the lines between `MainActivity.kt`'s `// angular-lynx:file-picker` markers, and `LynxViewController` finds no `AngularLynxFilePickerModule` class to register. `fileSharing` adds `UIFileSharingEnabled` and `LSSupportsOpeningDocumentsInPlace` to Info.plist, which lists the app's Documents folder in Files.
|
|
39
|
+
|
|
40
|
+
`AngularLynxHaptics` (`HapticsModule.swift`, `HapticsModule.kt`) plays `LynxHaptics`' feedback: `UIImpactFeedbackGenerator`, `UISelectionFeedbackGenerator` and `UINotificationFeedbackGenerator` on iOS, each kept and prepared again after it plays, and `View.performHapticFeedback()` on the activity's window on Android, which needs no permission and follows the person's touch feedback setting.
|
|
41
|
+
|
|
42
|
+
`AngularLynxBluetooth` (`BluetoothModule.swift`, `BluetoothModule.kt`) is the Bluetooth LE central behind `LynxBluetooth`: Core Bluetooth on iOS and `android.bluetooth` on Android, with no background mode. Only an app whose angular.json sets `permissions.bluetooth` has it: the generator deletes both files otherwise, and the shells register it by name (`NSClassFromString`, `Class.forName`) so nothing else refers to it. Every method calls back once, and what happens on its own (sightings, notifications, the radio's state, a device going) arrives as the `angularLynxBluetooth` global event, an object with a `type`; a scan's `device` and `scanStopped` events carry the `scan` id `startScan` was given, so the runtime can tell them from those of the scan it replaced. UUIDs cross as 128-bit lowercase strings and values as base64. Each module runs everything on one queue or thread of its own; Android also runs each connection's GATT operations one after another, since a `BluetoothGatt` takes one at a time, and asks for its runtime permissions through the activity's `PermissionHost` (`PermissionRequests.kt`).
|
|
43
|
+
|
|
44
|
+
`AngularLynxStoreReview` (`StoreReviewModule.swift`, `StoreReviewModule.kt`) asks for `LynxStoreReview`'s rating prompt: `AppStore.requestReview(in:)` on iOS 16 and later and `SKStoreReviewController.requestReview(in:)` before, over the window scene in the foreground, and Google Play's In-App Review API (`com.google.android.play:review`) on Android, launched over the activity. Each calls back `{}` once the request is made, since neither store says whether it showed anything. An app opts in to it: without angular.json's `storeReview`, the generator deletes both files, the lines between `MainActivity.kt`'s and `app/build.gradle.kts`'s `// angular-lynx:store-review` markers, which register the module and add Play's library, and `LynxViewController` finds no `AngularLynxStoreReviewModule` class to register.
|
|
45
|
+
|
|
46
|
+
`AngularLynxTracking` (`TrackingModule.swift`, `TrackingModule.kt`) is `LynxTracking`'s status and prompt (issue #935). On iOS, `status` answers `ATTrackingManager.trackingAuthorizationStatus` and `request` shows App Tracking Transparency's prompt with `requestTrackingAuthorization`, once the app is active: iOS shows it only to an active app, and answers `notDetermined` without showing it to one that isn't, so the module waits for `didBecomeActiveNotification` first, and asks again, after the app is active once more, each time iOS answers `notDetermined` because the app stopped being active before the prompt showed. Android has no prompt: both methods read `AdvertisingIdClient.getAdvertisingIdInfo()` from Google Play services' advertising ID library (`com.google.android.gms:play-services-ads-identifier`) on a worker thread, and answer `denied` when the person has opted out of personalized ads or deleted the ID, `authorized` otherwise, and `unsupported` without Play services. Each calls back `{ status }`. An app opts in with angular.json's `permissions.tracking`, which also writes `NSUserTrackingUsageDescription` and declares `com.google.android.gms.permission.AD_ID`: without it, the generator deletes both files and the lines between `MainActivity.kt`'s and `app/build.gradle.kts`'s `// angular-lynx:tracking` markers, which register the module and add Play's library, and `LynxViewController` finds no `AngularLynxTrackingModule` class to register. That keeps App Tracking Transparency out of an iOS app with no usage description, which iOS ends when it asks.
|
|
47
|
+
|
|
48
|
+
`AngularLynxCalendar` (`CalendarModule.swift`, `CalendarModule.kt`) opens the system's event editor for `LynxCalendar.addEvent()`, filled in with the app's event (title, start and end in milliseconds since 1970, all-day, location, notes): EventKitUI's `EKEventEditViewController` on iOS 17 and later, which runs outside the app and saves the event itself, so the app needs no calendar permission or usage description, and an `ACTION_INSERT` on `CalendarContract.Events` on Android, which the calendar app's own editor takes. iOS calls back `{ result: "saved" }` or `"canceled"`, from the editor's delegate or a swipe down; before iOS 17 the editor needs full calendar access, so it answers `{ error: "unavailable" }`. Android calls back `"saved"` only when the calendar app answers `RESULT_OK`, and `"unknown"` otherwise, since Google Calendar answers `RESULT_CANCELED` either way, or `{ error: "unavailable" }` without a calendar app. `MainActivity` registers the `StartActivityForResult` launcher as it's created, as the image picker's, and passes the module a `CalendarModule.Host`. An app opts in to it with angular.json's `calendar`: without it, the generator deletes both files and the lines between `MainActivity.kt`'s `// angular-lynx:calendar` markers, and `LynxViewController` finds no `AngularLynxCalendarModule` class to register.
|
|
49
|
+
|
|
50
|
+
`AngularLynxAudioRecorder` (`AudioRecorderModule.swift`, `AudioRecorderModule.kt`) records from the microphone for `LynxAudioRecorder` (issue #922): `AVAudioRecorder` through an `AVAudioSession` (`playAndRecord`, put back as it was once the recording ends) on iOS, and `MediaRecorder` on Android, both AAC in an MPEG-4 file (`.m4a`, mono, 44.1 kHz, 64,000 bits a second) in the app's temporary folder. `permission` and `requestPermission` answer `{ permission }` (Android asks for `RECORD_AUDIO` through `PermissionHost`), `start` (`{ recording, maxDuration? }`) asks first if it needs to, `pause`, `resume`, `stop` (`{ clip }`), `cancel` (deletes the file) and `read` (`{ base64 }`, only for the module's own recordings) do the rest. The `angularLynxAudioRecorder` global event carries the `recording` id: `level` (0..1, -60 to 0 dBFS) and `durationMs` ten times a second, `paused` when the system paused it (an interruption on iOS, the app going to the background on both), and `ended` at `maxDuration` (`{ clip }`, which a later `stop` answers with too) or on an error. Only an app with angular.json's `permissions.microphone` has the module: the permission writes `NSMicrophoneUsageDescription` (App Store Connect flags microphone code without it, ITMS-90683), and Android's manifest gets `RECORD_AUDIO` and a not-required `android.hardware.microphone`; the generator (`leaveOut`) deletes the module and the lines between `MainActivity.kt`'s `// angular-lynx:audio-recorder` markers from the others.
|
|
51
|
+
|
|
52
|
+
`AngularLynxNfc` (`NfcModule.swift`, `NfcModule.kt`) reads and writes NFC tags for `LynxNfc` (issue #921): Core NFC's `NFCNDEFReaderSession`, whose system sheet shows the runtime's `alertMessage`, on iOS, and `NfcAdapter.enableReaderMode` (NFC-A, B, F and V), in `MainActivity` while it's in the foreground, on Android. The runtime opens a session with `start` (`{ alertMessage?, multiple, write? }`), takes each tag with `next`, and ends it with `stop`, whose `message` or `errorMessage` iOS's sheet shows as it closes; `state` says `ready`, `disabled` (Android's NFC turned off) or `unsupported`. Records cross as `{ tnf, type, id, payload }` with the bytes in base64, and the runtime (`nfc/ndef.ts`) builds and reads them, Text and URI records included, so the shells only take NDEF messages apart and put them together. A tag is connected, its NDEF status queried, then read or written (an Android tag that `NdefFormatable` reports is formatted with the message); with `multiple`, a tag that fails is skipped and polling restarts. Only an app with angular.json's `permissions.nfc` has the module: the permission writes `NFCReaderUsageDescription`, `IOS_ENTITLEMENTS` adds `com.apple.developer.nfc.readersession.formats` (`TAG`, the only format iOS 13 and later take, which covers NDEF sessions) to `Config/App.entitlements`, Android's manifest gets `android.permission.NFC` and a not-required `android.hardware.nfc`, and the generator (`leaveOut`) deletes the module and the lines between `MainActivity.kt`'s `// angular-lynx:nfc` markers from the others. A free Personal Team can't sign the entitlement, which `explainSigningFailure` says.
|
|
53
|
+
|
|
54
|
+
`AngularLynxGeolocation` (`GeolocationModule.swift`, `GeolocationModule.kt`) finds where the phone is for `LynxGeolocation` (issue #916), while the app is in use. `getState` answers `{ state }` without asking: `unknown`, `denied`, `approximate`, `precise` or `off` (Location turned off for the whole phone). `requestPermission` shows the prompt if the person hasn't been asked, and answers the state. `getCurrentPosition({ accuracy, timeout, maximumAge })` answers `{ position }`, and `startWatch({ watch, accuracy, distanceFilter })` answers `{}` once it's started and sends each position as an `angularLynxGeolocation` global event (`{ type: 'position', watch, position }`), until `stopWatch(watch)`, or a `watchStopped` with the reason; a `state` event follows each change. Both ask first when the person hasn't been asked, and answer `{ error, message }` with `denied`, `off`, `timeout`, `busy` or `failed`. iOS uses Core Location: a `CLLocationManager` per request and watch, all on the main thread, whose `accuracyAuthorization` tells precise from approximate. Android uses `LocationManager` through AndroidX's `LocationManagerCompat`, with no Play services: the fused provider from Android 12, GPS or the network before it, and asks for both location permissions through `MainActivity`'s `PermissionHost`, so Android 12 and later let the person choose approximate, reported as `approximate` rather than a refusal. An app opts in with angular.json's `permissions.location`, which also writes `NSLocationWhenInUseUsageDescription` and declares `ACCESS_COARSE_LOCATION` and `ACCESS_FINE_LOCATION`: without it, the generator deletes both files and the lines between `MainActivity.kt`'s `// angular-lynx:geolocation` markers, and `LynxViewController` finds no `AngularLynxGeolocationModule` class to register, since App Store Connect flags Core Location code without the usage description (ITMS-90683).
|
|
55
|
+
|
|
56
|
+
`AngularLynxAppleSignIn` (`AppleSignInModule.swift`, iOS only) opens `LynxAppleSignIn`'s Sign in with Apple sheet: an `ASAuthorizationAppleIDProvider` request with the scopes, nonce and state asked for, presented by an `ASAuthorizationController` over the key window. It calls back the user identifier, the identity token and authorization code as UTF-8 text, the email and the shared parts of the name when Apple gives them, and `realUserStatus`, or `{ error: 'canceled' | 'failed', message }`. `credentialState` answers `getCredentialState(forUserID:)`, `available` answers `{ available: true }`, and `button`, which the runtime calls synchronously from the main thread, answers `{ available: true }` to say `<apple-sign-in-button>` is registered. That element is `AppleSignInButton.swift`, iOS's `ASAuthorizationAppleIDButton` behind the tag, which `XElementRegistry` registers by its Objective-C name, `AngularLynxAppleSignInButton`; UIKit sets a button's type and style only when it makes it, so a change to `type` or `button-style` makes a new one. The sheet needs the `com.apple.developer.applesignin` entitlement, which a free Personal Team can't sign, so without angular.json's `signInWithApple` the generator deletes both files and writes no entitlement, and `LynxViewController` and `XElementRegistry` find no class to register. Android has no module: the runtime rejects with `unsupported` there, and draws `<apple-sign-in-button>` itself.
|
|
57
|
+
|
|
58
|
+
`AngularLynxMotion` (`MotionModule.swift`, `MotionModule.kt`) is `LynxMotion`'s sensors (issue #920): `CMMotionManager`'s accelerometer and device motion (rotation rate, and the attitude against `.xArbitraryZVertical`) and `CLLocationManager`'s heading on iOS, and `SensorManager`'s accelerometer, gyroscope, game rotation vector and rotation vector on Android, each a `LynxContextModule` that runs a sensor from `start(sensor, interval)` until `stop(sensor)` and sends what it sampled in the `angularLynxMotion` global event, as flat arrays of numbers, at most every 16 ms. Both hear shakes from the accelerometer themselves (the runtime's `ShakeDetector`, after Square's Seismic), convert iOS's acceleration from g to the web's m/s², send the orientation as Android's device-to-earth rotation matrix (iOS's `CMRotationMatrix`, transposed or not by which way gravity says is up), and stop the sensors while the app is in the background. None needs a permission. An app opts in with angular.json's `motion`: without it, the generator deletes both files and the lines between `MainActivity.kt`'s `// angular-lynx:motion` markers, and `LynxViewController` finds no `AngularLynxMotionModule` class to register.
|
|
59
|
+
|
|
60
|
+
`AngularLynxShareTarget` (`ShareTargetModule.swift`, `ShareTargetModule.kt`) hands `LynxShareTarget` what other apps share to the app, for angular.json's `shareTarget.mimeTypes`: `take` calls back `{ shares }`, each `{ title?, text?, url?, files: [{ base64, name, type }] }` (on iOS, at most 20 MiB of files a take, with `more: true` when shares are left, so the runtime takes again), and the shells send the `angularLynxShare` global event when one arrives. On Android the generator writes `ACTION_SEND` and `ACTION_SEND_MULTIPLE` intent filters for the types between the manifest's `angular-lynx:share-target` markers (`text/uri-list` also takes `text/plain`, which is how Android shares a link) and the types to `res/values/share_target.xml`; `MainActivity` hands each share intent to `ShareTargetModule.receive()`, which reads the files on a worker thread while the URI grant lasts. On iOS the generator adds a Share Extension target (`ShareExtension/`, `withShareExtension()` in `src/ios/project.ts`) embedded in the app, with an activation rule built from the types, and the `com.apple.security.application-groups` entitlement (`group.<appId>`) for both: the extension can't run Lynx, so it copies the share into the App Group container and opens the app with its share scheme (`angularlynx-share.<appId>`), which `SceneDelegate` tells from a deep link. A share's files together are at most 20 MiB on both. Without `shareTarget`, the generator deletes the modules, the extension and the lines between `MainActivity.kt`'s `// angular-lynx:share-target` markers, and writes no intent filters, target or App Group.
|
|
61
|
+
|
|
62
|
+
`AngularLynxWifi` (`WifiModule.swift`, `WifiModule.kt`) is `LynxWifi`'s network reads and joins (issue #923). On iOS, `currentNetwork` asks for the person's location the first time (`CLLocationManager.requestWhenInUseAuthorization`), since iOS gives the network only with precise location, then reads `NEHotspotNetwork.fetchCurrent`; `join` applies an `NEHotspotConfiguration` and, when the module can read the network, checks the phone is on it, since `apply` succeeds for a network out of range; `leave` removes the configuration. On Android, `currentNetwork` reads `WifiManager.getConnectionInfo()` once `ACCESS_FINE_LOCATION` is granted and Location is on: without the permission it first asks for fine and coarse location through the activity's `PermissionHost` (`PermissionRequests.kt`, which `MainActivity` registers the module with), and answers `denied` once the person refuses (#990). `join` asks for a `WifiNetworkSpecifier` network with `joinOnce`, and binds the process to it, or adds a `WifiNetworkSuggestion` without, from Android 10. An app opts in with angular.json's `wifi`: without it, the generator deletes both files and `MainActivity`'s `// angular-lynx:wifi` lines; without `readCurrentNetwork` it takes out the `// angular-lynx:wifi-read` lines (the location code, which App Store Connect flags without a location usage description), and without `join` the `// angular-lynx:wifi-join` lines. Each part adds its iOS entitlement through `IOS_ENTITLEMENTS` (`com.apple.developer.networking.HotspotConfiguration`, `com.apple.developer.networking.wifi-info`) and its Android permissions (`CHANGE_WIFI_STATE` and `CHANGE_NETWORK_STATE`, `ACCESS_WIFI_STATE`).
|
|
63
|
+
|
|
64
|
+
`Config/App.entitlements` is written from `IOS_ENTITLEMENTS` in `src/ios/project.ts`: each option that needs a capability (`appLinkDomains`' Associated Domains, `signInWithApple`, `shareTarget`'s App Groups) names its Xcode capability and the entitlements it adds, and `mergeEntitlements` joins them into one file, two options' lists under one key becoming one list. The file, and `CODE_SIGN_ENTITLEMENTS` in the xcconfig, are written only when some option adds an entitlement, so an app that needs none signs with none. A signing error about a capability a Personal Team can't sign names the option that added it (`explainSigningFailure` in `src/ios/build.ts`).
|
|
65
|
+
|
|
66
|
+
Both link Lynx's XElement library, which holds `<input>`, `<textarea>`, `<overlay>`, `<svg>`, `<blur-view>`, `<viewpager>`, `<refresh>`, the `<scroll-coordinator>` family, `<webview>` and `<video>`. Lynx's core doesn't include these, and a host that doesn't register them renders nothing for those tags (on Android, nothing after them either). XElement's AnimaX and Markdown elements are left out: the runtime doesn't support them. On iOS, `<blur-view>` is XElement's with more of UIKit in it (`App/BlurView.swift`): a `blur-material` attribute for UIKit's adaptive blur materials, which the glass components draw their design before iOS 26 on (Lynx's blur-view has only the styles from before iOS 13); Liquid Glass that materializes, dissolves and eases between effects inside a `glass-container`, where Lynx's sets its effect at once; and a `glass-effect-id` attribute that pairs two glass shapes across a change so one morphs into the other (`App/GlassTransitions.swift`). `<video>` is XElement's with its frames readable by a canvas, so `drawImage()` and WebGL's `texImage2D()` (three.js's `VideoTexture`) read the frame it shows (`App/AngularLynxVideo.m`, `VideoUI.kt`; issue #696). `<webview>` loads through XElement's loader, wrapped (`App/WebViewLoader.swift`) to take the loader off its web view's script message handlers when the element goes: XElement's loader never does, so the loader and the web view kept each other, and the web view's WebContent process, for as long as the app ran (issue #397).
|
|
35
67
|
|
|
36
|
-
Both have `<canvas>` with WebGL2 (issue #211), which Lynx doesn't: a `canvas` element (`App/AngularLynxWebGL.m`'s `AngularLynxCanvas`, a `CAMetalLayer` view; `CanvasUI.kt`, a `TextureView`) and the `AngularLynxWebGL` module the runtime's WebGL2 context sends its calls to, which runs them on OpenGL ES 3.0 (`App/AngularLynxWebGLContext.m`, `WebGLContext.kt`). On iOS that's [ANGLE](https://chromium.googlesource.com/angle/angle)'s OpenGL ES, on Metal, which Safari draws WebGL with too: iOS's own OpenGL ES is deprecated, and the Simulator runs it on the CPU, at seconds a frame for a lit three.js scene (issue #238), where Metal draws on the Mac's GPU. ANGLE's `libEGL` and `libGLESv2` frameworks, and its headers, come in the Lynx frameworks zip (below). Android's OpenGL ES is the phone's, which the emulator already runs on the Mac's GPU. The runtime runs on Lynx's main thread and WebGL needs answers synchronously, so both turn on main-thread modules (`enableMTSModule`): the config's modules are then callable from main-thread JavaScript as `lynx.module(name)`, and Lynx calls them on its engine thread, not the UI thread. An EGL context is current on one thread at a time, so GL runs there too, while the canvas's view lives on the UI thread. On iOS the view hands the context what it draws into, its `CAMetalLayer` and its size in pixels (`AngularLynxCanvasTarget`), through Lynx's `runOnTasmThread:`, so the contexts and the canvas registry are the engine thread's alone, and the context keeps its EGL context current there between batches; it sets the view's opacity back on the UI thread. On Android each call already makes the context current and puts back what was current before, so `WebGLContext` and `CanvasRegistry` are locked instead: the `TextureView`'s surface callbacks, on the UI thread, wait for a batch to end, which keeps the EGL surface from outliving the `SurfaceTexture` it draws to. The WebGL module's `encodeImage`, behind `canvas.toBlob()` and `toDataURL()`, reads the drawing buffer and encodes it as a PNG or JPEG with ImageIO or `Bitmap.compress`. On iOS it, and `readPixels()` into an array, read through a pixel pack buffer of their own, mapped, since ANGLE on Metal is slow to read straight into memory; a `readPixels()` that GL rejects answers nothing, so the app's array keeps what it held, as WebGL leaves it. `AngularLynxAssets` (`App/AssetsModule.swift`, `AssetsModule.kt`) reads a file the app bundles for the main thread's `fetch`, which has no page URL to resolve `/static/...` against. The command numbers the WebGL module reads (`App/AngularLynxWebGLOps.h`, `WebGLOps.kt`) are generated from the runtime's `canvas/webgl-ops.ts` with `npm run generate:webgl-ops -w packages/native`; `scripts/webgl-ops.test.ts` fails when they're stale. UIKit's module imports Apple's OpenGL ES headers into every file, so `AngularLynxWebGLContext.m` turns off their deprecation warnings, which land on ANGLE's functions of the same names; the explicit link to `libGLESv2` comes before UIKit's automatic one to OpenGLES, so those calls bind to ANGLE.
|
|
68
|
+
Both have `<canvas>` with WebGL2 (issue #211), which Lynx doesn't: a `canvas` element (`App/AngularLynxWebGL.m`'s `AngularLynxCanvas`, a `CAMetalLayer` view; `CanvasUI.kt`, a `TextureView`) and the `AngularLynxWebGL` module the runtime's WebGL2 context sends its calls to, which runs them on OpenGL ES 3.0 (`App/AngularLynxWebGLContext.m`, `WebGLContext.kt`). On iOS that's [ANGLE](https://chromium.googlesource.com/angle/angle)'s OpenGL ES, on Metal, which Safari draws WebGL with too: iOS's own OpenGL ES is deprecated, and the Simulator runs it on the CPU, at seconds a frame for a lit three.js scene (issue #238), where Metal draws on the Mac's GPU. ANGLE's `libEGL` and `libGLESv2` frameworks, and its headers, come in the Lynx frameworks zip (below). Android's OpenGL ES is the phone's, which the emulator already runs on the Mac's GPU. The runtime runs on Lynx's main thread and WebGL needs answers synchronously, so both turn on main-thread modules (`enableMTSModule`): the config's modules are then callable from main-thread JavaScript as `lynx.module(name)`, and Lynx calls them on its engine thread, not the UI thread. An EGL context is current on one thread at a time, so GL runs there too, while the canvas's view lives on the UI thread. On iOS the view hands the context what it draws into, its `CAMetalLayer` and its size in pixels (`AngularLynxCanvasTarget`), through Lynx's `runOnTasmThread:`, so the contexts and the canvas registry are the engine thread's alone, and the context keeps its EGL context current there between batches; it sets the view's opacity back on the UI thread. On Android each call already makes the context current and puts back what was current before, so `WebGLContext` and `CanvasRegistry` are locked instead: the `TextureView`'s surface callbacks, on the UI thread, wait for a batch to end, which keeps the EGL surface from outliving the `SurfaceTexture` it draws to. The WebGL module's `encodeImage`, behind `canvas.toBlob()` and `toDataURL()`, reads the drawing buffer and encodes it as a PNG or JPEG with ImageIO or `Bitmap.compress`. On iOS it, and `readPixels()` into an array, read through a pixel pack buffer of their own, mapped, since ANGLE on Metal is slow to read straight into memory; a `readPixels()` that GL rejects answers nothing, so the app's array keeps what it held, as WebGL leaves it. The same module has the runtime's 2D context (issue #469): `create2D`, `run2D`, `destroy2D` and `encode2D` draw into a bitmap with Core Graphics (`App/AngularLynxCanvas2DContext.m`) or `android.graphics.Canvas` (`Canvas2DContext.kt`), and show it in the canvas's view after each task that drew: a copy in a `CALayer` over the `CAMetalLayer` on iOS, drawn into the `TextureView`'s surface with `lockHardwareCanvas()` on Android. Both kinds of context implement `AngularLynxCanvasContext` / `CanvasContext`, which the canvas registry pairs with views and which another context reads a canvas through (`snapshot`), for `drawImage()` and for `texImage2D()` with a canvas. The module's `imageFromCanvas` copies a canvas's snapshot under an image id, as `decodeImage` keeps a file's pixels, for `createImageBitmap()` of a canvas and `OffscreenCanvas.transferToImageBitmap()`, which then clears the canvas (`clearForTransfer`); `imageFromImage` copies an image it already keeps (an ImageBitmap's, an `Image`'s), and `imageFromPixels` keeps an ImageData's bytes, for `createImageBitmap()` of those. Each of the four takes createImageBitmap's crop rectangle (`pixelsOfSnapshot` crops before it resizes and flips) and answers `cropped` when it applied one. A third kind of context, `bitmaprenderer` (`App/AngularLynxBitmapRendererContext.m`, `BitmapRendererContext.kt`), takes a decoded image off the module with `transferToBitmapRenderer`, for `transferFromImageBitmap()`, and shows it as the 2D context shows its bitmap (on Android, both through `BitmapPresenter.kt`); its snapshot is that image, so other contexts read the canvas as it. Its command numbers (`App/AngularLynxCanvas2DOps.h`, `Canvas2DOps.kt`) are generated from `canvas/canvas-2d-ops.ts` by the same script. The canvas code is the part of the shells an app leaves out by what its bundle uses (issue #837), as the biometrics module is left out by what angular.json asks for (above): about 176 kB of the iOS executable, and ANGLE. The build plugin writes `.angular-lynx-native.json` beside the bundle, with `"canvas": false` when none of the bundle's main-thread modules names a canvas (`native-features.ts` in the plugin: the names that bring in the runtime's WebGL2 and 2D contexts, `'canvas'`, `Image`, `createImageBitmap` and the like). Then the generator (`leaveOut` in `src/ios/project.ts` and `src/android/project.ts`) deletes the canvas sources, `App/AngularLynx*.{h,m}` (`IOS_CANVAS_SOURCES`) and the Kotlin files of `ANDROID_CANVAS_SOURCES`, with `<video>`'s frame readers, which only a canvas reads. On iOS it also takes the ANGLE frameworks out of the project. On Android it takes out the lines that register them, between `MainActivity.kt`'s `// angular-lynx:canvas` markers. The iOS shell's Swift reaches the Objective-C classes only by name (`NSClassFromString`), so it registers no canvas, and keeps XElement's own `<video>`, when they're gone. With no file (an older plugin, another build) or a development app (`ng serve --platform`, which gets every edit), the app has everything, and so does an ejected project: the eject schematic renders it with `renderEjectedProject()` and no `features`, since it's the user's to grow, and the builder builds it as it is. A script that renders a project only to build it passes `features` to leave the same code out (the benchmark's ReactLynx iOS app, issue #858). The file is in the generated project's input hash, so an app that starts drawing regenerates with the code back in. An app that draws only in 2D keeps the canvas and leaves out the WebGL2 context (issue #847): the file says `"webgl": false` when no main-thread module names `webgl2`, `WebGL2RenderingContext` or `ɵenableWebGL2`. Then the generator deletes `App/AngularLynxWebGLContext.m` and `App/AngularLynxWebGLOps.h` (`IOS_WEBGL_SOURCES`) and takes ANGLE out of the iOS project, or deletes `WebGLContext.kt` and `WebGLOps.kt` (`ANDROID_WEBGL_SOURCES`), and takes out the lines that name the context, between the `// angular-lynx:webgl` markers of `App/AngularLynxWebGL.h` and `.m` and of `WebGLModule.kt`. The 2D context needs neither: it draws with Core Graphics, shown in a `CALayer` over the canvas's `CAMetalLayer`, which is QuartzCore's, and with `android.graphics.Canvas`. A file from an older plugin, with `"canvas": true` and no `webgl`, keeps WebGL. `AngularLynxAssets` (`App/AssetsModule.swift`, `AssetsModule.kt`) reads a file the app bundles for the main thread's `fetch`, which has no page URL to resolve `/static/...` against. The command numbers the WebGL module reads (`App/AngularLynxWebGLOps.h`, `WebGLOps.kt`) are generated from the runtime's `canvas/webgl-ops.ts` with `npm run generate:webgl-ops -w packages/native`; `scripts/webgl-ops.test.ts` fails when they're stale. UIKit's module imports Apple's OpenGL ES headers into every file, so `AngularLynxWebGLContext.m` turns off their deprecation warnings, which land on ANGLE's functions of the same names; the explicit link to `libGLESv2` comes before UIKit's automatic one to OpenGLES, so those calls bind to ANGLE.
|
|
37
69
|
|
|
38
|
-
| | iOS
|
|
39
|
-
| ---------------- |
|
|
40
|
-
| Language | Swift, scene lifecycle
|
|
41
|
-
| Lynx | 4.1.0, prebuilt XCFrameworks (below)
|
|
42
|
-
| XElement | Linked and registered (`App/XElementRegistry.swift`)
|
|
43
|
-
| Toolchain | Xcode 27, iOS 15+
|
|
44
|
-
| Generated config | `Config/App.xcconfig`, `App/Info.plist` markers, `Config/App.entitlements` (with `appLinkDomains`) | `angular-lynx.properties`, `AndroidManifest.xml` markers |
|
|
70
|
+
| | iOS | Android |
|
|
71
|
+
| ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------- |
|
|
72
|
+
| Language | Swift, scene lifecycle | Kotlin |
|
|
73
|
+
| Lynx | 4.1.0, prebuilt XCFrameworks (below) | 4.1.0 AARs from Maven Central |
|
|
74
|
+
| XElement | Linked and registered (`App/XElementRegistry.swift`) | Linked and registered (`XElementBehaviors`) |
|
|
75
|
+
| Toolchain | Xcode 27, iOS 15+ | AGP 9.4, Gradle 9.6, JDK 17+, SDK 36, minSdk 24 |
|
|
76
|
+
| Generated config | `Config/App.xcconfig`, `App/Info.plist` markers, `Config/App.entitlements` (with `appLinkDomains`, `signInWithApple` or `shareTarget`), the Share Extension's target (with `shareTarget`) | `angular-lynx.properties`, `AndroidManifest.xml` markers |
|
|
45
77
|
|
|
46
78
|
## Lynx for iOS
|
|
47
79
|
|
|
48
|
-
Lynx publishes iOS only as source pods, which take minutes to compile and need CocoaPods (and so Ruby). `scripts/build-lynx-ios-frameworks.sh` compiles them once into XCFrameworks (about 32 MB zipped, with debug symbols in a separate zip): Lynx, PrimJS, XElement and their dependencies, and ANGLE's `libEGL` and `libGLESv2`, with ANGLE's headers in `ANGLE/include`. The builder downloads the zip pinned in `src/ios/frameworks.ts` (URL and SHA-256) on first use and caches it in `~/.cache/angular-lynx/lynx-ios/<version>-<build>`.
|
|
80
|
+
Lynx publishes iOS only as source pods, which take minutes to compile and need CocoaPods (and so Ruby). `scripts/build-lynx-ios-frameworks.sh` compiles them once into XCFrameworks (about 32 MB zipped, with debug symbols in a separate zip): Lynx, PrimJS, XElement and their dependencies, and ANGLE's `libEGL` and `libGLESv2`, with ANGLE's headers in `ANGLE/include`. The builder downloads the zip pinned in `src/ios/frameworks.ts` (URL and SHA-256) on first use and caches it in `~/.cache/angular-lynx/lynx-ios/<version>-<build>`. A cached folder missing any framework's `Info.plist` or ANGLE's headers is downloaded again, rather than failing every build that links it.
|
|
49
81
|
|
|
50
|
-
ANGLE only builds with Chromium's tooling (depot_tools, GN and Ninja), so the Lynx script runs `scripts/build-angle-ios-frameworks.sh`, which checks out the ANGLE revision a Chrome stable release shipped (`ANGLE_REVISION`), builds its Metal backend alone for the device and both Simulator architectures, with ANGLE's own Metal shaders prebuilt (otherwise it compiles them when an app first makes a context, which took 5.7 s on a fresh install in the Simulator), and leaves out the dependencies ANGLE's DEPS fetches for its tests and other backends. The checkout is about 5 GB and the three builds take about a minute and a half together; run it alone (`npm run build:angle-ios-frameworks -w packages/native`) to try a new revision. ANGLE adds about 6 MB to an app (2 MB compressed in the `.ipa`), against Lynx's 34 MB,
|
|
82
|
+
ANGLE only builds with Chromium's tooling (depot_tools, GN and Ninja), so the Lynx script runs `scripts/build-angle-ios-frameworks.sh`, which checks out the ANGLE revision a Chrome stable release shipped (`ANGLE_REVISION`), builds its Metal backend alone for the device and both Simulator architectures, with ANGLE's own Metal shaders prebuilt (otherwise it compiles them when an app first makes a context, which took 5.7 s on a fresh install in the Simulator), and leaves out the dependencies ANGLE's DEPS fetches for its tests and other backends. The checkout is about 5 GB and the three builds take about a minute and a half together; run it alone (`npm run build:angle-ios-frameworks -w packages/native`) to try a new revision. ANGLE adds about 6 MB to an app (2 MB compressed in the `.ipa`), against Lynx's 34 MB, so only an app that draws with WebGL links it (below).
|
|
51
83
|
|
|
52
|
-
The zip for Lynx 4.1.0 is the [`lynx-ios-4.1.0-
|
|
84
|
+
The zip for Lynx 4.1.0 is the [`lynx-ios-4.1.0-4` release](https://github.com/Blotch-Smart-Frames/AngularLynx/releases/tag/lynx-ios-4.1.0-4). The build number counts rebuilds of one Lynx version whose frameworks changed (2 added XElement, 3 ANGLE, 4 SDWebImage's signed release), and is part of the cache folder, so machines with an older zip download the new one. For a new Lynx version, bump the versions in the script and reset `BUILD` to 1; to change the frameworks of the same version, bump `BUILD` (in the script and in `LYNX_IOS`). Then run the **Lynx iOS frameworks** workflow with `publish` (or the script locally), and pin the new zip's URL and SHA-256. To test a locally built folder before publishing it:
|
|
53
85
|
|
|
54
86
|
```sh
|
|
55
87
|
npm run build:lynx-ios-frameworks -w packages/native # needs Xcode, Ruby >= 2.7 with Bundler for CocoaPods, and Python 3 for ANGLE (the script downloads Xcode's Metal toolchain if it's missing)
|
|
@@ -1,14 +1,99 @@
|
|
|
1
1
|
import type { PlatformGenerator } from '../generate.ts';
|
|
2
2
|
import { type ResolvedApp } from '../options.ts';
|
|
3
|
+
import { type AndroidPermission } from '../permissions.ts';
|
|
4
|
+
/** LynxBarcodeScanner's module, which needs the `camera` permission. */
|
|
5
|
+
export declare const ANDROID_BARCODE_SCANNER_SOURCE = "app/src/main/java/dev/angularlynx/shell/BarcodeScannerModule.kt";
|
|
3
6
|
/**
|
|
4
7
|
* Writes the app options into the Android template: identity goes in
|
|
5
8
|
* angular-lynx.properties (which app/build.gradle.kts reads), and permissions,
|
|
6
9
|
* deep links and the apps canOpenURL can see go between the manifest's
|
|
7
10
|
* `angular-lynx:*` markers, the icon options become the launcher icon's
|
|
8
11
|
* resources, the shortcuts become the static shortcuts' resources, and the
|
|
9
|
-
* splash becomes the splash theme's color and image.
|
|
12
|
+
* splash becomes the splash theme's color and image. The barcode scanner's
|
|
13
|
+
* module and the library behind it stay only in an app with the `camera`
|
|
14
|
+
* permission, and the Bluetooth module only in an app with the `bluetooth`
|
|
15
|
+
* permission. The store review module stays only in an app with
|
|
16
|
+
* `storeReview`, the calendar module only in one with `calendar`, the
|
|
17
|
+
* tracking module only in one with `permissions.tracking`, the NFC module
|
|
18
|
+
* only in one with `permissions.nfc`, the audio recorder's module only in one
|
|
19
|
+
* with `permissions.microphone`, the geolocation module only in one with
|
|
20
|
+
* `permissions.location`, the motion module only in one with `motion`, and
|
|
21
|
+
* the Wi-Fi module only in one with `wifi`, with only the parts it turns on.
|
|
10
22
|
*/
|
|
11
23
|
export declare const androidGenerator: PlatformGenerator;
|
|
24
|
+
/** The module behind `LynxStoreReview`, which only `storeReview` keeps. */
|
|
25
|
+
export declare const ANDROID_STORE_REVIEW_SOURCE = "app/src/main/java/dev/angularlynx/shell/StoreReviewModule.kt";
|
|
26
|
+
/** The module behind `LynxWifi`, which only `wifi` keeps. */
|
|
27
|
+
export declare const ANDROID_WIFI_SOURCE = "app/src/main/java/dev/angularlynx/shell/WifiModule.kt";
|
|
28
|
+
/** The module behind `LynxCalendar`, which only `calendar` keeps. */
|
|
29
|
+
export declare const ANDROID_CALENDAR_SOURCE = "app/src/main/java/dev/angularlynx/shell/CalendarModule.kt";
|
|
30
|
+
/**
|
|
31
|
+
* The module behind `LynxAudioRecorder`, which only `permissions.microphone`
|
|
32
|
+
* keeps.
|
|
33
|
+
*/
|
|
34
|
+
export declare const ANDROID_AUDIO_RECORDER_SOURCE = "app/src/main/java/dev/angularlynx/shell/AudioRecorderModule.kt";
|
|
35
|
+
/** The module behind `LynxNfc`, which only `permissions.nfc` keeps. */
|
|
36
|
+
export declare const ANDROID_NFC_SOURCE = "app/src/main/java/dev/angularlynx/shell/NfcModule.kt";
|
|
37
|
+
/**
|
|
38
|
+
* The files with LynxImagePicker's camera in them, between
|
|
39
|
+
* `// angular-lynx:image-picker-camera` markers, which only an app with
|
|
40
|
+
* `permissions.camera` keeps.
|
|
41
|
+
*/
|
|
42
|
+
export declare const ANDROID_IMAGE_PICKER_CAMERA_MARKED: readonly ["app/src/main/java/dev/angularlynx/shell/ImagePickerModule.kt", "app/src/main/java/dev/angularlynx/shell/MainActivity.kt"];
|
|
43
|
+
/**
|
|
44
|
+
* The module behind `LynxGeolocation`, which only `permissions.location`
|
|
45
|
+
* keeps.
|
|
46
|
+
*/
|
|
47
|
+
export declare const ANDROID_GEOLOCATION_SOURCE = "app/src/main/java/dev/angularlynx/shell/GeolocationModule.kt";
|
|
48
|
+
/**
|
|
49
|
+
* The module behind `LynxTracking`, which only an app with
|
|
50
|
+
* `permissions.tracking` keeps.
|
|
51
|
+
*/
|
|
52
|
+
export declare const ANDROID_TRACKING_SOURCE = "app/src/main/java/dev/angularlynx/shell/TrackingModule.kt";
|
|
53
|
+
/** The module behind `LynxMotion`, which only `motion` keeps. */
|
|
54
|
+
export declare const ANDROID_MOTION_SOURCE = "app/src/main/java/dev/angularlynx/shell/MotionModule.kt";
|
|
55
|
+
/**
|
|
56
|
+
* The shell's biometrics module, `AngularLynxBiometrics` (LynxBiometrics, and
|
|
57
|
+
* the values LynxSecureStorage keeps behind a fingerprint or a face), which
|
|
58
|
+
* only an app with `permissions.biometrics` keeps.
|
|
59
|
+
*/
|
|
60
|
+
export declare const ANDROID_BIOMETRICS_SOURCES: readonly ["BiometricsModule.kt"];
|
|
61
|
+
/**
|
|
62
|
+
* The shell's file picker module, `AngularLynxFilePicker` (LynxFilePicker),
|
|
63
|
+
* which only an app with `filePicker` keeps.
|
|
64
|
+
*/
|
|
65
|
+
export declare const ANDROID_FILE_PICKER_SOURCES: readonly ["FilePickerModule.kt"];
|
|
66
|
+
/**
|
|
67
|
+
* The shell's photo library module, `AngularLynxPhotoLibrary`
|
|
68
|
+
* (LynxPhotoLibrary), which only an app with `permissions.savePhotos` keeps.
|
|
69
|
+
*/
|
|
70
|
+
export declare const ANDROID_PHOTO_LIBRARY_SOURCES: readonly ["PhotoLibraryModule.kt"];
|
|
71
|
+
/**
|
|
72
|
+
* res/values/biometrics.xml: the reason a biometric prompt shows when the
|
|
73
|
+
* app gives none, angular.json's `permissions.biometrics`.
|
|
74
|
+
*/
|
|
75
|
+
export declare const biometricsStringsXml: (reason: string) => string;
|
|
76
|
+
/** Where the plugins' Kotlin and Java go, a folder per plugin. */
|
|
77
|
+
export declare const ANDROID_PLUGIN_SOURCES = "app/src/main/java/plugins";
|
|
78
|
+
/**
|
|
79
|
+
* Where the plugins' Android resources go, a resource folder per plugin,
|
|
80
|
+
* which the template's build.gradle.kts adds to the app module's.
|
|
81
|
+
*/
|
|
82
|
+
export declare const ANDROID_PLUGIN_RESOURCES = "app/src/main/plugin-res";
|
|
83
|
+
/**
|
|
84
|
+
* The shell's `<canvas>`, its `AngularLynxWebGL` module and its contexts, and
|
|
85
|
+
* `<video>`'s readable frames, which only MainActivity's marked lines reach.
|
|
86
|
+
* R8 can't drop them while those lines register them, so they go with the
|
|
87
|
+
* lines.
|
|
88
|
+
*/
|
|
89
|
+
export declare const ANDROID_CANVAS_SOURCES: readonly ["BitmapPresenter.kt", "BitmapRendererContext.kt", "Canvas2DContext.kt", "Canvas2DOps.kt", "CanvasFilter.kt", "CanvasUI.kt", "VideoFrameTarget.kt", "VideoUI.kt", "WebGLContext.kt", "WebGLModule.kt", "WebGLOps.kt"];
|
|
90
|
+
/**
|
|
91
|
+
* The WebGL2 context, which an app that draws only in 2D leaves out, and
|
|
92
|
+
* `WebGLModule.kt`'s lines that make one (issue #847). `VideoFrameTarget.kt`
|
|
93
|
+
* reads a video's frames with an EGL context of its own, for the 2D
|
|
94
|
+
* context's `drawImage()` too, so it stays.
|
|
95
|
+
*/
|
|
96
|
+
export declare const ANDROID_WEBGL_SOURCES: readonly ["WebGLContext.kt", "WebGLOps.kt"];
|
|
12
97
|
/**
|
|
13
98
|
* Escapes a value for a Java properties file. `Properties.load` reads the
|
|
14
99
|
* file as ISO-8859-1, so anything outside ASCII (an app named "Café" or
|
|
@@ -17,6 +102,19 @@ export declare const androidGenerator: PlatformGenerator;
|
|
|
17
102
|
export declare const propertyValue: (value: string) => string;
|
|
18
103
|
export declare const properties: (app: ResolvedApp) => string;
|
|
19
104
|
export declare const permissionEntries: (app: ResolvedApp) => string;
|
|
105
|
+
/**
|
|
106
|
+
* One `<uses-permission>` for each name, in the order the names first come.
|
|
107
|
+
* Two of the app's permissions can need the same Android one: `bluetooth`
|
|
108
|
+
* needs fine location to scan on old Android versions only, and `location`
|
|
109
|
+
* needs it on every version. The one element has to give each what it needs,
|
|
110
|
+
* so it keeps an attribute only when every declaration has it: the highest
|
|
111
|
+
* `maxSdkVersion`, and only the `usesPermissionFlags` they all promise.
|
|
112
|
+
*
|
|
113
|
+
* `usesPermissionFlags` came in Android 12 (codename S), which the app's
|
|
114
|
+
* minSdk predates. Older versions ignore it, and `tools:targetApi` tells
|
|
115
|
+
* Android lint that's intended.
|
|
116
|
+
*/
|
|
117
|
+
export declare const usesPermissions: (permissions: readonly AndroidPermission[]) => string[];
|
|
20
118
|
/**
|
|
21
119
|
* The intent filters for the links that open the app: one for the
|
|
22
120
|
* `deepLinkSchemes`, and one for https links to the `appLinkDomains`.
|
|
@@ -29,6 +127,21 @@ export declare const permissionEntries: (app: ResolvedApp) => string;
|
|
|
29
127
|
* with every host.
|
|
30
128
|
*/
|
|
31
129
|
export declare const deepLinkEntries: (app: ResolvedApp) => string;
|
|
130
|
+
/** The module behind `LynxShareTarget`, which only `shareTarget` keeps. */
|
|
131
|
+
export declare const ANDROID_SHARE_TARGET_SOURCE = "app/src/main/java/dev/angularlynx/shell/ShareTargetModule.kt";
|
|
132
|
+
/**
|
|
133
|
+
* The intent filters that put the app in other apps' share sheets for
|
|
134
|
+
* `shareTarget.mimeTypes`: one for a share of one thing (`ACTION_SEND`) and
|
|
135
|
+
* one for several (`ACTION_SEND_MULTIPLE`), each with every type.
|
|
136
|
+
*
|
|
137
|
+
* Android shares a link as text: Chrome sends a page's URL as `text/plain`,
|
|
138
|
+
* and few apps send `text/uri-list`. So `text/uri-list` keeps its own type
|
|
139
|
+
* and also takes `text/plain`, and ShareTargetModule hands the app only the shares whose
|
|
140
|
+
* text is one link when `text/plain` itself isn't listed.
|
|
141
|
+
*/
|
|
142
|
+
export declare const shareTargetEntries: (app: ResolvedApp) => string;
|
|
143
|
+
/** res/values/share_target.xml: the types the app takes, for ShareTargetModule. */
|
|
144
|
+
export declare const shareTargetStringsXml: (mimeTypes: readonly string[]) => string;
|
|
32
145
|
/**
|
|
33
146
|
* The apps LinkingModule's canOpenURL can see from Android 11: those that
|
|
34
147
|
* open a URL with one of the schemes. resolveActivity() finds no other app,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../../src/android/project.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../../src/android/project.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAEL,KAAK,WAAW,EAEjB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,KAAK,iBAAiB,EAAkB,MAAM,mBAAmB,CAAC;AAkB3E,wEAAwE;AACxE,eAAO,MAAM,8BAA8B,oEACwB,CAAC;AAUpE;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,gBAAgB,EAAE,iBAsP9B,CAAC;AA2BF,2EAA2E;AAC3E,eAAO,MAAM,2BAA2B,iEAA0C,CAAC;AAEnF,6DAA6D;AAC7D,eAAO,MAAM,mBAAmB,0DAAmC,CAAC;AAEpE,qEAAqE;AACrE,eAAO,MAAM,uBAAuB,8DAAuC,CAAC;AAE5E;;;GAGG;AACH,eAAO,MAAM,6BAA6B,mEAA4C,CAAC;AAEvF,uEAAuE;AACvE,eAAO,MAAM,kBAAkB,yDAAkC,CAAC;AAElE;;;;GAIG;AACH,eAAO,MAAM,kCAAkC,sIAGrC,CAAC;AASX;;;GAGG;AACH,eAAO,MAAM,0BAA0B,iEAA0C,CAAC;AAElF;;;GAGG;AACH,eAAO,MAAM,uBAAuB,8DAAuC,CAAC;AAoB5E,iEAAiE;AACjE,eAAO,MAAM,qBAAqB,4DAAqC,CAAC;AAExE;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,kCAAmC,CAAC;AAE3E;;;GAGG;AACH,eAAO,MAAM,2BAA2B,kCAAmC,CAAC;AAE5E;;;GAGG;AACH,eAAO,MAAM,6BAA6B,oCAAqC,CAAC;AAehF;;;GAGG;AACH,eAAO,MAAM,oBAAoB,GAAI,QAAQ,MAAM,KAAG,MAQxC,CAAC;AAEf,kEAAkE;AAClE,eAAO,MAAM,sBAAsB,8BAA8B,CAAC;AAElE;;;GAGG;AACH,eAAO,MAAM,wBAAwB,4BAA4B,CAAC;AAElE;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,gOAYzB,CAAC;AAEX;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,6CAGxB,CAAC;AAEX;;;;GAIG;AACH,eAAO,MAAM,aAAa,GAAI,OAAO,MAAM,WAOtC,CAAC;AAEN,eAAO,MAAM,UAAU,GAAI,KAAK,WAAW,KAAG,MAgBhC,CAAC;AAuBf,eAAO,MAAM,iBAAiB,GAAI,KAAK,WAAW,KAAG,MAsBpD,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,eAAe,GAC1B,aAAa,SAAS,iBAAiB,EAAE,KACxC,MAAM,EA8BR,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,eAAe,GAAI,KAAK,WAAW,KAAG,MAuBrC,CAAC;AAEf,2EAA2E;AAC3E,eAAO,MAAM,2BAA2B,iEAA0C,CAAC;AAKnF;;;;;;;;;GASG;AACH,eAAO,MAAM,kBAAkB,GAAI,KAAK,WAAW,KAAG,MAoBrD,CAAC;AAEF,mFAAmF;AACnF,eAAO,MAAM,qBAAqB,GAAI,WAAW,SAAS,MAAM,EAAE,KAAG,MAUvD,CAAC;AASf;;;;GAIG;AACH,eAAO,MAAM,cAAc,GAAI,KAAK,WAAW,KAAG,MAUpC,CAAC;AAOf;;;;;;;;;;GAUG;AACH,eAAO,MAAM,YAAY,GAAI,KAAK,WAAW,KAAG,MAgClC,CAAC;AAEf;;;;GAIG;AACH,eAAO,MAAM,cAAc,GAAI,MAAM,MAAM,KAAG,MAMpB,CAAC;AAE3B;;;GAGG;AACH,eAAO,MAAM,kBAAkB,GAAI,KAAK,WAAW,KAAG,MAWxC,CAAC;AAEf,2EAA2E;AAC3E,eAAO,MAAM,cAAc,GACzB,MAAK,MAAM,CAAC,UAAwB,KACnC,MAAM,GAAG,SAaX,CAAC"}
|