Android_Anti_Debug
Android_Anti_Debug copied to clipboard
ptrace(PTRACE_TRACEME,0 ,0 ,0);这个方案确定好使?依然可以调试呀
JNICALL Java_com_sec_gtoad_antidebug_MainActivity_stringFromPtrace( JNIEnv env, jobject / this */) { int check = ptrace(PTRACE_TRACEME,0 ,0 ,0); LOGI("ret of ptrace : %d",check); std::string hello = "Hello from ptrace"; if(check != 0){ hello = "Debug from ptrace"; } return env->NewStringUTF(hello.c_str()); }
any updates on this? i find in a stackoverflow comment that ptrace command needs root accesss so this code snippet ptrace(PTRACE_TRACEME,0,0,0) , always gonna reurn -1(error) ... is there any other alternatives found?