feat(android): settings live on the device, dark theme, and the app is called Coffre
URL and token are no longer constants. They sit in settings.bin, sealed with the no-auth Keystore AES key - deliberately weaker than the vault: they must be readable to rebuild a vault that no longer exists, and a bearer token only opens ENCRYPTED data, worthless without the sync password that stays in the guarded vault. Retyping 64 hex characters after every cache purge was the real risk: the risk of writing them down elsewhere. They are saved only after a fetch that worked - proven settings, not typed ones. The token and sync password moved to the gitignored local include, as first-run defaults only. Tracked source now carries no secret, and leaving them empty is a viable configuration: the app asks. Theme: Delphi's Dark.style, copied into the repo and linked as a resource rather than deployed as a file - this project's deployment puts nothing beside the app, which is the same hole that forces the manifest and dex staging. A failure to load is never fatal; the default look is ugly but works. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
unit PMA.Theme;
|
||||
{
|
||||
Thème sombre, chargé depuis une ressource embarquée.
|
||||
|
||||
POURQUOI UNE RESSOURCE ET NON UN FICHIER : le mecanisme de deploiement de ce
|
||||
projet ne pose aucun fichier a cote de l'application - c'est le meme trou qui
|
||||
oblige a mettre en place le manifeste et les .dex a la main. Une ressource
|
||||
liee dans le .so ne depend de rien : elle est la ou n'est pas, et elle est la.
|
||||
|
||||
Le style vient de Dark.style, livre avec Delphi, recopie dans le depot pour
|
||||
que la compilation ne dependre pas d'un chemin d'installation.
|
||||
|
||||
Un echec ici n'est jamais fatal : sans style, l'application garde l'apparence
|
||||
par defaut. Elle est laide, elle fonctionne.
|
||||
}
|
||||
|
||||
interface
|
||||
|
||||
/// A appeler une fois, avant la creation de la forme.
|
||||
procedure ApplyDarkTheme;
|
||||
|
||||
implementation
|
||||
|
||||
uses
|
||||
System.SysUtils, System.Types, System.Classes, FMX.Styles, FMX.Types;
|
||||
|
||||
{$R 'theme\theme.res' 'theme\theme.rc'}
|
||||
|
||||
procedure ApplyDarkTheme;
|
||||
var
|
||||
LStyle: TFmxObject;
|
||||
begin
|
||||
try
|
||||
// La lecture appartient a TStyleStreaming, l'application a TStyleManager.
|
||||
LStyle := TStyleStreaming.LoadFromResource(HInstance, 'PMDARKSTYLE', RT_RCDATA);
|
||||
if LStyle <> nil then
|
||||
TStyleManager.SetStyle(LStyle);
|
||||
except
|
||||
// Rien : l'apparence par defaut reste utilisable.
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
Reference in New Issue
Block a user