René's URL Explorer Experiment


Title: fix: restore interface methods hidden on API 28 by edusperoni · Pull Request #2122 · NativeScript/android · GitHub

Open Graph Title: fix: restore interface methods hidden on API 28 by edusperoni · Pull Request #2122 · NativeScript/android

X Title: fix: restore interface methods hidden on API 28 by edusperoni · Pull Request #2122 · NativeScript/android

Description: Description On Android 9, objects of some non-public platform classes were missing public interface methods in JS. The visible case: iterating a java.util.concurrent.ConcurrentHashMap's keySet(), values() or entrySet() failed with iterator.hasNext is not a function. The bug A class that is not in the build-time metadata (non-public JDK classes are not) is described on the device by reflection: the runtime takes each class's own declared methods and walks up the superclass chain. It never looks at the interfaces the class implements. ConcurrentHashMap's iterators get hasNext() and remove() from a non-public base class. On Android 9 those two members are on the hidden-API "dark greylist", and for an app targeting API 28 or higher getDeclaredMethods() drops such members silently, with no log line. So the JS prototype had next but no hasNext. Only Android 9 is affected. Earlier versions have no such filtering, and from Android 10 these members count as public API. It is not specific to ConcurrentHashMap. On Android 9 ArrayList and HashMap spliterators lose tryAdvance, forEachRemaining and estimateSize, and TreeMap sub-map iterators lose forEachRemaining. Every missing member is a method of a public interface the object implements. A lookup on the hidden class is also denied through JNI whenever app Java code is on top of the stack (a callback, a worker), so resolving the method on the concrete class is not a fix. The fix A platform class that is missing from the build-time metadata now also gets the methods of the public interfaces it implements, under every name its class chain does not already have. Those entries are the interface's own, so a call resolves the method on the interface (java.util.Iterator.hasNext), which is public API in every calling context, and dispatches virtually to the hidden implementation. Rules: Additive only. A name that exists anywhere on the class chain is never touched; overload sets are never merged. Platform (boot class path) classes only. App and library classes carry no hidden-API flags and are described exactly as before. Only interfaces in the app's build-time metadata contribute. A public but non-SDK interface is skipped without being resolved. Same on every API level. Among several interfaces declaring a name, the most specific one wins. Static interface methods are never added. The cost is paid once per such class: a few getInterfaces() calls on the Java side, and one name check per interface method when its prototype is built. Nothing is added to any call path or to lookups of classes that already exist. A second commit fixes a defect this exposed: an interface resolved on the device (it has no superclass) was linked to the node of an unrelated type, because its empty base line was read into a stale variable. Materialising that node crashed. Behaviour change on current Android versions Default methods of public interfaces that a non-public platform class does not override become callable, where they were undefined on every API level before. Examples on API 33: forEachRemaining on ConcurrentHashMap and HashMap iterators; reversed and thenComparing on the comparator behind String.CASE_INSENSITIVE_ORDER. Names that existed before stay on the prototype they were on. The added names come from the SDK the app is built against, as for every class in the metadata: a method newer than the device (Enumeration.asIterator on API 28) is a function that throws when called. Verification Cause confirmed on an API 28 emulator: relaxing the device's hidden-API policy makes the three failing specs pass with no code change; reflection from app code shows BaseIterator's declared methods without hasNext/remove, and logcat names the dark greylist when they are looked up individually. Full suite, 1613 specs, 0 failures on the API 28 emulator and on an API 33 phone. On main the API 28 run has the three ConcurrentHashMap failures. Without the fix, 12 of the new specs fail on API 28 and the two that describe the new default-method behaviour fail on API 33. The spec that calls hidden methods first from a callback that app Java code invokes fails on API 28 when the call is made to resolve on the concrete class instead (Accessing hidden method … (dark greylist, JNI)). :runtime:testDebugUnitTest: 36 tests, 0 failures. CI runs API 33 only, so the Android 9 behaviour was verified locally. Not run: other API levels. Not included Hidden public methods of platform classes that belong to no interface, hidden public fields, and hidden overloads whose name already exists on the class chain with another signature. Applying the same rule to app and library classes, which would make interface default methods callable on their non-public implementers and on lambdas too. That changes the shape of far more classes and is left for a separate decision. Does your pull request have unit tests? Yes: new specs in testJavaIterators.js (removal through ConcurrentHashMap iterators, ArrayList and HashMap spliterators, a TreeMap sub-map iterator, default methods on a ConcurrentHashMap iterator and on a private comparator, a call first made from an app-Java callback, a worker, and pins that existing members, app classes, overloads and a direct ByteBuffer are unchanged), plus JVM tests of the interface ordering and of the generated description. Summary by CodeRabbit Bug Fixes Runtime-resolved Java classes now expose applicable public interface methods, improving access to operations such as iterator removal, spliterator methods, default interface methods, and comparator reversal. Method resolution for runtime-resolved sub-lists and interface methods invoked through callbacks and workers is now covered by additional tests.

Open Graph Description: Description On Android 9, objects of some non-public platform classes were missing public interface methods in JS. The visible case: iterating a java.util.concurrent.ConcurrentHashMap's keySet(...

X Description: Description On Android 9, objects of some non-public platform classes were missing public interface methods in JS. The visible case: iterating a java.util.concurrent.ConcurrentHashMap's key...

Opengraph URL: https://github.com/NativeScript/android/pull/2122

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:de2caf17-51fd-0bfa-49be-e66938b98868
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idD990:6365:179A097:1F78944:6B0146E9
html-safe-nonce315bf4d81a8a6dcece9e576c050e2a5b206436e2a5c16905fc0667a504e18781
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEOTkwOjYzNjU6MTc5QTA5NzoxRjc4OTQ0OjZCMDE0NkU5IiwidmlzaXRvcl9pZCI6IjE5ODQzNjAyMjkyNTI0NTAwMjUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac61212b38f0d59da72943aac595b367f0e88837c7818a08eb751f6379b2f18b0a
hovercard-subject-tagpull_request:5364559288
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/NativeScript/android/pull/2122/files
twitter:imagehttps://avatars.githubusercontent.com/u/4061767?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/4061767?s=400&v=4
og:image:altDescription On Android 9, objects of some non-public platform classes were missing public interface methods in JS. The visible case: iterating a java.util.concurrent.ConcurrentHashMap's keySet(...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/NativeScript/android git https://github.com/NativeScript/android.git
octolytics-dimension-user_id7392261
octolytics-dimension-user_loginNativeScript
octolytics-dimension-repository_id29137950
octolytics-dimension-repository_nwoNativeScript/android
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id29137950
octolytics-dimension-repository_network_root_nwoNativeScript/android
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/NativeScript/android/pull/2122/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FNativeScript%2Fandroid%2Fpull%2F2122%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FNativeScript%2Fandroid%2Fpull%2F2122%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=NativeScript%2Fandroid
Reloadhttps://github.com/NativeScript/android/pull/2122/files
Reloadhttps://github.com/NativeScript/android/pull/2122/files
Reloadhttps://github.com/NativeScript/android/pull/2122/files
NativeScripthttps://github.com/NativeScript
androidhttps://github.com/NativeScript/android
Codehttps://github.com/NativeScript/android
Issues106 (106)https://github.com/NativeScript/android/issues
Pull requests24 (24)https://github.com/NativeScript/android/pulls
Actionshttps://github.com/NativeScript/android/actions
Projectshttps://github.com/NativeScript/android/projects
Wikihttps://github.com/NativeScript/android/wiki
Security and qualityhttps://github.com/NativeScript/android/security
Insightshttps://github.com/NativeScript/android/insights
Sign up for GitHub https://github.com/signup?return_to=%2FNativeScript%2Fandroid%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2FNativeScript%2Fandroid%2Fissues%2Fnew%2Fchoose
edusperonihttps://github.com/edusperoni
mainhttps://github.com/NativeScript/android/tree/main
fix/runtime-types-interface-methodshttps://github.com/NativeScript/android/tree/fix/runtime-types-interface-methods
Conversation 1 https://github.com/NativeScript/android/pull/2122
Commits 2 https://github.com/NativeScript/android/pull/2122/commits
Checks 8 https://github.com/NativeScript/android/pull/2122/checks
Files changed https://github.com/NativeScript/android/pull/2122/files
Please reload this pagehttps://github.com/NativeScript/android/pull/2122/files
fix: restore interface methods hidden on API 28 https://github.com/NativeScript/android/pull/2122/files#top
Show all changes 2 commits https://github.com/NativeScript/android/pull/2122/files
9225bae fix(metadata): give runtime-resolved interfaces no base class edusperoni Nov 17, 2026 https://github.com/NativeScript/android/pull/2122/commits/9225bae6f162ebda32492ea09703e870fefe75a7
51f10aa fix(metadata): add interface methods to runtime-resolved boot classes edusperoni Nov 17, 2026 https://github.com/NativeScript/android/pull/2122/commits/51f10aaa0a11c584965881b3a6596be5075b308c
Clear filters https://github.com/NativeScript/android/pull/2122/files
Please reload this pagehttps://github.com/NativeScript/android/pull/2122/files
Please reload this pagehttps://github.com/NativeScript/android/pull/2122/files
runtimeTypeInterfaceMethodsWorker.js https://github.com/NativeScript/android/pull/2122/files#diff-c20f057ec195c3940f40e0d030aa9953ff6bfdc3c5dd65138e4ddace967dd331
testJavaIterators.js https://github.com/NativeScript/android/pull/2122/files#diff-6685afcaf988b10707eb4bce3f326d5c3618471770a3297a3a958f3c637a8848
IteratorFixtures.java https://github.com/NativeScript/android/pull/2122/files#diff-c316ddf2362991c4bd63a7b5632fc3f49501ecab697a0f0293e3c1d675d3890f
MetadataNode.cpp https://github.com/NativeScript/android/pull/2122/files#diff-6f6c5b64f60875e24b75b8a21b3164f114822aa7e5add5755f072f36403f7f8b
MetadataNode.h https://github.com/NativeScript/android/pull/2122/files#diff-ac7f7c34025389ca6f1145667245073945ad1bc6b2b1285a05bf4d084924f091
MetadataReader.cpp https://github.com/NativeScript/android/pull/2122/files#diff-c10689703cc3f34ede1d9fe01cad25579a071758c828e86ad0cad3d9e179bb1e
MetadataReader.h https://github.com/NativeScript/android/pull/2122/files#diff-4fda5fc04e9fe4f5478ca473515ea8d2af62f9187b876614daaa2d023c459104
Runtime.java https://github.com/NativeScript/android/pull/2122/files#diff-cf9bb4e9ca1a476cacd6e270fc8bcd12c71f89d52d272915bc99df57b3581f59
RuntimeTypeMetadataTest.java https://github.com/NativeScript/android/pull/2122/files#diff-d0b546206e41b7e9d8552f2db161cd6e2a50b50183d0cf3f1b15e845a76695b8
test-app/app/src/main/assets/app/tests/runtimeTypeInterfaceMethodsWorker.jshttps://github.com/NativeScript/android/pull/2122/files#diff-c20f057ec195c3940f40e0d030aa9953ff6bfdc3c5dd65138e4ddace967dd331
View file https://github.com/NativeScript/android/blob/51f10aaa0a11c584965881b3a6596be5075b308c/test-app/app/src/main/assets/app/tests/runtimeTypeInterfaceMethodsWorker.js
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/NativeScript/android/pull/2122/{{ revealButtonHref }}
test-app/app/src/main/assets/app/tests/testJavaIterators.jshttps://github.com/NativeScript/android/pull/2122/files#diff-6685afcaf988b10707eb4bce3f326d5c3618471770a3297a3a958f3c637a8848
View file https://github.com/NativeScript/android/blob/51f10aaa0a11c584965881b3a6596be5075b308c/test-app/app/src/main/assets/app/tests/testJavaIterators.js
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/NativeScript/android/pull/2122/{{ revealButtonHref }}
https://github.com/NativeScript/android/pull/2122/files#diff-6685afcaf988b10707eb4bce3f326d5c3618471770a3297a3a958f3c637a8848
test-app/app/src/main/java/com/tns/tests/IteratorFixtures.javahttps://github.com/NativeScript/android/pull/2122/files#diff-c316ddf2362991c4bd63a7b5632fc3f49501ecab697a0f0293e3c1d675d3890f
View file https://github.com/NativeScript/android/blob/51f10aaa0a11c584965881b3a6596be5075b308c/test-app/app/src/main/java/com/tns/tests/IteratorFixtures.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/NativeScript/android/pull/2122/{{ revealButtonHref }}
https://github.com/NativeScript/android/pull/2122/files#diff-c316ddf2362991c4bd63a7b5632fc3f49501ecab697a0f0293e3c1d675d3890f
https://github.com/NativeScript/android/pull/2122/files#diff-c316ddf2362991c4bd63a7b5632fc3f49501ecab697a0f0293e3c1d675d3890f
test-app/runtime/src/main/cpp/MetadataNode.cpphttps://github.com/NativeScript/android/pull/2122/files#diff-6f6c5b64f60875e24b75b8a21b3164f114822aa7e5add5755f072f36403f7f8b
View file https://github.com/NativeScript/android/blob/51f10aaa0a11c584965881b3a6596be5075b308c/test-app/runtime/src/main/cpp/MetadataNode.cpp
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/NativeScript/android/pull/2122/{{ revealButtonHref }}
https://github.com/NativeScript/android/pull/2122/files#diff-6f6c5b64f60875e24b75b8a21b3164f114822aa7e5add5755f072f36403f7f8b
https://github.com/NativeScript/android/pull/2122/files#diff-6f6c5b64f60875e24b75b8a21b3164f114822aa7e5add5755f072f36403f7f8b
https://github.com/NativeScript/android/pull/2122/files#diff-6f6c5b64f60875e24b75b8a21b3164f114822aa7e5add5755f072f36403f7f8b
https://github.com/NativeScript/android/pull/2122/files#diff-6f6c5b64f60875e24b75b8a21b3164f114822aa7e5add5755f072f36403f7f8b
https://github.com/NativeScript/android/pull/2122/files#diff-6f6c5b64f60875e24b75b8a21b3164f114822aa7e5add5755f072f36403f7f8b
https://github.com/NativeScript/android/pull/2122/files#diff-6f6c5b64f60875e24b75b8a21b3164f114822aa7e5add5755f072f36403f7f8b
https://github.com/NativeScript/android/pull/2122/files#diff-6f6c5b64f60875e24b75b8a21b3164f114822aa7e5add5755f072f36403f7f8b
https://github.com/NativeScript/android/pull/2122/files#diff-6f6c5b64f60875e24b75b8a21b3164f114822aa7e5add5755f072f36403f7f8b
test-app/runtime/src/main/cpp/MetadataNode.hhttps://github.com/NativeScript/android/pull/2122/files#diff-ac7f7c34025389ca6f1145667245073945ad1bc6b2b1285a05bf4d084924f091
View file https://github.com/NativeScript/android/blob/51f10aaa0a11c584965881b3a6596be5075b308c/test-app/runtime/src/main/cpp/MetadataNode.h
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/NativeScript/android/pull/2122/{{ revealButtonHref }}
https://github.com/NativeScript/android/pull/2122/files#diff-ac7f7c34025389ca6f1145667245073945ad1bc6b2b1285a05bf4d084924f091
https://github.com/NativeScript/android/pull/2122/files#diff-ac7f7c34025389ca6f1145667245073945ad1bc6b2b1285a05bf4d084924f091
Please reload this pagehttps://github.com/NativeScript/android/pull/2122/files
Please reload this pagehttps://github.com/NativeScript/android/pull/2122/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.