Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 579a915

Browse files
committed
install scripts
1 parent e3d06ec commit 579a915

File tree

3 files changed

+124
-0
lines changed

3 files changed

+124
-0
lines changed

‎install/install.sh‎

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/bin/bash
2+
3+
wfr() {
4+
adb wait-for-recovery
5+
}
6+
7+
wfs() {
8+
adb wait-for-sideload
9+
}
10+
11+
BACKUP_PATH=backup_original_partitions
12+
BUILD_PATH=../out
13+
14+
ZIP_INSTALL=zip_reverse_shell_v2.zip
15+
16+
pull_backups=1
17+
18+
if [ -d "$BACKUP_PATH" ]; then
19+
echo "The 'backup_original_partitions' directory is already present."
20+
read -p "Overwrite? (y/N) " answer
21+
if [ "$answer" != "y" ] && [ "$answer" != "Y" ] && [ "$answer" != "yes" ]; then
22+
echo "Will not pull backups"
23+
pull_backups=0
24+
fi
25+
fi
26+
27+
adb reboot bootloader
28+
fastboot boot twrp
29+
30+
# Install
31+
wfr && adb shell twrp sideload
32+
wfs && adb sideload "$BUILD_PATH/$ZIP_INSTALL"
33+
34+
if [[ $pull_backups == 1 ]]; then
35+
adb pull "/tmp/backup_original_partitions" "$BACKUP_PATH" && echo "Backups pulled to '$BACKUP_PATH'" && adb reboot
36+
else
37+
adb reboot
38+
fi

‎install/reinstall.sh‎

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#!/bin/bash
2+
3+
wfr() {
4+
adb wait-for-recovery
5+
}
6+
7+
wfs() {
8+
adb wait-for-sideload
9+
}
10+
11+
BACKUP_PATH=backup_original_partitions
12+
BUILD_PATH=../out
13+
14+
ZIP_INSTALL=zip_reverse_shell_v2.zip
15+
ZIP_UNINSTALL=zip_reverse_shell_uninstall.zip
16+
17+
backups_present=1
18+
19+
if [ ! -d "$BACKUP_PATH" ]; then
20+
backups_present=0
21+
echo "The 'backup_original_partitions' directory is missing."
22+
echo "You should continue ONLY if your device has stock boot image!"
23+
read -p "Continue? (y/N) " answer
24+
if [ "$answer" != "y" ] && [ "$answer" != "Y" ] && [ "$answer" != "yes" ]; then
25+
echo "Aborting installation."
26+
exit 1
27+
fi
28+
fi
29+
30+
adb reboot bootloader
31+
fastboot boot twrp
32+
33+
# Uninstall
34+
if [[ $backups_present == 1 ]]; then
35+
wfr && adb push "$BACKUP_PATH" /tmp/backup_original_partitions
36+
sleep 1
37+
wfr && adb shell twrp sideload
38+
sleep 1
39+
wfs && adb sideload "$BUILD_PATH/$ZIP_UNINSTALL"
40+
if [ $? -ne 0 ]; then
41+
echo "Uninstall failed. Something is wrong?"
42+
echo "Restart the script if there are no problems"
43+
exit 1
44+
fi
45+
fi
46+
47+
# Install
48+
wfr && adb shell twrp sideload
49+
wfs && adb sideload $BUILD_PATH/$ZIP_INSTALL
50+
51+
wfr && adb reboot

‎install/uninstall.sh‎

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/bin/bash
2+
3+
wfr() {
4+
adb wait-for-recovery
5+
}
6+
7+
wfs() {
8+
adb wait-for-sideload
9+
}
10+
11+
BACKUP_PATH=backup_original_partitions
12+
BUILD_PATH=../out
13+
14+
ZIP_UNINSTALL=zip_reverse_shell_uninstall.zip
15+
16+
if [ ! -d "$BACKUP_PATH" ]; then
17+
echo "The '$BACKUP_PATH' directory is missing."
18+
echo "Cannot uninstall without backups."
19+
exit 1
20+
fi
21+
22+
adb reboot bootloader
23+
fastboot boot twrp
24+
25+
# Uninstall
26+
wfr && adb push "$BACKUP_PATH" /tmp/backup_original_partitions
27+
wfr && adb shell twrp sideload
28+
wfs && adb sideload "$BUILD_PATH/$ZIP_UNINSTALL"
29+
if [ $? -ne 0 ]; then
30+
echo "Uninstall failed. Something is wrong?"
31+
echo "Ignore if there are no problems"
32+
exit 1
33+
fi
34+
35+
wfr && adb reboot

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /