Auto download zipsigner

gf-arm64
ShaneTheAwesome 4 years ago
parent c57d6e840e
commit 75433e78a7

@ -45,12 +45,13 @@ The things included in the AuroraServices Edition zip are:
- An addon.d file to backup/restore everything on a rom flash
### How do I build these packs myself?
First, get the AOSP zipsigner or TopJohnWu's rewrite of it and place it as zipsigner.jar in this repo's parent directory.
cd to this directory and run:
```
> ./update.sh
```
To download all the assets to resdl directory.
NOTE: This will download a zipsigner.jar (topjohnwu's rewrite of the AOSP version) into resdl/util, if the file does not exist already. The source can be found in the Magisk repo, and prebuilt binaries in attachments [here](https://forum.xda-developers.com/showpost.php?p=56621542)
```
> ./build.sh all
```

@ -8,7 +8,7 @@ resdir="$workdir/res";
resdldir="$workdir/resdl";
tmpdir="$workdir/tmp";
reldir="$workdir/releases";
zipsigner="$(dirname "$workdir")/zipsigner.jar";
zipsigner="$resdldir/util/zipsigner.jar";
buildtime="$(date -u +%Y%m%d%H%M%S)";
echo " ";

@ -70,6 +70,7 @@ pre_update_actions() {
post_update_actions() {
unzipmaps;
getzipsigner;
updatedelta;
return 0;
@ -83,13 +84,29 @@ unzipmaps() {
echo " ";
echo " - Unzipping maps JAR...";
rm -rf "$resdldir/$mapsfile.jar";
unzip -oq -j "$resdldir/$mapsfile.zip" "$mapsfile.jar" -d "$resdldir/$(dirname "$mapsfile")/";
rm -rf "$resdldir/$mapsfile.zip";
}
getzipsigner() {
zipsigner="util/zipsigner.jar";
zipsignerurl="https://forum.xda-developers.com/attachment.php?attachmentid=4586999";
[ -f "$resdldir/$zipsigner" ] && return 0;
echo " ";
echo " - Downloading zipsigner JAR...";
wget -q --show-progress "$zipsignerurl" -O "$tmpdir/zipsigner.jar" || { echo "ERROR: zipsigner.jar failed to download" >&2; return 1; }
mkdir -p "$resdldir/$(dirname "$zipsigner")";
mv -f "$tmpdir/zipsigner.jar" "$resdldir/$zipsigner";
}
updatedelta() {
echo " ";

@ -139,7 +139,7 @@ sizecheck() {
for archlib in $libarches; do
if [ "$(echo "$apkunzip" | grep "lib/$archlib/lib.*.so")" ]; then
libsizeb=0;
for entry in $(echo "$apkunzip" | grep "lib/$archlib/lib.*.so" | awk '{ print $1 }'); do
for entry in $(unzip -l "$sizeobject" | grep "lib/$archlib/lib.*.so" | awk '{ print $1 }'); do
libsizeb="$(($libsizeb + $entry))";
done;
libsize="$(($libsizeb / 1024 + 1))";

@ -29,7 +29,7 @@ echo " - Update started at $updatetime";
echo " ";
echo " - Cleaning...";
rm -Rf "$tmpdir";
mkdir -p "$tmpdir" "$tmpdir/repos" "$(dirname "$updatelog")";
@ -57,7 +57,7 @@ $(echo "$stuff_repo" | grep -P "^[ \t]*$(dirname "$repo")[ \t]+" | head -n1)
";
done;
stuff_repo="$(echo "$stuff_repo_new" | sort -u)";
fi;
fi;
# Pre update actions
@ -128,14 +128,14 @@ for object in $(echo "$stuff_download" | awk '{ print $1 }'); do
else
objectserverfile="$(jq -r --arg pkg "$objectpackage" '.packages[$pkg][].apkName' "$tmpdir/repos/$objectrepo.json" | head -n1)";
fi;
[ "$objectserver" ] && [ "$objectserverfile" ] || { echo "ERROR: $object has no URL available" >&2; continue; }
[ "$objectserver" ] && [ "$objectserverfile" ] || { echo "ERROR: $object has no URL available" >&2; continue; }
objecturl="$objectserver/$objectserverfile";
;;
*)
echo "ERROR: Source $source for $object unknown" >&2;
;;
esac;
[ "$objecturl" ] || { echo "ERROR: $object has no URL available" >&2; continue; }
[ "$objecturl" ] || { echo "ERROR: $object has no URL available" >&2; continue; }
objectname="$(basename "$objecturl")";
objectfile="$tmpdir/$objectname";
echo " ---- Downloading $objecturl";
@ -146,7 +146,7 @@ for object in $(echo "$stuff_download" | awk '{ print $1 }'); do
esac;
mkdir -p "$resdldir/$(dirname "$object")";
mv -f "$objectfile" "$resdldir/$object";
[ -f "$resdldir/$object" ] || { echo "ERROR: $object failed to copy" >&2; continue; }
[ -f "$resdldir/$object" ] || { echo "ERROR: $object failed to copy" >&2; continue; }
done;
# Post update actions

Loading…
Cancel
Save