ksud: Add userspace cli to load module

This commit is contained in:
tiann
2023-01-04 14:41:55 +08:00
parent 3f9b1cb74b
commit 35aae8b0eb
13 changed files with 1554 additions and 0 deletions

2
userspace/su/.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
/obj
/libs

View File

@@ -0,0 +1,7 @@
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := su
LOCAL_SRC_FILES := su.c
include $(BUILD_EXECUTABLE)

View File

@@ -0,0 +1,3 @@
APP_ABI := arm64-v8a x86_64
APP_PLATFORM := android-24
APP_STL := none

10
userspace/su/jni/su.c Normal file
View File

@@ -0,0 +1,10 @@
#include <unistd.h>
#include <stdlib.h>
#include <sys/prctl.h>
int main(){
int32_t result = 0;
prctl(0xdeadbeef, 0, 0, 0, &result);
system("/system/bin/sh");
return 0;
}