Compare commits

..

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

  1. 4
      Dockerfile
  2. 4
      README.md
  3. 18
      reinstall-magisk-on-lineageos

4
Dockerfile

@ -1,10 +1,10 @@
FROM python:3.9.15-slim-buster
FROM python:3.9.15-buster
RUN apt-get update
RUN apt-get install -y \
android-tools-adb \
android-tools-fastboot
RUN pip3 install protobuf -q
RUN pip3 install protobuf
COPY . /magisk
WORKDIR /magisk
CMD bash reinstall-magisk-on-lineageos

4
README.md

@ -25,9 +25,9 @@ Steps:
1. Build <br>
```docker build -t magiskupdate .```
2. Run <br>
```docker run --privileged --env ADB_DEVICE=<PUT YOUR ADB ADDR HERE> magiskupdate``` \
```docker run --env ADB_DEVICE=<PUT YOUR ADB ADDR HERE> magiskupdate``` \
or, if you're lazy do:
```docker run --privileged magiskupdate```
```docker run magiskupdate```
## Bash

18
reinstall-magisk-on-lineageos

@ -46,14 +46,11 @@ get_build_url() {
}
check_exists_latest_lineageos_build() {
if [[ -f /tmp/lineageos.zip ]]; then
# The --location lets curl follow the redirection.
print_message "$(get_build_url)?sha256"
curl --location "$(get_build_url)?sha256" --output /tmp/lineageos.sha256
hash1=$( awk '{print $1}' /tmp/lineageos.sha256 )
hash2=$( sha256sum /tmp/lineageos.zip | awk '{print $1}' )
[[ -n $hash1 && -n $hash2 && $hash1 == $hash2 ]]
fi
# The --location lets curl follow the redirection.
curl --location "$(get_build_url)?sha256" --output /tmp/lineageos.sha256
hash1=$( awk '{print $1}' lineageos.sha256 )
hash2=$( sha256sum lineageos.zip | awk '{print $1}' )
[[ "$hash1" =~ "$hash2" ]]
return
}
@ -178,11 +175,10 @@ main() {
is_rooted_debugging_enabled
print_message "Checking on phone if Magisk is installed"
check_magisk_app
print_message "Checking if build archive already exists"
if check_exists_latest_lineageos_build; then
print_message "Build archive found, skipping download"
print_message "Build archive already exists, skipping download"
else
print_message "Build archive not found or hash mismatch, downloading from $(get_build_url)"
print_message "Downloading build archive from $(get_build_url)"
download_latest_lineageos_build
fi
print_message "Extracting 'boot.img' from build archive in /tmp/boot.img"

Loading…
Cancel
Save