Skip to content

Commit 38514ba

Browse files
committed
drop magiskboot
1 parent 18d4391 commit 38514ba

File tree

11 files changed

+33
-27
lines changed

11 files changed

+33
-27
lines changed

.github/workflows/build.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,15 +115,24 @@ jobs:
115115
name: "mappings"
116116
path: "app/build/outputs/mapping/release/"
117117

118-
- name: Upload build artifact
118+
- name: Upload build artifact1
119119
env:
120120
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
121121
if: ${{ env.SIGNING_KEY != '' }}
122122
uses: actions/upload-artifact@v6
123123
with:
124-
name: APatch
124+
name: APatch-Release
125125
path: |
126126
${{ steps.sign_app.outputs.signedReleaseFile }}
127+
128+
- name: Upload build artifact2
129+
env:
130+
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
131+
if: ${{ env.SIGNING_KEY != '' }}
132+
uses: actions/upload-artifact@v6
133+
with:
134+
name: APatch-Debug
135+
path: |
127136
${{ steps.sign_debug_app.outputs.signedReleaseFile }}
128137
129138
- name: Post to channel

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ Furthermore, we need more volunteers to [contribute to the documentation](https:
8080
## Credits
8181

8282
- [KernelPatch](https://github.com/bmax121/KernelPatch/): The core.
83-
- [Magisk](https://github.com/topjohnwu/Magisk): magiskboot and magiskpolicy.
83+
- [Magisk](https://github.com/topjohnwu/Magisk): magiskpolicy.
8484
- [KernelSU](https://github.com/tiann/KernelSU): App UI, and Magisk module like support.
8585

8686
## License
-839 KB
Binary file not shown.

app/src/main/assets/InstallAP.sh

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function failed(){
3636
}
3737

3838
function boot_execute_ab(){
39-
./lib/arm64-v8a/libmagiskboot.so unpack boot.img
39+
./lib/arm64-v8a/libkptools.so unpack boot.img
4040
if [[ ! $(./lib/arm64-v8a/libkptools.so -i ./kernel -f | grep CONFIG_KALLSYMS=y) ]]; then
4141
kernelFlagsErr
4242
fi
@@ -46,14 +46,14 @@ function boot_execute_ab(){
4646
failed
4747
fi
4848
ui_printfile /dev/tmp/install/log
49-
./lib/arm64-v8a/libmagiskboot.so repack boot.img
49+
./lib/arm64-v8a/libkptools.so repack boot.img
5050
dd if=/dev/tmp/install/new-boot.img of=/dev/block/by-name/boot$slot
5151
mv boot.img /data/boot.img
5252
apatchNote
5353
}
5454

5555
function boot_execute(){
56-
./lib/arm64-v8a/libmagiskboot.so unpack boot.img
56+
./lib/arm64-v8a/libkptools.so unpack boot.img
5757
if [[ ! $(./lib/arm64-v8a/libkptools.so -i ./kernel -f | grep CONFIG_KALLSYMS=y) ]]; then
5858
kernelFlagsErr
5959
fi
@@ -63,7 +63,7 @@ function boot_execute(){
6363
failed
6464
fi
6565
ui_printfile /dev/tmp/install/log
66-
./lib/arm64-v8a/libmagiskboot.so repack boot.img
66+
./lib/arm64-v8a/libkptools.so repack boot.img
6767
dd if=/dev/tmp/install/new-boot.img of=/dev/block/by-name/boot$slot
6868
mv boot.img /data/boot.img
6969
apatchNote
@@ -75,7 +75,6 @@ cd /dev/tmp/install
7575

7676
chmod a+x ./assets/kpimg
7777
chmod a+x ./lib/arm64-v8a/libkptools.so
78-
chmod a+x ./lib/arm64-v8a/libmagiskboot.so
7978

8079
slot=$(getprop ro.boot.slot_suffix)
8180

app/src/main/assets/UninstallAP.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,25 +25,25 @@ function failed(){
2525
}
2626

2727
function boot_execute_ab(){
28-
./lib/arm64-v8a/libmagiskboot.so unpack boot.img
28+
./lib/arm64-v8a/libkptools.so unpack boot.img
2929
mv kernel kernel-origin
3030
./lib/arm64-v8a/libkptools.so -u --image kernel-origin --out ./kernel
3131
if [[ ! "$?" == 0 ]]; then
3232
failed
3333
fi
34-
./lib/arm64-v8a/libmagiskboot.so repack boot.img
34+
./lib/arm64-v8a/libkptools.so repack boot.img
3535
dd if=/dev/tmp/install/new-boot.img of=/dev/block/by-name/boot$slot
3636
apatchNote
3737
}
3838

3939
function boot_execute(){
40-
./lib/arm64-v8a/libmagiskboot.so unpack boot.img
40+
./lib/arm64-v8a/libkptools.so unpack boot.img
4141
mv kernel kernel-origin
4242
./lib/arm64-v8a/libkptools.so -u --image kernel-origin --out ./kernel
4343
if [[ ! "$?" == 0 ]]; then
4444
failed
4545
fi
46-
./lib/arm64-v8a/libmagiskboot.so repack boot.img
46+
./lib/arm64-v8a/libkptools.so repack boot.img
4747
dd if=/dev/tmp/install/new-boot.img of=/dev/block/by-name/boot
4848
apatchNote
4949
}
@@ -53,7 +53,7 @@ function main(){
5353
cd /dev/tmp/install
5454

5555
chmod a+x ./lib/arm64-v8a/libkptools.so
56-
chmod a+x ./lib/arm64-v8a/libmagiskboot.so
56+
5757

5858
slot=$(getprop ro.boot.slot_suffix)
5959

app/src/main/assets/boot_patch.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ shift 2
3737
[ -e "$BOOTIMAGE" ] || { >&2 echo "- $BOOTIMAGE does not exist!"; exit 1; }
3838

3939
# Check for dependencies
40-
command -v ./magiskboot >/dev/null 2>&1 || { >&2 echo "- Command magiskboot not found!"; exit 1; }
40+
4141
command -v ./kptools >/dev/null 2>&1 || { >&2 echo "- Command kptools not found!"; exit 1; }
4242

4343
if [ ! -f kernel ]; then
4444
echo "- Unpacking boot image"
45-
./magiskboot unpack "$BOOTIMAGE" >/dev/null 2>&1
45+
./kptools unpack "$BOOTIMAGE" >/dev/null 2>&1
4646
if [ $? -ne 0 ]; then
4747
>&2 echo "- Unpack error: $?"
4848
exit $?
@@ -76,7 +76,7 @@ if [ $patch_rc -ne 0 ]; then
7676
fi
7777

7878
echo "- Repacking boot image"
79-
./magiskboot repack "$BOOTIMAGE" >/dev/null 2>&1
79+
./kptools repack "$BOOTIMAGE" >/dev/null 2>&1
8080

8181
if [ ! $(./kptools -i kernel.ori -f | grep CONFIG_KALLSYMS_ALL=y) ]; then
8282
echo "- Detected CONFIG_KALLSYMS_ALL is not set!"

app/src/main/assets/boot_unpatch.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ BOOTIMAGE=$1
1919
echo "- Target image: $BOOTIMAGE"
2020

2121
# Check for dependencies
22-
command -v ./magiskboot >/dev/null 2>&1 || { echo "- Command magiskboot not found!"; exit 1; }
22+
2323
command -v ./kptools >/dev/null 2>&1 || { echo "- Command kptools not found!"; exit 1; }
2424

2525
if [ ! -f kernel ]; then
2626
echo "- Unpacking boot image"
27-
./magiskboot unpack "$BOOTIMAGE" >/dev/null 2>&1
27+
./kptools unpack "$BOOTIMAGE" >/dev/null 2>&1
2828
if [ $? -ne 0 ]; then
2929
>&2 echo "- Unpack error: $?"
3030
exit $?
@@ -44,7 +44,7 @@ if [ ! $(./kptools -i kernel -l | grep patched=false) ]; then
4444
exit $?
4545
fi
4646
echo "- Repacking boot image"
47-
./magiskboot repack "$BOOTIMAGE" >/dev/null 2>&1
47+
./kptools repack "$BOOTIMAGE" >/dev/null 2>&1
4848
if [ $? -ne 0 ]; then
4949
>&2 echo "- Repack error: $?"
5050
exit $?

app/src/main/assets/util_functions.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ install_apatch() {
421421
abort "! $BOOTIMAGE is read only"
422422
;;
423423
esac
424-
./magiskboot cleanup
424+
425425
rm -f new-boot.img
426426

427427
run_migrations
@@ -526,7 +526,7 @@ run_migrations() {
526526
BACKUP=$MAGISKBIN/stock_${name}.img
527527
[ -f $BACKUP ] || continue
528528
if [ $name = 'boot' ]; then
529-
LOCSHA1=$($MAGISKBIN/magiskboot sha1 $BACKUP)
529+
#LOCSHA1=$($MAGISKBIN/magiskboot sha1 $BACKUP)
530530
mkdir /data/magisk_backup_${LOCSHA1} 2>/dev/null
531531
fi
532532
TARGET=/data/magisk_backup_${LOCSHA1}/${name}.img

app/src/main/java/me/bmax/apatch/APatchApp.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ class APApplication : Application(), Thread.UncaughtExceptionHandler {
6868
private const val MAGISKPOLICY_BIN_PATH = APATCH_BIN_FOLDER + "magiskpolicy"
6969
private const val BUSYBOX_BIN_PATH = APATCH_BIN_FOLDER + "busybox"
7070
private const val RESETPROP_BIN_PATH = APATCH_BIN_FOLDER + "resetprop"
71-
private const val MAGISKBOOT_BIN_PATH = APATCH_BIN_FOLDER + "magiskboot"
7271
const val DEFAULT_SCONTEXT = "u:r:untrusted_app:s0"
7372
const val MAGISK_SCONTEXT = "u:r:magisk:s0"
7473

@@ -143,8 +142,7 @@ class APApplication : Application(), Thread.UncaughtExceptionHandler {
143142
"chmod +x $RESETPROP_BIN_PATH",
144143
"cp -f ${nativeDir}/libbusybox.so $BUSYBOX_BIN_PATH",
145144
"chmod +x $BUSYBOX_BIN_PATH",
146-
"cp -f ${nativeDir}/libmagiskboot.so $MAGISKBOOT_BIN_PATH",
147-
"chmod +x $MAGISKBOOT_BIN_PATH",
145+
148146

149147

150148
"touch $PACKAGE_CONFIG_FILE",

app/src/main/java/me/bmax/apatch/ui/viewmodel/PatchesViewModel.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ class PatchesViewModel : ViewModel() {
7878
patchDir.deleteRecursively()
7979
patchDir.mkdirs()
8080
val execs = listOf(
81-
"libkptools.so", "libmagiskboot.so", "libbusybox.so", "libkpatch.so", "libbootctl.so"
81+
"libkptools.so", "libbusybox.so", "libkpatch.so", "libbootctl.so"
8282
)
8383
error = ""
8484

@@ -130,7 +130,7 @@ class PatchesViewModel : ViewModel() {
130130
val result = shellForResult(
131131
shell,
132132
"cd $patchDir",
133-
"./magiskboot unpack $bootimg",
133+
"./kptools unpacknolog $bootimg",
134134
"./kptools -l -i kernel",
135135
)
136136
if (result.isSuccess) {

0 commit comments

Comments
 (0)