Hi i have the following problem in my android studio
Root.cpp:
int getRoot(char *argv[])
{
char ml[64];
sprintf(ml,"su -c %s",*argv);
if (getuid() != 0)
{
system(ml);
exit(1);//Exit the process without root
}
}
Root.h:
int getRoot(char *argv[]);
and now how can i call this method in my native-lib.cpp?
i tried with
extern "C" JNIEXPORT jstring JNICALL
Java_com_example_root_MainActivity_stringFromJNI(
JNIEnv *env,
jobject /* this */) {
getRoot(char *argv[]);
}
but i get error in *argv[]
can someone help me please