File tree Expand file tree Collapse file tree 5 files changed +21
-4
lines changed
java/com/github/capntrips/kernelflasher Expand file tree Collapse file tree 5 files changed +21
-4
lines changed Original file line number Diff line number Diff line change 11#! /system/bin/sh
22
33# # setup for testing:
4- unzip -p " $Z " tools* /busybox > $F /busybox ;
4+ unzip -p " $Z " tools* /busybox > $F /busybox_ak ;
55unzip -p " $Z " META-INF/com/google/android/update-binary > $F /update-binary;
66# #
77
8- chmod 755 $F /busybox;
8+ chmod 755 $F /busybox_ak;
9+ $F /busybox_ak > /dev/null 2>&1
10+ if [ $? -eq 0 ]; then
11+ mv $F /busybox $F /busybox_orig
12+ mv $F /busybox_ak $F /busybox
13+ fi
914$F /busybox chmod 755 $F /update-binary;
1015$F /busybox chown root:root $F /busybox $F /update-binary;
1116
@@ -18,6 +23,9 @@ $F/busybox mkdir -p $TMP;
1823$F /busybox mount -t tmpfs -o noatime tmpfs $TMP ;
1924# $F/busybox mount | $F/busybox grep -q " $TMP " || exit 1;
2025
26+ PATTERN=' \$[Bb][Bb] chmod -R 755 tools bin;' ;
27+ sed -i " /$PATTERN /i cp -f \"\$ F/busybox\" \$ AKHOME/tools;" " $F /update-binary" ;
28+
2129# update-binary <RECOVERY_API_VERSION> <OUTFD> <ZIPFILE>
2230AKHOME=$TMP /anykernel $F /busybox ash $F /update-binary 3 1 " $Z " ;
2331RC=$? ;
@@ -26,6 +34,7 @@ $F/busybox umount $TMP;
2634$F /busybox rm -rf $TMP ;
2735$F /busybox mount -o ro,remount -t auto /;
2836$F /busybox rm -f $F /update-binary $F /busybox;
37+ mv $F /busybox_orig $F /busybox
2938
3039# work around libsu not cleanly accepting return or exit as last line
3140safereturn () { return $RC ; }
Original file line number Diff line number Diff line change 11#! /system/bin/sh
22
33# # setup for testing:
4- unzip -p " $Z " tools* /busybox > $F /busybox ;
4+ unzip -p " $Z " tools* /busybox > $F /busybox_ak ;
55unzip -p " $Z " META-INF/com/google/android/update-binary > $F /update-binary;
66# #
77
8- chmod 755 $F /busybox;
8+ chmod 755 $F /busybox_ak;
9+ $F /busybox_ak > /dev/null 2>&1
10+ if [ $? -eq 0 ]; then
11+ mv $F /busybox $F /busybox_orig
12+ mv $F /busybox_ak $F /busybox
13+ fi
914$F /busybox chmod 755 $F /update-binary;
1015$F /busybox chown root:root $F /busybox $F /update-binary;
1116
@@ -20,6 +25,7 @@ $F/busybox mount -t tmpfs -o noatime tmpfs $TMP;
2025
2126PATTERN=' \$[Bb][Bb] chmod -R 755 tools bin;' ;
2227sed -i " /$PATTERN /i cp -f \"\$ F/mkbootfs\" \$ AKHOME/tools;" " $F /update-binary" ;
28+ sed -i " /$PATTERN /i cp -f \"\$ F/busybox\" \$ AKHOME/tools;" " $F /update-binary" ;
2329
2430# update-binary <RECOVERY_API_VERSION> <OUTFD> <ZIPFILE>
2531AKHOME=$TMP /anykernel $F /busybox ash $F /update-binary 3 1 " $Z " ;
@@ -29,6 +35,7 @@ $F/busybox umount $TMP;
2935$F /busybox rm -rf $TMP ;
3036$F /busybox mount -o ro,remount -t auto /;
3137$F /busybox rm -f $F /update-binary $F /busybox;
38+ mv $F /busybox_orig $F /busybox
3239
3340# work around libsu not cleanly accepting return or exit as last line
3441safereturn () { return $RC ; }
Original file line number Diff line number Diff line change @@ -195,6 +195,7 @@ class MainActivity : ComponentActivity() {
195195 copyNativeBinary(" httools_static" ) // v3.2.0
196196 copyNativeBinary(" magiskboot" ) // v29.0
197197 copyNativeBinary(" bootctl" ) // aosp_arm64-img-13613025 android14
198+ copyNativeBinary(" busybox" ) // BusyBox v1.36.1.1
198199 copyAsset(" mkbootfs" )
199200 copyAsset(" ksuinit" )
200201 copyAsset(" flash_ak3.sh" )
You can’t perform that action at this time.
0 commit comments