Last active
December 19, 2015 12:48
-
-
Save 173210/5957127 to your computer and use it in GitHub Desktop.
Install su with smali
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
invoke-static {}, Ljava/lang/Runtime;->getRuntime()Ljava/lang/Runtime; | |
move-result-object v0 | |
const-string v1, "mount -o rw,remount -t ext4 /system" | |
invoke-virtual {v0, v1}, Ljava/lang/Runtime;->exec(Ljava/lang/String;)Ljava/lang/Process; | |
move-result-object v1 | |
invoke-virtual {v1}, Ljava/lang/Process;->waitFor()I | |
const-string v1, "rm -f /system/xbin/su" | |
invoke-virtual {v0, v1}, Ljava/lang/Runtime;->exec(Ljava/lang/String;)Ljava/lang/Process; | |
move-result-object v1 | |
invoke-virtual {v1}, Ljava/lang/Process;->waitFor()I | |
const-string v1, "busybox cp -f /mnt/sdcard/su /system/xbin" | |
invoke-virtual {v0, v1}, Ljava/lang/Runtime;->exec(Ljava/lang/String;)Ljava/lang/Process; | |
move-result-object v1 | |
invoke-virtual {v1}, Ljava/lang/Process;->waitFor()I | |
const-string v1, "chmod -f 755 /system/xbin/su" | |
invoke-virtual {v0, v1}, Ljava/lang/Runtime;->exec(Ljava/lang/String;)Ljava/lang/Process; | |
move-result-object v1 | |
invoke-virtual {v1}, Ljava/lang/Process;->waitFor()I | |
const-string v1, "chmod -f u+s /system/xbin/su" | |
invoke-virtual {v0, v1}, Ljava/lang/Runtime;->exec(Ljava/lang/String;)Ljava/lang/Process; | |
move-result-object v1 | |
invoke-virtual {v1}, Ljava/lang/Process;->waitFor()I | |
const-string v1, "chmod -f g+s /system/xbin/su" | |
invoke-virtual {v0, v1}, Ljava/lang/Runtime;->exec(Ljava/lang/String;)Ljava/lang/Process; | |
move-result-object v1 | |
invoke-virtual {v1}, Ljava/lang/Process;->waitFor()I |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment