Skip to content

Instantly share code, notes, and snippets.

@1dotd4
Last active November 22, 2017 10:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 1dotd4/b8e2692cc810c8ca015a3d8b60db67eb to your computer and use it in GitHub Desktop.
Save 1dotd4/b8e2692cc810c8ca015a3d8b60db67eb to your computer and use it in GitHub Desktop.
OnePlus Root Automation w/ Raspberry Pi Zero

Download the app here: mediafire (4.3MB)

Script installation

add join_fsoc.sh to crontab with crontab -e and remember to add execute permissions: chmod a+x join_fsoc.sh

@reboot /home/pi/join_fsoc.sh

ADB installation

Package that I have installed.

adb
android-libadb
android-libadb-dev
android-tools-adb

or follow
https://forum.xda-developers.com/showthread.php?t=1924492
or
https://forum.xda-developers.com/android/software-hacking/raspberry-pi-android-tools-binaries-adb-t2857475

Remember to put them into /home/pi/bin or change the path in the join_fsock.sh script.

/home/pi/bin/adb shell sh /storage/emulated/0/Android/data/com.mordred.angelaroot/files/angelaroot_starter_step1.sh
sleep 3
/home/pi/bin/adb shell sh /storage/emulated/0/Android/data/com.mordred.angelaroot/files/angelaroot_starter_step2.sh
exit 0
#!/bin/sh
# adb configuration script
PATH=$PATH:/bin:/sbin:/usr/sbin
ANDROID_HOME=~/.android
ANDROID_CONFIG=~/.android/adb_usb.ini
CUST_VID="0x2a70" # Hello OnePlus :D
if [ -e $ANDROID_HOME ] ; then
echo "android home is exist!"
else
echo "creat android home!"
mkdir $ANDROID_HOME
fi
grep $CUST_VID $ANDROID_CONFIG 2>/dev/null
if [ $? -eq 0 ] ; then
echo VID $CUST_VID is already configured..
echo "adb should be OK!"
exit 0
else
echo config adb ...
echo $CUST_VID >> $ANDROID_CONFIG
fi
adb kill-server
if [ $? -eq 0 ] ; then
echo "OK! You can use adb now!"
exit 0
else
echo "try sudo exec adb.."
sudo adb kill-server
if [ $? -eq 0 ] ; then
echo "OK! You can use adb now!"
exit 0
else
echo "Please do command \"adb kill-server\""
fi
fi
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment