PERINTAH INI UNIVERSAL DAN BERLAKU SEMUA HH
Sebelumnya ada yang pernah meng-install Android Terminal Emulator? jika sudah, pastinya kita sudah tau bahwa Android Terminal ini adalah aplikasi yang digunakan untuk menggunakan Android shell script, seperti command prompt pada Windows & terminal pada linux... sebelumnya Android device harus di-root & sudah ter-install busybox, karena script yang akan saya posting disini hampir kebanyakan menggunakan busybox & membutuhkan akses root.
Berikut adalah beberapa perintah untuk Android terminal emulator:
Menghitung Aplikasi yang ter-install:
#!/system/bin/shTOTAL=` pm list packages | busybox wc -l `DOWNLOADED=` pm list packages -f | busybox grep -v /system/ | busybox wc -l `SYSTEM=$(($TOTAL - $DOWNLOADED))echo "Total Aplikasi yang ter-install: ${TOTAL}"echo "System Apps: ${SYSTEM}"echo "Downloaded Apps: ${DOWNLOADED}"
Mengecek /sdcard:
#!/system/bin/shif busybox [ -z "$( busybox mount | busybox grep /sdcard )" ]; then echo "sdcard sedang dipakai oleh PC." else echo "sdcard tersedia" fi
Menonaktifkan Boot-Animation:
#!/system/bin/shif busybox [ -e /system/customize/resource/bootanimation.zip ]; thenBOOT_ANI=/system/customize/resource/bootanimation.zipelif busybox [ -e /system/customize/resource/bootanimation.zip ]; thenBOOT_ANI=/system/customize/resource/VZW_bootanimation.zipelif busybox [ -e /data/local/bootanimation.zip ]; thenBOOT_ANI=/data/local/bootanimation.zipelseecho "Gagal untuk menemukan bootanimation.zip"exit 1fiNEW_LOCATION=${BOOT_ANI%.*}.bakbusybox mount -o remount,rw /systembusybox mv -f $BOOT_ANI $NEW_LOCATIONbusybox mount -o remount,ro /systemecho "Boot-Animation telah dimatikan"
Mengaktifkan Boot-Animation:
#!/system/bin/shif busybox [ -e /system/customize/resource/bootanimation.bak ]; thenBOOT_ANI=/system/customize/resource/bootanimation.bakelif busybox [ -e /system/customize/resource/bootanimation.bak ]; thenBOOT_ANI=/system/customize/resource/VZW_bootanimation.bakelif busybox [ -e /data/local/bootanimation.bak ]; thenBOOT_ANI=/data/local/bootanimation.bakelseecho "Gagal untuk menemukan bootanimation.zip"exit 1fiNEW_LOCATION=${BOOT_ANI%.*}.zipbusybox mount -o remount,rw /systembusybox mv -f $BOOT_ANI $NEW_LOCATIONbusybox mount -o remount,ro /systemecho "Boot-Animation telah diaktifkan"
Menonaktifkan suara kamera:
#!/system/bin/sh
CAMERA_CLICK=/system/media/audio/ui/camera_click.oggVIDEO_RECORD=/system/media/audio/ui/VideoRecord.oggbusybox mount -o remount,rw /systembusybox find $CAMERA_CLICK $VIDEO_RECORD -exec busybox mv -f {} {}.bak ';'echo "Disabled camera sounds"busybox mount -o remount,ro /system
Mengaktifkan kembali suara kamera:
#!/system/bin/shCAMERA_CLICK=/system/media/audio/ui/camera_click.ogg.bakVIDEO_RECORD=/system/media/audio/ui/VideoRecord.ogg.bakif busybox [ -e $CAMERA_CLICK ]; thenbusybox mv $CAMERA_CLICK ${CAMERA_CLICK%.*}fiif busybox [ -e $VIDEO_RECORD ]; thenbusybox mv $VIDEO_RECORD ${VIDEO_RECORD%.*}fiecho "Suara kamera telah diaktifkan kembali"
Mematikan Compcache:
#!/system/bin/sh
DEV=/dev/block/ramzswap0MODULE=/system/lib/modules/ramzswap.koif busybox [ ! -e $MODULE -o -z "$( busybox which rzscontrol )" ]; thenecho "Your system does not support compcache."exitfibusybox swapoff $DEV >/dev/null 2>&1busybox rmmod ramzswap.ko >/dev/null 2>&1echo "Compressed cache talah dimatikan"
Mengaktifkan Compcache:
#!/system/bin/shDEV=/dev/block/ramzswap0MODULE=/system/lib/modules/ramzswap.koif busybox [ ! -e $MODULE -o -z "$( busybox which rzscontrol )" ]; thenecho "Your system does not support compcache."exitfibusybox echo 3 > /proc/sys/vm/drop_cachesbusybox insmod $MODULES_DIR/$MODULErzscontrol $DEV --initbusybox swapon $DEVecho "Compressed cache telah diaktifkan"
Mempercepat file system:
#!/system/bin/shbusybox mount -o remount,noatime,barrier=0,nobh /systembusybox mount -o remount,noatime,barrier=0,nobh /databusybox mount -o remount,noatime,barrier=0,nobh /cache
Fix Permission:
#!/system/bin/shSTART=` busybox date +%s `PKGLINES=`LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/system/lib pm list packages -f | busybox cut -d ':' -f2 `TOTAL=` echo $PKGLINES | busybox wc -w `CURRENT=0echoecho "Fixing permissions..."echobusybox mount -o remount,rw /systemfor pkgline in ${PKGLINES}; doPKGNAME=` echo $pkgline | busybox cut -d '=' -f2 `CODEPATH=` echo $pkgline | busybox cut -d '=' -f1 `DATAPATH=/data/data/$PKGNAMEPKGUID=` busybox grep $CODEPATH /data/system/packages.xml |busybox sed 's%.*serId="\(.*\)".*%\1%' | busybox cut -d '"' -f1 `CURRENT=$(($CURRENT+1))echo "(${CURRENT} of ${TOTAL}) ${PKGNAME}..."if busybox [ -e $CODEPATH ]; thenAPPDIR=` busybox dirname $CODEPATH `if busybox [ $APPDIR = /system/app ]; thenbusybox chown 0 $CODEPATHbusybox chown :0 $CODEPATHbusybox chmod 644 $CODEPATHelif busybox [ $APPDIR = /data/app ]; thenbusybox chown 1000 $CODEPATHbusybox chown :1000 $CODEPATHbusybox chmod 644 $CODEPATHelif busybox [ $APPDIR = /data/app-private ]; thenbusybox chown 1000 $CODEPATHbusybox chown :$PKGUID $CODEPATHbusybox chmod 640 $CODEPATHfiif busybox [ -d $DATAPATH ]; thenbusybox chmod 755 $DATAPATHbusybox chown $PKGUID $DATAPATHbusybox chown :$PKGUID $DATAPATHDIRS=` busybox find $DATAPATH -mindepth 1 -type d `for file in $DIRS; doPERM=755NEWUID=$PKGUIDNEWGID=$PKGUIDFNAME=` busybox basename $file `case $FNAME inlib)busybox chmod 755 $fileNEWUID=1000NEWGID=1000PERM=755;;shared_prefs)busybox chmod 771 $filePERM=660 ;;databases)busybox chmod 771 $filePERM=660;;cache)busybox chmod 771 $filePERM=600;;*)busybox chmod 771 $filePERM=771;;esacbusybox chown $NEWUID $filebusybox chown :$NEWGID $filebusybox find $file -type f -maxdepth 1 ! -perm $PERM -exec busybox chmod $PERM {} ';'busybox find $file -type f -maxdepth 1 ! -user $NEWUID -exec busybox chown $NEWUID {} ';'busybox find $file -type f -maxdepth 1 ! -group $NEWGID -exec busybox chown :$NEWGID {} ';'donefifidonebusybox mount -o remount,ro /systemsyncSTOP=` busybox date +%s `RUNTIME=` busybox expr $STOP - $START`HOURS=` busybox expr $RUNTIME / 3600`REMAINDER=` busybox expr $RUNTIME % 3600`MINS=` busybox expr $REMAINDER / 60`SECS=` busybox expr $REMAINDER % 60`RUNTIME=`busybox printf "%02d:%02d:%02d\n" "$HOURS" "$MINS" "$SECS"`echoechoecho "Fix permissions complete! Runtime: ${RUNTIME}"echo
Mount /system:
#!/system/bin/sh
WHAT_MOUNT=` mount | busybox grep system | busybox awk '{print $4}' | busybox cut -d ',' -f1 `if busybox [ "${WHAT_MOUNT}" = "rw" ]; thenecho "System is mounted read/write"elif busybox [ "${WHAT_MOUNT}" = "ro" ]; thenecho "System is mounted read-only"elseecho "Error getting info"fi
Hot Reboot:
#!/system/bin/shbusybox killall system_server
Melihat Informasi CPU:
cat /proc/cpuinfo
Wipe Battery Stats:
#!/system/bin/sh
busybox rm /data/system/batterystats.bin
echo "Battery Stats dibersihkan"
Menghapus Data Cache:
#!/system/bin/shbusybox find /data/data -type d -iname "*cache*" -exec busybox rm -f {}/* ';' -exec echo "Cleared {}" ';'
Zipalign Apks:
#!/system/bin/shif busybox [ -z "$( busybox which zipalign )" ]; thenecho "Error: zipalign binary tidak ditemukan"exit 1fiSTART=` busybox date +%s `CODEPATHS=` pm list packages -f | busybox cut -d ':' -f2 | busybox cut -d '=' -f1 `TOTAL=` echo $CODEPATHS | busybox wc -w `CURRENT=0echoecho "Zipaligning..."echobusybox mount -o remount,rw /systemfor codepath in ${CODEPATHS}; doCURRENT=$(($CURRENT+1))echo -n "(${CURRENT} of ${TOTAL}) "if busybox [ -e $codepath ]; thenzipalign -c 4 $codepathZIP_CHECK=$?case $ZIP_CHECK in1)if zipalign -f 4 $codepath /data/local/pkg.apk; thenbusybox cp -f /data/local/pkg.apk $codepathbusybox rm -f /data/local/pkg.apkecho "[!] zipaligned ${codepath}"fi;;*)echo "[X] $codepath sudah zipaligned";;esacfidonebusybox mount -o remount,ro /systemsyncSTOP=` busybox date +%s `RUNTIME=` busybox expr $STOP - $START`HOURS=` busybox expr $RUNTIME / 3600`REMAINDER=` busybox expr $RUNTIME % 3600`MINS=` busybox expr $REMAINDER / 60`SECS=` busybox expr $REMAINDER % 60`RUNTIME=` busybox printf "%02d:%02d:%02d\n" "$HOURS" "$MINS" "$SECS" `echoecho "Zipalign selesai! Runtime: ${RUNTIME}"echo
Itulah daftar perintah yang sudah saya test, Pastikan sebelum mengeksekusi perintah pastikan jalankan perintah su terlebih dahulu.THANKS
Tidak ada komentar:
Posting Komentar