Commit Graph

8 Commits

Author SHA1 Message Date
Trevi Awater
fb361f0f4c Obfuscate the Android DEX with R8
Mirrors lojack-connect. .NET for Android runs no DEX shrinker by default, and
even with AndroidLinkTool=r8 the ProGuard config the SDK generates hardcodes
-dontobfuscate -- a flag nothing later in the config list can undo -- so Play
Console's "DEX code optimization" report scores obfuscation at ~1%.

_AndroidObfuscateDex drops the SDK's proguard_xamarin.cfg from R8's --pg-conf
list and substitutes a copy without that line, regenerating the
-printmapping/-keepattributes tail the SDK would have appended (absolute path:
R8 resolves a relative -printmapping against the config file's own directory).
49.8% of DEX classes are now renamed.

proguard.cfg carries the keeps the generated rules miss: classes the .NET
runtime resolves by name from native code (net.dot.android.**), and public and
protected fields, which the trimmer covers for methods only. The target also
caches aapt2's keep rules outside FileWrites -- the SDK adds them to
@(ProguardConfiguration) inside _CreateBaseApkWithAapt2 and registers the file
as a FileWrite, so an incremental Release build that skips the resource link
loses them and ships an APK that dies inflating FitWindowsFrameLayout.

Verified on a Pixel 9 emulator (API 36) with the obfuscated Release APK:
launch, connection list, Add Connection form, and a Bolt connection attempt
that exercises the network/TLS stack and surfaces the driver's error dialog.

The AAB carries mapping.txt, so Play retraces Java stacks itself.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-17 22:58:36 +02:00
Trevi Awater
c5403313d9 Update README.md 2026-04-02 13:26:29 +02:00
Trevi Awater
6235e54d56 cleanup 2026-03-31 13:44:03 +02:00
Trevi Awater
21a21640e9 fixes 2026-03-30 21:39:25 +02:00
Trevi Awater
3f87a65c14 Fixes 2026-03-30 21:37:04 +02:00
Trevi Awater
984bfce33a site 2025-10-29 08:09:01 +01:00
Trevi Awater
b6d2d5c0fa README 2025-10-29 08:00:33 +01:00
Trevi Awater
100e5d01f5 Initial commit 2021-11-11 22:19:25 +01:00