Skip to content

Instantly share code, notes, and snippets.

@shakalaca
Last active December 29, 2016 01:48
Show Gist options
  • Save shakalaca/bde818d1fbc4b1343d1d44d954c9ddd5 to your computer and use it in GitHub Desktop.
Save shakalaca/bde818d1fbc4b1343d1d44d954c9ddd5 to your computer and use it in GitHub Desktop.
System app installation under systemless root
#!/system/bin/sh
is_mounted() {
if [ ! -z "$2" ]; then
cat /proc/mounts | grep $1 | grep $2, >/dev/null
else
cat /proc/mounts | grep $1 >/dev/null
fi
return $?
}
if [ -d /system/vendor/app ]; then
mount -o bind /su/app /system/vendor/app
else
if ( ! is_mounted /oem ); then
mount -o rw,remount /
fi
if [ ! -d /oem ]; then
mkdir /oem
chmod 755 /oem
fi
if [ ! -d /oem/app ]; then
mkdir /oem/app
fi
chmod 755 /oem/app
chcon u:object_r:system_file:s0 /oem/app
mount -o bind /su/app /oem/app
fi
* Put 01mount_vendor_app under /su/su.d/
* chmod 755 /su/su.d/01mount_vendor_app
* mkdir /su/app; chmod 755 /su/app
* Put your apk to /su/app/<name>/<name.apk>
* find /su/app/<name> -type d -exec chmod 755 {} \;
* find /su/app/<name> -type f -exec chmod 644 {} \;
* Reboot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment