THIS IS A TEST INSTANCE ONLY! REPOSITORIES CAN BE DELETED AT ANY TIME!

Browse Source

Initial version

master
Josef Vybíhal 3 years ago
commit
5e47664d34
7 changed files with 128 additions and 0 deletions
  1. +13
    -0
      LICENSE
  2. +24
    -0
      README.md
  3. +1
    -0
      root-cloak-stupid/.gitignore
  4. BIN
      root-cloak-stupid/META-INF/com/google/android/update-binary
  5. +18
    -0
      root-cloak-stupid/META-INF/com/google/android/updater-script
  6. +41
    -0
      root-cloak-stupid/system/addon.d/99-rcs.sh
  7. +31
    -0
      root-cloak-stupid/system/bin/rcs

+ 13
- 0
LICENSE View File

@@ -0,0 +1,13 @@
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004

Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>

Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.

DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

0. You just DO WHAT THE FUCK YOU WANT TO.

+ 24
- 0
README.md View File

@@ -0,0 +1,24 @@
# Root Cloak Stupid

### Disclaimer
You should not use this, really. If you do, you are on your own, I am not responsible on any damage you do on your device(s) and I also do not offer support. Reporting issues is probably waste of time.


### Info
This is very stupid method, how to temporarily cloak root (su binary) in CyanogenMOD 13 (C13). I had an app that checks, if there is file called `/system/bin/su` or `/system/xbin/su` and forced to quit if it does. I wanted to use that app, and also keep my device rooted. So I worked around it with this little stupid hack (I am not a fan of Xposed and its modules).

I have tested this for 5 minutes on Oneplus 3. Not compatible with SuperSU.

### Install
Just create flashable .zip of content of root-cloak-stupid folder and flash it via TWRP.

### Usage
- have root enabled in your CyanogenMOD (developer options)
- in terminal/shell type `rcs`
- hint: you can use something like [$cripter](https://play.google.com/store/apps/details?id=sites.mjwhitta.scripter) and run script just by tapping

### Uninstall
Go figure ;o)

### Problems
Do NOT reboot while root "cloaked" by this script.

+ 1
- 0
root-cloak-stupid/.gitignore View File

@@ -0,0 +1 @@
*.zip

BIN
root-cloak-stupid/META-INF/com/google/android/update-binary View File


+ 18
- 0
root-cloak-stupid/META-INF/com/google/android/updater-script View File

@@ -0,0 +1,18 @@
ui_print("----------------------------------------");
ui_print(" Root cloak stupid ");
ui_print("----------------------------------------");

ifelse(is_mounted("/system"), unmount("/system"));
run_program("/sbin/busybox", "mount", "/system");

ui_print("-> Extracting Files.....");
delete_recursive("/system/addon.d/99-rcs.sh");
delete_recursive("/system/bin/rcs");

ui_print("-> Setting Permissions.....");
package_extract_dir("system", "/system");
set_perm_recursive(0, 0, 0755, 0755, "/system/addon.d/99-rcs.sh");
set_perm_recursive(0, 0, 0755, 0755, "/system/bin/rcs");

ui_print("-> Done.");
run_program("/sbin/busybox", "umount", "/system");

+ 41
- 0
root-cloak-stupid/system/addon.d/99-rcs.sh View File

@@ -0,0 +1,41 @@
#!/sbin/sh
#
# /system/addon.d/99-rcs.sh
#
# Execute

. /tmp/backuptool.functions

list_files() {
cat << EOF
addon.d/99-rcs.sh
bin/rcs
EOF
}

case "$1" in
backup)
list_files | while read FILE DUMMY; do
backup_file $S/$FILE
done
;;
restore)
list_files | while read FILE REPLACEMENT; do
R=""
[ -n "$REPLACEMENT" ] && R="$S/$REPLACEMENT"
[ -f "$C/$S/$FILE" ] && restore_file $S/$FILE $R
done
;;
pre-backup)
# Stub
;;
post-backup)
# Stub
;;
pre-restore)
# Stub
;;
post-restore)
# Stub
;;
esac

+ 31
- 0
root-cloak-stupid/system/bin/rcs View File

@@ -0,0 +1,31 @@
#!/system/bin/sh
SUBIN=/system/xbin/su
myRoot=$(which su)

if [ -z ${myRoot} ]; then
# root is disabled, enable it
SUBIN=/system/xbin/su.disabled
#check binaries
[ -f /system/bin/su.disabled ] || [ -f /system/xbin/su.disabled ] || exit 1

# remount system for rw
${SUBIN} -c "mount -o rw,remount /system" || exit 1

# switch back to root
${SUBIN} -c "mv /system/bin/su.disabled /system/bin/su" || exit 1
${SUBIN} -c "mv /system/xbin/su.disabled /system/xbin/su" || exit 1

echo ":: ROOT ENABLED SUCESSFULLY" #oh... well... maybe...

else
# disable root
SUBIN=/system/xbin/su
[ -f /system/bin/su ] || [ -f /system/xbin/su ] || exit 1
${SUBIN} -c "mount -o rw,remount /system" || exit 1

${SUBIN} -c "mv /system/bin/su /system/bin/su.disabled" || exit 1
${SUBIN} -c "mv /system/xbin/su /system/xbin/su.disabled" || exit 1

echo ":: ROOT DISABLED SUCESSFULLY" #oh... well... maybe...
fi


Loading…
Cancel
Save