Skip to content

Commit

Permalink
Merge pull request #80 from paulo-raca/api27
Browse files Browse the repository at this point in the history
Fix errors on API 27
  • Loading branch information
rk700 authored Oct 16, 2018
2 parents 7399d86 + 8b5f7d2 commit f732100
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package lab.galaxy.yahfa;

import android.os.Build;
import android.support.test.runner.AndroidJUnit4;
import android.util.Log;

import org.junit.Assert;
import org.junit.Before;
Expand Down Expand Up @@ -53,6 +55,7 @@ public static int backup(InstanceHook thiz, int arg) {

@Before
public void setup() {
Log.i(TAG, "ABI=" + Build.CPU_ABI);
StaticHook.targetCount = 0;
StaticHook.hookCount = 0;
StaticHook.backupCount = 0;
Expand Down
4 changes: 2 additions & 2 deletions library/src/main/jni/HookMain.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ static int doBackupAndHook(void *targetMethod, void *hookMethod, void *backupMet
}

if(backupMethod) {// do method backup
if(SDKVersion < ANDROID_P) {
if(SDKVersion < ANDROID_O2) {
// update the cached method manually
// first we find the array of cached methods
void *dexCacheResolvedMethods = (void *) readAddr(
Expand Down Expand Up @@ -243,4 +243,4 @@ jboolean Java_lab_galaxy_yahfa_HookMain_backupAndHookNative(JNIEnv *env, jclass
} else {
return JNI_FALSE;
}
}
}

0 comments on commit f732100

Please sign in to comment.