@@ -30,7 +30,6 @@ const kAccSkipAccessChecks = 0x00080000;
3030const kAccSingleImplementation = 0x08000000 ;
3131const kAccNterpEntryPointFastPathFlag = 0x00100000 ;
3232const kAccNterpInvokeFastPathFlag = 0x00200000 ;
33- const kAccCompileDontBother = 0x02000000 ;
3433const kAccPublicApi = 0x10000000 ;
3534const kAccXposedHookedMethod = 0x10000000 ;
3635
@@ -435,6 +434,18 @@ function _getApi () {
435434 temporaryApi . vm = vms . readPointer ( ) ;
436435
437436 if ( isArt ) {
437+ const apiLevel = getAndroidApiLevel ( ) ;
438+
439+ let kAccCompileDontBother ;
440+ if ( apiLevel >= 27 ) {
441+ kAccCompileDontBother = 0x02000000 ;
442+ } else if ( apiLevel >= 24 ) {
443+ kAccCompileDontBother = 0x01000000 ;
444+ } else {
445+ kAccCompileDontBother = 0 ;
446+ }
447+ temporaryApi . kAccCompileDontBother = kAccCompileDontBother ;
448+
438449 const artRuntime = temporaryApi . vm . add ( pointerSize ) . readPointer ( ) ;
439450 temporaryApi . artRuntime = artRuntime ;
440451 const runtimeOffset = getArtRuntimeSpec ( temporaryApi ) . offset ;
@@ -3314,6 +3325,8 @@ class ArtMethodMangler {
33143325 }
33153326
33163327 replace ( impl , isInstanceMethod , argTypes , vm , api ) {
3328+ const { kAccCompileDontBother, artNterpEntryPoint } = api ;
3329+
33173330 this . originalMethod = fetchArtMethod ( this . methodId , vm ) ;
33183331
33193332 const originalFlags = this . originalMethod . accessFlags ;
@@ -3351,8 +3364,6 @@ class ArtMethodMangler {
33513364
33523365 // Replace Nterp quick entrypoints with art_quick_to_interpreter_bridge to force stepping out
33533366 // of ART's next-generation interpreter and use the quick stub instead.
3354- const { artNterpEntryPoint } = api ;
3355-
33563367 if ( artNterpEntryPoint !== undefined && quickCode . equals ( artNterpEntryPoint ) ) {
33573368 patchArtMethod ( hookedMethodId , {
33583369 quickCode : api . artQuickToInterpreterBridge
0 commit comments