Compare commits

..

No commits in common. 'b789b9aef8791e3046aa098fff753214d921bc56' and '66c9ae339b6f37f8bef1bc6451b6bae4931705d1' have entirely different histories.

  1. 2
      Dockerfile
  2. 11
      reinstall-magisk-on-lineageos

2
Dockerfile

@ -4,7 +4,7 @@ RUN apt-get update
RUN apt-get install -y \ RUN apt-get install -y \
android-tools-adb \ android-tools-adb \
android-tools-fastboot android-tools-fastboot
RUN pip3 install protobuf RUN pip3 install protobuf -q
COPY . /magisk COPY . /magisk
WORKDIR /magisk WORKDIR /magisk
CMD bash reinstall-magisk-on-lineageos CMD bash reinstall-magisk-on-lineageos

11
reinstall-magisk-on-lineageos

@ -5,10 +5,6 @@ set -e
PHONE_ADB_SERIAL_NUMBER=${ADB_DEVICE} # The adb serial number can be found by running `adb devices`. PHONE_ADB_SERIAL_NUMBER=${ADB_DEVICE} # The adb serial number can be found by running `adb devices`.
if [$PHONE_ADB_SERIAL_NUMBER = '']; then if [$PHONE_ADB_SERIAL_NUMBER = '']; then
PHONE_ADB_SERIAL_NUMBER=$(echo $(adb devices) | sed -rn 's/(^|(.* ))([^ ]*) device(( .*)|$)/\3/; T; p; q') PHONE_ADB_SERIAL_NUMBER=$(echo $(adb devices) | sed -rn 's/(^|(.* ))([^ ]*) device(( .*)|$)/\3/; T; p; q')
if [[ -n $PHONE_ADB_SERIAL_NUMBER ]]
print_message "ERROR: no suitable phone connected"
exit 1
fi
fi fi
print_message() { print_message() {
@ -158,14 +154,15 @@ check_magisk_app() {
magisk_package_name_count=$(adb -s "$PHONE_ADB_SERIAL_NUMBER" shell pm list packages "$magisk_package_name" | wc -l) 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 ] if [ "${magisk_package_name_count}" -eq 1 ]
then then
print_message "Magisk app seems to be installed on selected phone" print_message " [OK] Magisk app seems to be installed on selected phone"
elif [ "${magisk_package_name_count}" -eq 0 ] elif [ "${magisk_package_name_count}" -eq 0 ]
then then
print_message "ERROR: Magisk app seems not installed on selected phone." print_message " [ERROR] Magisk app seems not installed on selected phone. Exiting."
exit -1 exit -1
else else
print_message "ERROR: More than one Magisk app entry is present:" print_message " [ERROR] More than one Magisk app entry is present:"
adb -s "$PHONE_ADB_SERIAL_NUMBER" shell pm list packages "$magisk_package_name" adb -s "$PHONE_ADB_SERIAL_NUMBER" shell pm list packages "$magisk_package_name"
print_message "Exiting."
exit -1 exit -1
fi fi
} }

Loading…
Cancel
Save