Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accessing hidden field violation - ScaleGestureDetector #39

Closed
LukasPaczos opened this issue Apr 9, 2018 · 3 comments · Fixed by #73
Closed

Accessing hidden field violation - ScaleGestureDetector #39

LukasPaczos opened this issue Apr 9, 2018 · 3 comments · Fixed by #73
Milestone

Comments

@LukasPaczos
Copy link
Contributor

Refs. mapbox/mapbox-gl-native#11625.
Android P introduces new restrictions when it comes to accessing private and hidden methods and fields within the SDK, see the preview note.

#30 uses reflection to access private fields and we need to workaround that in preparation for the Android P release.

There is already an issue tracked on the Google's issue board regarding settable span values for the ScaleGestureDetector, I'm not really sure about chances of it being adressed.

/cc @tobrun

@LukasPaczos LukasPaczos changed the title Android P compatibility - ScaleGestureDetector Accessing hidden field violation - ScaleGestureDetector Sep 20, 2018
@LukasPaczos
Copy link
Contributor Author

Noting here that since the release of the Android Pie, the hidden field access violation has been moved to the light greylist:

Accessing hidden field Landroid/view/View;->mAccessibilityDelegate:Landroid/view/View$AccessibilityDelegate; (light greylist, reflection)

@flavienbwk
Copy link

Problem is still active.

@LukasPaczos
Copy link
Contributor Author

Noting that in the Android Q beta reflection on this particular part of the code has been moved to the "dark greylist":

Accessing hidden field Landroid/view/ScaleGestureDetector;->mMinSpan:I (greylist-max-p, reflection)
Accessing hidden field Landroid/view/ScaleGestureDetector;->mSpanSlop:I (greylist-max-p, reflection)

which based on the docs:

Similarly, if a greylisted non-SDK interface was not restricted in Android Pie but is now restricted in Android Q, that interface is part of the greylist-max-p list, where “p” stands for Pie or Android 9 (API level 28).

means that if the app targets Android Q or above, the workaround is going to result in no-op/exception.

Since there's no movement in the ticket tracking the span in the scale gesture detector, I think we're forced to roll out our own implementation by the time Android Q is officially released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants