You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Commands are tested against the following devices. The runtime uses version-aware transaction code resolution (`binder/versionaware`) with tables for API 34, 35, and 36. "SM" = ServiceManager-level lookup, "Proxy" = generated proxy method with version-aware code resolution.
1785
+
Commands are tested against the following devices. The runtime uses version-aware transaction code resolution (`binder/versionaware`) that dynamically extracts codes from the device's framework JARs, with compiled tables as a fallback. "SM" = ServiceManager-level lookup, "Proxy" = generated proxy method with version-aware code resolution.
1781
1786
1782
1787
<details>
1783
1788
<summary>Verification matrix</summary>
@@ -2068,15 +2073,15 @@ This discovers all AIDL files across `frameworks-base`, `frameworks-native`, `ha
2068
2073
2069
2074
### Transaction Code Resolution
2070
2075
2071
-
Each binder method has a numeric transaction code that can differ between Android versions. The generated proxies call `ResolveCode()` at runtime to get the correct code for the device, using a three-layer detection strategy:
2076
+
Each binder method has a numeric transaction code that can differ between Android versions. The generated proxies call `ResolveCode()` at runtime to get the correct code for the device, using a multi-layer detection strategy:
2072
2077
2073
-
1.**DEX bytecode extraction** (primary) — scans `/system/framework/*.jar`, parses DEX bytecode, and reads `TRANSACTION_*` constants from `$Stub` classes. This gives definitive codes for the exact firmware running on the device. This method is expected to work on all Android devices. If it fails on your platform, please [open an issue](https://github.com/AndroidGoLab/binder/issues).
2078
+
1.**DEX bytecode extraction** (primary) — scans `/system/framework/*.jar` and APEX module JARs, parses DEX bytecode, and reads `TRANSACTION_*` constants from `$Stub` classes. Individual interfaces are extracted on demand (lazy), and results are cached to avoid re-scanning. This gives definitive codes for the exact firmware running on the device. This method is expected to work on all Android devices. If it fails on your platform, please [open an issue](https://github.com/AndroidGoLab/binder/issues).
2074
2079
2075
-
2.**Compiled version tables + ELF filtering** (fallback) — pre-compiled tables from multiple AOSP revision tags, narrowed by API level (from ELF `.note.android.ident`) and exported symbols in `libbinder.so`.
2080
+
2.**Compiled version tables + ELF filtering** (fallback) — pre-compiled tables from AOSP revision tags, narrowed by API level and exported symbols in `libbinder.so`. Used when framework JARs are not readable (e.g. non-Android host, restricted SELinux context).
2076
2081
2077
-
3.**Live transaction probing** (last resort) — sends a test transaction (`isUserAMonkey()` on ActivityManager) with each candidate code and picks the one that returns a valid response.
2082
+
3.**Live transaction probing** (last resort) — sends a test transaction (`isUserAMonkey()` on ActivityManager) with each candidate code and picks the one that returns a valid response. Used only to distinguish between AOSP revisions when ELF inspection is ambiguous.
2078
2083
2079
-
Methods 2 and 3 exist only for extra reliability in edge cases (e.g. no read access to `/system/framework/`). The `genversions` tool builds the version tables by checking out AOSP revision tags and recording method→code mappings.
2084
+
Methods 2 and 3 exist only for environments where framework JARs are unavailable. On a standard Android device, all transaction codes are resolved dynamically from the device's own JARs.
2080
2085
2081
2086
## Testing and Verification
2082
2087
@@ -2330,7 +2335,7 @@ See the example app at [`examples/gomobile/`](examples/gomobile/).
0 commit comments