Skip to content

Commit

Permalink
Enhanced compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Howard20181 committed Jul 13, 2024
1 parent 2726a69 commit 2d2c790
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
17 changes: 13 additions & 4 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -484,8 +484,16 @@ fi

if [ "$ROOT_SOL" = "magisk" ]; then
echo "Integrating Magisk"
"$WORK_DIR/magisk/magiskboot" compress=xz "$WORK_DIR/magisk/magisk64" "$WORK_DIR/magisk/magisk64.xz"
"$WORK_DIR/magisk/magiskboot" compress=xz "$WORK_DIR/magisk/magisk32" "$WORK_DIR/magisk/magisk32.xz"
SKIP="#"
SINGLEABI="#"
if [ -f "$WORK_DIR/magisk/magisk64" ]; then
"$WORK_DIR/magisk/magiskboot" compress=xz "$WORK_DIR/magisk/magisk64" "$WORK_DIR/magisk/magisk64.xz"
"$WORK_DIR/magisk/magiskboot" compress=xz "$WORK_DIR/magisk/magisk32" "$WORK_DIR/magisk/magisk32.xz"
unset SKIP
else
"$WORK_DIR/magisk/magiskboot" compress=xz "$WORK_DIR/magisk/magisk" "$WORK_DIR/magisk/magisk.xz"
unset SINGLEABI
fi
"$WORK_DIR/magisk/magiskboot" compress=xz "$MAGISK_PATH" "$WORK_DIR/magisk/stub.xz"
"$WORK_DIR/magisk/magiskboot" cpio "$WORK_DIR/wsa/$ARCH/Tools/initrd.img" \
"mv /init /wsainit" \
Expand All @@ -494,8 +502,9 @@ if [ "$ROOT_SOL" = "magisk" ]; then
"add 0750 /magiskinit $WORK_DIR/magisk/magiskinit" \
"mkdir 0750 overlay.d" \
"mkdir 0750 overlay.d/sbin" \
"add 0644 overlay.d/sbin/magisk64.xz $WORK_DIR/magisk/magisk64.xz" \
"add 0644 overlay.d/sbin/magisk32.xz $WORK_DIR/magisk/magisk32.xz" \
"$SKIP add 0644 overlay.d/sbin/magisk64.xz $WORK_DIR/magisk/magisk64.xz" \
"$SKIP add 0644 overlay.d/sbin/magisk32.xz $WORK_DIR/magisk/magisk32.xz" \
"$SINGLEABI add 0644 overlay.d/sbin/magisk.xz $WORK_DIR/magisk/magisk.xz" \
"add 0644 overlay.d/sbin/stub.xz $WORK_DIR/magisk/stub.xz" \
"mkdir 000 .backup" \
"add 000 overlay.d/init.lsp.magisk.rc init.lsp.magisk.rc" \
Expand Down
7 changes: 5 additions & 2 deletions scripts/extractMagisk.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,10 @@ def extract_as(zip, name, as_name, dir):
env.MAGISK_VERSION_CODE = versionCode
with open(os.environ['WSA_WORK_ENV'], 'w') as environ_file:
environ_file.write(str(env))
extract_as(zip, f"lib/{ abi_map[arch][0] }/libmagisk64.so", "magisk64", "magisk")
extract_as(zip, f"lib/{ abi_map[arch][1] }/libmagisk32.so", "magisk32", "magisk")
if f"lib/{ abi_map[arch][0] }/libmagisk64.so" in zip.namelist():
extract_as(zip, f"lib/{ abi_map[arch][0] }/libmagisk64.so", "magisk64", "magisk")
extract_as(zip, f"lib/{ abi_map[arch][1] }/libmagisk32.so", "magisk32", "magisk")
else:
extract_as(zip, f"lib/{ abi_map[arch][0] }/libmagisk.so", "magisk", "magisk")
extract_as(zip, f"lib/{ abi_map[arch][0] }/libmagiskinit.so", "magiskinit", "magisk")
extract_as(zip, f"lib/{ abi_map[host_abi][0] }/libmagiskboot.so", "magiskboot", "magisk")

0 comments on commit 2d2c790

Please sign in to comment.