瀏覽代碼

add arm64

huangxi 2 年之前
父節點
當前提交
c8a4a6bd70
共有 29 個文件被更改,包括 6800 次插入45 次删除
  1. 4 4
      app/build.gradle
  2. 1 1
      app/proguard-rules.pro
  3. 3 3
      app/src/main/java/com/sheep/gamegroup/view/adapter/LieMakeMoneyAdp.java
  4. 23 3
      app/src/main/java/com/snail/antifake/jni/EmulatorDetectUtil.java
  5. 16 0
      app/src/main/java/com/snail/antifake/jni/PropertiesGet.java
  6. 173 0
      app/src/main/jni/emcheck64.c
  7. 85 0
      app/src/main/jni/proget.c
  8. 二進制
      app/src/main/libs/arm64-v8a/libemualtor_checks.so
  9. 二進制
      app/src/main/libs/arm64-v8a/libemulator_check.so
  10. 二進制
      app/src/main/libs/arm64-v8a/libproget.so
  11. 二進制
      app/src/main/libs/armeabi-v7a/libemualtor_checks.so
  12. 二進制
      app/src/main/libs/armeabi-v7a/libproget.so
  13. 二進制
      app/src/main/libs/armeabi/libemualtor_checks.so
  14. 二進制
      app/src/main/libs/armeabi/libemulator_check.so
  15. 二進制
      app/src/main/libs/armeabi/libproget.so
  16. 二進制
      app/src/main/libs/mips/libemualtor_checks.so
  17. 二進制
      app/src/main/libs/mips/libemulator_check.so
  18. 二進制
      app/src/main/libs/mips64/libemualtor_checks.so
  19. 二進制
      app/src/main/libs/mips64/libemulator_check.so
  20. 二進制
      app/src/main/libs/x86/libemualtor_checks.so
  21. 二進制
      app/src/main/libs/x86/libemulator_check.so
  22. 二進制
      app/src/main/libs/x86/libproget.so
  23. 二進制
      app/src/main/libs/x86_64/libemualtor_checks.so
  24. 二進制
      app/src/main/libs/x86_64/libemulator_check.so
  25. 二進制
      app/src/main/libs/x86_64/libproget.so
  26. 32 32
      app/src/main/res/layout/lie_make_money_prompt_item.xml
  27. 2 2
      gradle.properties
  28. 367 0
      hs_err_pid4340.log
  29. 6094 0
      replay_pid4340.log

+ 4 - 4
app/build.gradle

@@ -15,7 +15,7 @@ android {
         multiDexEnabled true
         testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
         ndk {
-            abiFilters "armeabi-v7a"//,"arm64-v8a",, 'x86'//, 'armeabi-v7a', 'x86_64', 'arm64-v8a'
+            abiFilters "armeabi-v7a","arm64-v8a"//, 'x86'//, 'armeabi-v7a', 'x86_64', 'arm64-v8a'
         }
 //        jackOptions {
 //            enabled true
@@ -337,9 +337,9 @@ dependencies {
         exclude group: 'com.android.support', module: 'support-core-ui'
     }
 
-    implementation('com.github.ithedan:TextViewDrawable:v1.0') {
-        exclude group: 'com.android.support', module: 'appcompat-v7'
-    }
+//    implementation('com.github.ithedan:TextViewDrawable:v1.0') {
+//        exclude group: 'com.android.support', module: 'appcompat-v7'
+//    }
 
     //    implementation 'com.github.zhangkexpz:LayoutScroll:v1.0'
 

+ 1 - 1
app/proguard-rules.pro

@@ -87,7 +87,7 @@
 # ------------------ Keep LineNumbers and properties ---------------- #
 -keepattributes Exceptions,InnerClasses,Signature,Deprecated,SourceFile,LineNumberTable,*Annotation*,EnclosingMethod
 # --------------------------------------------------------------------------
-
+-keep class com.snail.antifake.jni.** { *; }
 # Addidional for x5.sdk classes for apps
 
 -keep class com.tencent.smtt.export.external.**{

+ 3 - 3
app/src/main/java/com/sheep/gamegroup/view/adapter/LieMakeMoneyAdp.java

@@ -61,9 +61,9 @@ public class LieMakeMoneyAdp extends AdbCommonRecycler<RecyleObj> {
             case PROCESS_ON_HOOK:
                 resId = R.layout.lie_make_money_processing_item;
                 break;
-            case PROMPT_ON_HOOK:
-                resId = R.layout.lie_make_money_prompt_item;
-                break;
+//            case PROMPT_ON_HOOK:
+//                resId = R.layout.lie_make_money_prompt_item;
+//                break;
         }
         return resId;
     }

+ 23 - 3
app/src/main/java/com/snail/antifake/jni/EmulatorDetectUtil.java

@@ -10,16 +10,36 @@ package com.snail.antifake.jni;
 public class EmulatorDetectUtil {
 
     static {
-        System.loadLibrary("emulator_check");
+        System.loadLibrary("emualtor_checks");
     }
 
-    public static native boolean detect();
+    public static native boolean detectS();
 
     public static boolean isEmulator() {
-        return detect();
+        return detectS();
+//        return true;
     }
 
     public void throwNativeCrash(){
 
     }
+    public static int getSystemArch() {
+        String cpuAbi=  PropertiesGet.getString("ro.product.cpu.abi");
+        if("armeabi-v7a".equals(cpuAbi))
+            return Arch.ARM32;
+        if("arm64-v8a".equals(cpuAbi))
+            return Arch.ARM64;
+        if("x86".equals(cpuAbi)  )
+            return Arch.X86;
+        if(  "x86_64".equals(cpuAbi))
+            return Arch.X86_64;
+        return Arch.ARM64;
+    }
+
+    public interface Arch {
+        int X86 = 0;
+        int X86_64 = 1;
+        int ARM32 = 2;
+        int ARM64 = 3;
+    }
 }

+ 16 - 0
app/src/main/java/com/snail/antifake/jni/PropertiesGet.java

@@ -0,0 +1,16 @@
+package com.snail.antifake.jni;
+
+public class PropertiesGet {
+    static{
+        System.loadLibrary("proget");
+    }
+
+    private static native String native_get(String key);
+    private static native String native_get(String key,String def);
+    public static String getString(String key){
+        return native_get(key);
+    }
+    public static String getString(String key,String def){
+        return native_get(key,def);
+    }
+}

+ 173 - 0
app/src/main/jni/emcheck64.c

@@ -0,0 +1,173 @@
+#include <jni.h>
+#include <stddef.h>
+#include <unistd.h>
+#include <sys/mman.h>
+#include <android/log.h>
+#include<fcntl.h>
+#include <signal.h>
+#include <assert.h>
+#include <stdlib.h>
+
+#define LOGI(...) __android_log_print(ANDROID_LOG_ERROR,"lishang",__VA_ARGS__)
+#define PROT PROT_EXEC|PROT_WRITE|PROT_READ
+//这里其实主要是检测是不是在x86或者在arm上运行
+
+
+const int handledSignals[] = {
+        SIGSEGV, SIGABRT, SIGFPE, SIGILL, SIGBUS
+};
+const int handledSignalsNum = sizeof(handledSignals) / sizeof(handledSignals[0]);
+struct sigaction old_handlers[5];
+
+void my_sigaction(int signal, siginfo_t *info, void *reserved) {
+    LOGI("Crash detect  signal %d", signal);
+    exit(0);
+}
+
+int load(JNIEnv *env) {
+    struct sigaction handler;
+    memset(&handler, 0, sizeof(sigaction));
+    handler.sa_sigaction = my_sigaction;
+    handler.sa_flags = SA_RESETHAND;
+    int i = 0;
+    for (; i < handledSignalsNum; ++i) {
+        sigaction(handledSignals[i], &handler, &old_handlers[i]);
+    }
+    return 1;
+}
+
+int a = -1;
+
+int (*asmcheck)(void);
+
+int getArch(JNIEnv *env) {
+    jclass cls = (*env)->FindClass(env, "com/snail/antifake/jni/EmulatorDetectUtil");
+    jmethodID mid = (*env)->GetStaticMethodID(env, cls, "getSystemArch", "()I");
+    return (jint) (*env)->CallStaticIntMethod(env, cls, mid);
+}
+
+jboolean JNICALL detect(JNIEnv *env, jclass jclass1) {
+    load(env);
+
+    int type = getArch(env);
+    if (type == 0 || type == 1) { return JNI_TRUE; }
+    char code32[] =
+            "\x04\xe0\x2d\xE5"
+            "\x00\x20\xA0\xE3"
+            "\x00\x00\xA0\xE3"
+            "\x01\x20\x82\xE2"
+            "\x0c\x30\x4f\xe2"
+            "\x00\x10\x93\xE5"
+            "\x01\x00\x80\xE2"
+            "\x0c\x30\x4f\xe2"
+            "\x00\x10\x83\xE5"
+            "\x0A\x00\x50\xE3"
+            "\x02\x00\x00\xAA"
+            "\x0A\x00\x52\xE3"
+            "\x00\x00\x00\xAA"
+            "\xf7\xff\xff\xea"
+            "\x04\xf0\x9d\xE4"
+            "\x00\x00\xa0\xe1"
+            "\x00\x00\xa0\xe1"
+            "\x00\x00\xa0\xe1"
+            "\x00\x00\xa0\xe1"
+            "\x00\x00\xa0\xe1"
+            "\x00\x00\xa0\xe1"
+            "\x00\x00\xa0\xe1"
+            "\x00\x00\xa0\xe1"
+            "\x00\x00\xa0\xe1"
+            "\x00\x00\xa0\xe1"
+            "\x00\x00\xa0\xe1"
+            "\x00\x00\xa0\xe1"
+            "\x00\x00\xa0\xe1"
+            "\x00\x00\xa0\xe1"
+            "\x00\x00\xa0\xe1"
+            "\x00\x00\xa0\xe1";
+
+    char code64[] =
+            "\xff\xc3\x00\xd1"//	sub	sp, sp, #0x30
+            "\xfd\x7b\x02\xa9"//	x29, x30, [sp,#32]
+            "\x02\x00\x80\xd2"//	x2, #0x0
+            "\x00\x00\x80\xd2"//	mov	x0, #0x0
+            "\x42\x04\x00\x91"//	add	x2, x2, #0x1
+            "\xe3\xff\xff\x10"//	adr	x3, 18 <smc>
+            "\x61\x00\x40\xf9"//	ldr	x1, [x3]
+            "\x00\x04\x00\x91"//	add	x0, x0, #0x1
+            "\xe3\xff\xff\x10"//	adr	x3, 24 <code>
+            "\x61\x00\x00\xf9"//	str	x1, [x3]
+            "\x1f\x28\x00\xf1" //	cmp	x0, #0xa
+            "\x8a\x00\x00\x54"//	b.ge	44 <out>
+            "\x5f\x28\x00\xf1"  //	cmp	x2, #0xa
+            "\x4a\x00\x00\x54"//	b.ge	44 <out>
+            "\xf9\xff\xff\x17"//	b	24 <code>
+            "\xfd\x7b\x42\xa9"//	ldp	x29, x30, [sp,#32]
+            "\xff\xc3\x00\x91"//	add	sp, sp, #0x30
+            "\xc0\x03\x5f\xd6" //	ret
+            "\x00\x00\xa0\xe1" //	nop
+            "\x00\x00\xa0\xe1" //	nop
+            "\x00\x00\xa0\xe1" //	nop
+            "\x00\x00\xa0\xe1" //	nop
+    ;
+
+//   LOGI(" start  detect");
+    void *exec = mmap(NULL, (size_t) getpagesize(), PROT, MAP_ANONYMOUS | MAP_PRIVATE, -1,
+                      (off_t) 0);
+//    LOGI(" mmap sucess exec  %x  %d ", exec,(size_t) getpagesize());
+    if (exec == (void *) -1) {
+        int fd = fopen("/dev/zero", "w+");
+        exec = mmap(NULL, (size_t) getpagesize(), PROT, MAP_PRIVATE, fd, (off_t) 0);
+        if (exec == (void *) -1) {
+            return 10;
+        }
+    }
+    if (type == 2) {
+        memcpy(exec, code32, sizeof(code32));
+    } else {
+        memcpy(exec, code64, sizeof(code64));
+    }
+
+//    LOGI(" mmap copy  exec  %x", exec);
+    //如果不是 (size_t) getpagesize() 是sizeof(code),就必须加上LOGI(" mmap sucess exec  %x", exec); ,才能降低崩溃概率,这尼玛操蛋
+    asmcheck = (int *) exec;
+    __clear_cache(exec, exec + (size_t) getpagesize());
+    a = asmcheck();
+//        LOGI(" ret --  %x", a);
+    munmap(exec, getpagesize());
+
+    return a == 1;
+}
+
+
+static int registerNativeMethods(JNIEnv *env, const char *className,
+                                 JNINativeMethod *gMethods, int numMethods) {
+    jclass clazz;
+    clazz = (*env)->FindClass(env, className);
+    if (clazz == NULL)
+        return JNI_FALSE;
+
+    if ((*env)->RegisterNatives(env, clazz, gMethods, numMethods) < 0) {
+        return JNI_FALSE;
+    }
+    return JNI_TRUE;
+}
+
+static const char *classPathName = "com/snail/antifake/jni/EmulatorDetectUtil";
+
+static JNINativeMethod methods[] = {
+        {"detectS", "()Z", (void *) detect},
+};
+
+jint JNI_OnLoad(JavaVM *vm, void *reserved) {
+    JNIEnv *env = NULL;
+    jint result = -1;
+
+    if ((*vm)->GetEnv(vm, (void **) &env, JNI_VERSION_1_4) != JNI_OK)
+        goto bail;
+    assert(env != NULL);
+    if (!registerNativeMethods(env, classPathName, methods, sizeof(methods) / sizeof(methods[0])))
+        goto bail;
+    result = JNI_VERSION_1_4;
+    bail:
+    //LOGI("Leaving JNI_OnLoad (result=0x%x)\n", result);
+    return result;
+}

+ 85 - 0
app/src/main/jni/proget.c

@@ -0,0 +1,85 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+#include <sys/system_properties.h>
+#include <android/log.h>
+#include <string.h>
+
+
+#define LOGI(...) __android_log_print(ANDROID_LOG_INFO,"lishang",__VA_ARGS__)
+
+
+JNIEXPORT jstring JNICALL
+proGetSS
+        (JNIEnv *env, jclass clazz, jstring keyJ, jstring defJ) {
+    int len;
+    const char *key;
+    char buf[100];
+    jstring rvJ = NULL;
+
+    if (keyJ == NULL) {
+        LOGI("key must not be null.");
+        goto error;
+    }
+
+    key = (*env)->GetStringUTFChars(env, keyJ, NULL);
+
+    len = __system_property_get(key, buf);
+    if ((len <= 0) && (defJ != NULL)) {
+        rvJ = defJ;
+    } else if (len >= 0) {
+        rvJ = (*env)->NewStringUTF(env, buf);
+    } else {
+        rvJ = (*env)->NewStringUTF(env, "");
+    }
+
+    (*env)->ReleaseStringUTFChars(env, keyJ, key);
+
+    error:
+    return rvJ;
+}
+
+
+JNIEXPORT jstring JNICALL
+    proGet(JNIEnv *env, jclass clazz, jstring keyJ) {
+    return proGetSS(env, clazz, keyJ, NULL);
+}
+
+
+static int registerNativeMethods(JNIEnv *env, const char *className,
+                                 JNINativeMethod *gMethods, int numMethods) {
+    jclass clazz;
+
+    clazz = (*env)->FindClass(env, className);
+    if (clazz == NULL)
+        return JNI_FALSE;
+
+    if ((*env)->RegisterNatives(env, clazz, gMethods, numMethods) < 0) {
+        return JNI_FALSE;
+    }
+    return JNI_TRUE;
+}
+static const char *classPathName = "com/snail/antifake/jni/PropertiesGet";
+
+static JNINativeMethod methods[] = {
+        {"native_get", "(Ljava/lang/String;)Ljava/lang/String;", (void *) proGet},
+        {"native_get", "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;", (void *) proGetSS},
+
+};
+
+jint JNI_OnLoad(JavaVM* vm, void* reserved)
+{
+    JNIEnv* env = NULL;
+    jint result = -1;
+
+    if ((*vm)->GetEnv(vm, (void**) &env, JNI_VERSION_1_4) != JNI_OK)
+        goto bail;
+
+    if (!registerNativeMethods(env, classPathName, methods, sizeof(methods)/sizeof(methods[0])))
+        goto bail;
+
+    result = JNI_VERSION_1_4;
+
+    bail:
+    //LOGI("Leaving JNI_OnLoad (result=0x%x)\n", result);
+    return result;
+}

二進制
app/src/main/libs/arm64-v8a/libemualtor_checks.so


二進制
app/src/main/libs/arm64-v8a/libemulator_check.so


二進制
app/src/main/libs/arm64-v8a/libproget.so


二進制
app/src/main/libs/armeabi-v7a/libemualtor_checks.so


二進制
app/src/main/libs/armeabi-v7a/libproget.so


二進制
app/src/main/libs/armeabi/libemualtor_checks.so


二進制
app/src/main/libs/armeabi/libemulator_check.so


二進制
app/src/main/libs/armeabi/libproget.so


二進制
app/src/main/libs/mips/libemualtor_checks.so


二進制
app/src/main/libs/mips/libemulator_check.so


二進制
app/src/main/libs/mips64/libemualtor_checks.so


二進制
app/src/main/libs/mips64/libemulator_check.so


二進制
app/src/main/libs/x86/libemualtor_checks.so


二進制
app/src/main/libs/x86/libemulator_check.so


二進制
app/src/main/libs/x86/libproget.so


二進制
app/src/main/libs/x86_64/libemualtor_checks.so


二進制
app/src/main/libs/x86_64/libemulator_check.so


二進制
app/src/main/libs/x86_64/libproget.so


+ 32 - 32
app/src/main/res/layout/lie_make_money_prompt_item.xml

@@ -9,36 +9,36 @@
     android:background="@drawable/x_shap_shadow_bg_rectgangle_white"
     android:orientation="vertical">
     <include layout="@layout/lie_make_money_operation_item"/>
-    <com.hedan.textdrawablelibrary.TextViewDrawable
-        style="@style/hint_txt_style"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:drawableLeft="@drawable/shape_small_black_oval"
-        android:drawablePadding="5dp"
-        app:isAliganCenter="false"
-        android:text="@string/tip_wechat_support_for_auto_task" />
-    <com.hedan.textdrawablelibrary.TextViewDrawable
-        style="@style/hint_txt_style"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:drawableLeft="@drawable/shape_small_black_oval"
-        android:drawablePadding="5dp"
-        app:isAliganCenter="false"
-        android:text="挂机收益每日晚上12点结算。" />
-    <com.hedan.textdrawablelibrary.TextViewDrawable
-        style="@style/hint_txt_style"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:drawableLeft="@drawable/shape_small_black_oval"
-        android:drawablePadding="5dp"
-        app:isAliganCenter="false"
-        android:text="小绵羊不会将你提供的微信号泄露或进行非法违规操作。" />
-    <com.hedan.textdrawablelibrary.TextViewDrawable
-        style="@style/hint_txt_style"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:drawableLeft="@drawable/shape_small_black_oval"
-        android:drawablePadding="5dp"
-        app:isAliganCenter="false"
-        android:text="挂机过程中微信号有可能被微信封禁,请完成微信号的解封后点击“已解封,继续赚钱”,小绵羊会继续帮你干活赚钱。" />
+<!--    <com.hedan.textdrawablelibrary.TextViewDrawable-->
+<!--        style="@style/hint_txt_style"-->
+<!--        android:layout_width="wrap_content"-->
+<!--        android:layout_height="wrap_content"-->
+<!--        android:drawableLeft="@drawable/shape_small_black_oval"-->
+<!--        android:drawablePadding="5dp"-->
+<!--        app:isAliganCenter="false"-->
+<!--        android:text="@string/tip_wechat_support_for_auto_task" />-->
+<!--    <com.hedan.textdrawablelibrary.TextViewDrawable-->
+<!--        style="@style/hint_txt_style"-->
+<!--        android:layout_width="wrap_content"-->
+<!--        android:layout_height="wrap_content"-->
+<!--        android:drawableLeft="@drawable/shape_small_black_oval"-->
+<!--        android:drawablePadding="5dp"-->
+<!--        app:isAliganCenter="false"-->
+<!--        android:text="挂机收益每日晚上12点结算。" />-->
+<!--    <com.hedan.textdrawablelibrary.TextViewDrawable-->
+<!--        style="@style/hint_txt_style"-->
+<!--        android:layout_width="wrap_content"-->
+<!--        android:layout_height="wrap_content"-->
+<!--        android:drawableLeft="@drawable/shape_small_black_oval"-->
+<!--        android:drawablePadding="5dp"-->
+<!--        app:isAliganCenter="false"-->
+<!--        android:text="小绵羊不会将你提供的微信号泄露或进行非法违规操作。" />-->
+<!--    <com.hedan.textdrawablelibrary.TextViewDrawable-->
+<!--        style="@style/hint_txt_style"-->
+<!--        android:layout_width="wrap_content"-->
+<!--        android:layout_height="wrap_content"-->
+<!--        android:drawableLeft="@drawable/shape_small_black_oval"-->
+<!--        android:drawablePadding="5dp"-->
+<!--        app:isAliganCenter="false"-->
+<!--        android:text="挂机过程中微信号有可能被微信封禁,请完成微信号的解封后点击“已解封,继续赚钱”,小绵羊会继续帮你干活赚钱。" />-->
 </LinearLayout>

+ 2 - 2
gradle.properties

@@ -17,8 +17,8 @@
 # org.gradle.parallel=true
 #android.injected.build.model.only.versioned = 3
 
-VERSION_NAME=3.8.9
-VERSION_CODE=3008009
+VERSION_NAME=3.9.0
+VERSION_CODE=3009000
 ANDROID_COMPILE_SDK_VERSION=30
 ANDROID_MIN_SDK_VERSION=19
 ANDORID_TARGET_SDK_VERSION=28

文件差異過大導致無法顯示
+ 367 - 0
hs_err_pid4340.log


文件差異過大導致無法顯示
+ 6094 - 0
replay_pid4340.log