Title: fix(DexFactory): register injected proxy dex with a single class loader by edusperoni · Pull Request #1968 · NativeScript/android · GitHub
Open Graph Title: fix(DexFactory): register injected proxy dex with a single class loader by edusperoni · Pull Request #1968 · NativeScript/android
X Title: fix(DexFactory): register injected proxy dex with a single class loader by edusperoni · Pull Request #1968 · NativeScript/android
Description: Injecting a generated proxy into the app's PathClassLoader by opening it through a temporary DexClassLoader and splicing its dex element left the same DexFile claimed by two class loaders. ART rejects this unconditionally ("Attempt to register dex file ... with multiple class loaders"), but the second registration only materializes on non-debuggable builds, so release apps crashed on the first runtime-generated proxy while debug builds worked. Build the dex element through the target class loader itself instead, so the DexFile only ever has one owner: on API 24+ via BaseDexClassLoader.addDexPath, below that via DexPathList's static makePathElements/makeDexElements factories spliced into dexElements (the MultiDex technique). If injection fails, fall back to the isolated DexClassLoader path (pre-#1951 behavior) instead of failing the subsequent loadClass with ClassNotFoundException. Adds tests covering the original FragmentFactory scenario: proxies generated at runtime (hidden from the static binding generator) must be resolvable via Class.forName through the app's class loader. Fixes #1962 Refs #1951 Summary by CodeRabbit Tests Added a startup-loaded test suite that verifies discovery and reflective instantiation of runtime-generated classes. Refactor Improved dynamic class-loading behavior: injection now reports success/failure and falls back to a safer loading path when injection isn’t possible.
Open Graph Description: Injecting a generated proxy into the app's PathClassLoader by opening it through a temporary DexClassLoader and splicing its dex element left the same DexFile claimed by two class loaders. ART ...
X Description: Injecting a generated proxy into the app's PathClassLoader by opening it through a temporary DexClassLoader and splicing its dex element left the same DexFile claimed by two class loaders. ...
Opengraph URL: https://github.com/NativeScript/android/pull/1968
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:4a938dc3-f8f7-af8e-cb52-234358333c4f |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | A842:143885:12EBDE6:1B15F77:6A63426C |
| html-safe-nonce | 3a9f99ed42a365fbaaead1cb36f3560c44e7973f4d4961e991d34c95f65420c5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBODQyOjE0Mzg4NToxMkVCREU2OjFCMTVGNzc6NkE2MzQyNkMiLCJ2aXNpdG9yX2lkIjoiMjcxMjI1OTY5NDQ1MTQ0MjI4NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | aa1d7a82156c21198d0ec8c5c0f7eadaaaa1ddbd7610a5cd6074bb8ed7efc7be |
| hovercard-subject-tag | pull_request:3849737034 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/NativeScript/android/pull/1968/files |
| twitter:image | https://avatars.githubusercontent.com/u/4061767?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/4061767?s=400&v=4 |
| og:image:alt | Injecting a generated proxy into the app's PathClassLoader by opening it through a temporary DexClassLoader and splicing its dex element left the same DexFile claimed by two class loaders. ART ... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 59e55daad7174ca59d63c6974d58276ccb5477442e550bebb3c035e1bef11c94 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/NativeScript/android git https://github.com/NativeScript/android.git |
| octolytics-dimension-user_id | 7392261 |
| octolytics-dimension-user_login | NativeScript |
| octolytics-dimension-repository_id | 29137950 |
| octolytics-dimension-repository_nwo | NativeScript/android |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 29137950 |
| octolytics-dimension-repository_network_root_nwo | NativeScript/android |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 990295d92a4cc7b63fbbd83a046217cd7d77d49c |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width