Browse Source

added check magisk app instead of folder

pull/1/head
Ivo Oliveira Capanema 2 years ago
parent
commit
1235c29233
  1. 22
      reinstall-magisk-on-lineageos

22
reinstall-magisk-on-lineageos

@ -139,8 +139,22 @@ reboot_phone() {
fastboot -s "$PHONE_ADB_SERIAL_NUMBER" reboot fastboot -s "$PHONE_ADB_SERIAL_NUMBER" reboot
} }
check_magisk_folder() { check_magisk_app() {
adb -s "$PHONE_ADB_SERIAL_NUMBER" shell ls /data/adb/magisk/ magisk_package_name="com.topjohnwu.magisk"
magisk_package_name_count=$(adb -s "$PHONE_ADB_SERIAL_NUMBER" shell pm list packages "$magisk_package_name" | wc -l)
if [ "${magisk_package_name_count}" -eq 1 ]
then
print_message " [OK] Magisk app seems to be installed on selected phone"
elif [ "${magisk_package_name_count}" -eq 0 ]
then
print_message " [ERROR] Magisk app seems not installed on selected phone. Exiting."
exit -1
else
print_message " [ERROR] More than one Magisk app entry is present:"
adb -s "$PHONE_ADB_SERIAL_NUMBER" shell pm list packages "$magisk_package_name"
print_message "Exiting."
exit -1
fi
} }
is_rooted_debugging_enabled() { is_rooted_debugging_enabled() {
@ -152,8 +166,8 @@ main() {
check_phone_is_connected check_phone_is_connected
print_message "Checking on phone if rooted debugging is enabled" print_message "Checking on phone if rooted debugging is enabled"
is_rooted_debugging_enabled is_rooted_debugging_enabled
print_message "Checking on phone if Magisk folder is present listing /data/adb/magisk/" print_message "Checking on phone if Magisk is installed"
check_magisk_folder check_magisk_app
print_message "Downloading build archive from $(get_build_url)" print_message "Downloading build archive from $(get_build_url)"
download_latest_lineageos_build download_latest_lineageos_build
print_message "Extracting 'boot.img' from build archive in /tmp/boot.img" print_message "Extracting 'boot.img' from build archive in /tmp/boot.img"

Loading…
Cancel
Save