diff --git a/lib/android.js b/lib/android.js index a9772c9..06b2adc 100644 --- a/lib/android.js +++ b/lib/android.js @@ -1885,7 +1885,6 @@ function ensureArtKnowsHowToHandleReplacementMethods (vm) { const apiLevel = getAndroidApiLevel(); let exportName = null; - if (apiLevel > 28) { exportName = '_ZN3art2gc9collector17ConcurrentCopying12CopyingPhaseEv'; } else if (apiLevel > 22) { @@ -1893,11 +1892,12 @@ function ensureArtKnowsHowToHandleReplacementMethods (vm) { } if (exportName !== null) { - let collectorCMC = Module.getExportByName('libart.so', '_ZN3art2gc9collector11MarkCompact15CompactionPhaseEv'); - if(collectorCMC !== null){ + Interceptor.attach(Module.getExportByName('libart.so', exportName), artController.hooks.Gc.copyingPhase); + + const collectorCMC = Module.findExportByName('libart.so', '_ZN3art2gc9collector11MarkCompact15CompactionPhaseEv'); + if (collectorCMC !== null) { Interceptor.attach(collectorCMC, artController.hooks.Gc.copyingPhase); } - Interceptor.attach(Module.getExportByName('libart.so', exportName), artController.hooks.Gc.copyingPhase); } }