feat(android): the list and the detail move to HTML
The FMX controls lost this one on merit. Every screen re-taught the same lessons: a template missing from the loaded style, an alignment order left to chance, a HitTest swallowing a tap, a native view painting over everything. The engine draws the same interface in forty lines of CSS and shapes Arabic on its own. The bridge needs no local server, so no port is open on the device: evaluateJavascript carries the data down, an intercepted cmd:// navigation carries the actions up. Through a throwaway iframe - FMX always tells the engine it did not handle the navigation, which on an unknown scheme replaces the page with an error screen. Secrets do not travel over that bridge. The list gets names, sites and usernames, which are already on screen; copying from a row sends an index and Delphi reads the vault itself. Only the open entry has its values in the JS heap, and PM.wipe clears them on lock. Folders become a row of chips with counts instead of a full-screen panel: one tap, and the count says what to expect. Also gone: about eight hundred lines of the screen this replaces. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
# Compile, empaquette, installe et lance le client Android.
|
||||
#
|
||||
# POURQUOI CE SCRIPT. La chaine a quatre etapes qui ne s'appellent pas entre
|
||||
# elles, et en sauter une donne un APK qui s'installe sans porter la
|
||||
# modification - le symptome se lit alors comme un bug applicatif. La premiere,
|
||||
# web.res, s'est deja fait oublier une fois : la page embarquee etait celle
|
||||
# d'avant l'edition, et le pont echouait pour une raison qui n'existait plus.
|
||||
#
|
||||
# -NoInstall compile et empaquette sans toucher au telephone.
|
||||
|
||||
param([switch]$NoInstall)
|
||||
|
||||
$ErrorActionPreference = 'Stop'
|
||||
$root = Split-Path $PSScriptRoot -Parent
|
||||
$bin = 'C:\Program Files (x86)\Embarcadero\Studio\23.0\bin'
|
||||
$sdk = 'C:\Users\Public\Documents\Embarcadero\Studio\23.0\CatalogRepository'
|
||||
$adb = "$sdk\AndroidSDK-2525-23.0.51511.6924\platform-tools\Adb.exe"
|
||||
$strip = "$sdk\AndroidNDK-21-23.0.51511.6924\android-ndk-r21\toolchains\" +
|
||||
'aarch64-linux-android-4.9\prebuilt\windows-x86_64\aarch64-linux-android\bin\strip.exe'
|
||||
$out = "$root\Android64\Debug"
|
||||
$stage = "$out\pmserverApk"
|
||||
|
||||
# 1. La page HTML -> ressource liee dans l'executable.
|
||||
Push-Location "$PSScriptRoot\web"
|
||||
& "$bin\brcc32.exe" web.rc -foweb.res | Out-Null
|
||||
Pop-Location
|
||||
|
||||
# 2. Compilation Delphi.
|
||||
$msbuild = "`"$bin\rsvars.bat`" && msbuild `"$root\pmserverApk.dproj`""
|
||||
$log = cmd /c "$msbuild /p:Platform=Android64 /p:Config=Debug /t:Build /v:minimal /nologo" 2>&1
|
||||
$err = $log | Select-String -Pattern 'error'
|
||||
if ($err) { $err | ForEach-Object { $_.Line }; throw 'compilation echouee' }
|
||||
$log | Select-String -Pattern 'lines,' | ForEach-Object { $_.Line.Trim() }
|
||||
|
||||
# 3. Mise en place a la main de ce que le deploiement ne place pas : manifeste,
|
||||
# .dex, et la bibliotheque native ALLEGEE - la version de debogage pese
|
||||
# 91 Mo, plus que la place libre sur ce volume.
|
||||
Copy-Item "$out\AndroidManifest.xml" "$stage\AndroidManifest.xml" -Force
|
||||
Copy-Item "$out\pmserverApk.classes\*.dex" "$stage\classes\" -Force
|
||||
& $strip --strip-debug -o "$stage\library\lib\arm64-v8a\libpmserverApk.so" "$out\libpmserverApk.so"
|
||||
|
||||
cmd /c "$msbuild /p:Platform=Android64 /p:Config=Debug /t:Deploy /v:minimal /nologo" 2>&1 |
|
||||
Select-String -Pattern 'error' | ForEach-Object { $_.Line }
|
||||
|
||||
# 4. aapt + zipalign + apksigner, et remise en place de ce que Deploy efface.
|
||||
& "$PSScriptRoot\repack-apk.ps1" | Select-Object -Last 1
|
||||
|
||||
if ($NoInstall) { return }
|
||||
|
||||
# adb ecrit sa progression sur la sortie d'erreur, ce que PowerShell prend pour
|
||||
# un echec. Sans ce relachement, une installation reussie interrompt le script.
|
||||
$ErrorActionPreference = 'Continue'
|
||||
|
||||
& $adb install -r "$stage\bin\pmserverApk.apk" 2>&1 |
|
||||
Select-String -Pattern 'Success|Failure' | ForEach-Object { $_.Line }
|
||||
# Le telephone voit le poste comme 127.0.0.1 par ce renvoi.
|
||||
& $adb reverse tcp:8080 tcp:80 | Out-Null
|
||||
& $adb shell am force-stop com.embarcadero.pmserverApk
|
||||
& $adb shell am start -n com.embarcadero.pmserverApk/com.embarcadero.firemonkey.FMXNativeActivity | Out-Null
|
||||
Reference in New Issue
Block a user