Commit Graph
217 Commits
Author SHA1 Message Date
engstk 6f88dff82b tools: update magisk utils to v29.0(29000) stable
Signed-off-by: engstk <eng.stk@sapo.pt>
2025-05-18 16:18:16 -03:00
osm0sis db90e19aae tools: update magisk utils to v28.1(28100) stable 2024-12-17 19:26:38 -04:00
engstk fdf4603a40 AK3: add option to skip vbmeta patching while avb is enabled (#90)
Signed-off-by: engstk <eng.stk@sapo.pt>
2024-10-14 13:02:49 -03:00
osm0sis 075e6ff32b AK3: fix Magisk check with magiskboot 27007+ 2024-10-12 20:37:18 -03:00
osm0sis ef8cd6c008 tools: update magisk utils to v28.0(28000) beta 2024-10-11 22:23:32 -03:00
osm0sis cb044b649b AK3: replace remaining variables
- all working directory variables
- all user set variables
- add backwards compat so devs have time to update anykernel.sh
- overdue core variable cleanup, part 3/x
2024-05-09 14:14:22 -03:00
osm0sis c2e5f7e841 Backend: move tools higher in the PATH
- avoids conflicts with any utilities that might also be part of busybox
2024-05-09 13:32:46 -03:00
osm0sis a6c478e370 tools: update magisk utils to v27.0(27000) beta 2024-02-03 23:57:38 -04:00
osm0sis 458caeda33 tools: update magisk utils to v26.4(26400) stable 2023-11-06 14:19:14 -04:00
osm0sis f63f136037 AK3: add system_dlkm.img flashing to write_boot function 2023-10-20 00:10:34 -03:00
osm0sis d7b689331f tools: update magisk utils to 0352ea2c(26302) canary
- fixes custom AVBv1 signing (see: 1dfb2c34aa)
- fixes/improves dtb patching
- fixes sepolicy patching on older devices
2023-10-18 15:34:00 -03:00
osm0sis 82adc2f4df AK3: separate dump failure and split failure 2023-10-09 11:52:12 -03:00
osm0sis f1e1a32c60 Backend: improve modules rw remount output 2023-09-20 10:37:49 -03:00
osm0sis 19ab7e13a3 AK3: only allow repack of hdr v4 ramdisks as lz4-l
- they all get overlayed and must be matching compression formats
2023-09-18 14:54:03 -03:00
osm0sis 04376fbe3e Backend: work around KernelSU not processing modules on initial install
- KernelSU currently requires the Manager app be run after first rooted to dump /data/adb/ksud, and then it will process any pending modules_update.img on the next reboot
- the above is problematic since some custom kernels providing KernelSU support will require a working module system to overlay .ko kernel modules needed for feature support and sometimes the ROM won't boot without these matching
- work around this KernelSU behavior by dumping ksud ourselves as-needed during the AK3 helper module installation, allowing seamless initial KernelSU kernel support installation with AK3 helper module .ko support

See: https://github.com/tiann/KernelSU/issues/945
2023-09-13 16:01:35 -03:00
osm0sis 1dfb2c34aa AK3: support custom AVBv1 signing with magiskboot
NOTE: this currently appears to be broken in magiskboot, so continue to use boot_signer for now, but we're ready for when it works ;)
2023-09-10 14:37:17 -03:00
osm0sis d2f06464d8 tools: update magisk utils to v26.3(26300) stable 2023-09-04 07:10:30 -03:00
osm0sis df90d744fd AK3: add overlay.d warning for KernelSU users 2023-08-30 19:59:16 -03:00
osm0sis b52433bf12 AK3: fix repack return check with magiskboot 2023-08-28 22:37:04 -03:00
Chris Renshaw b9df8b892f Backend: add vendor security patch checking 2023-08-22 01:51:39 -03:00
Chris Renshaw 9d09ba3ecd AK3: add no_magisk_check=1 to skip Magisk detection and repatching 2023-08-15 20:08:55 -03:00
Chris Renshaw 32073dff09 AK3: add per-partition attributes, multi-partition fixes
- attributes function now runs via core in setup_ak and reset_ak, but only if it exists, allowing more easy removal of it for setups with no ramdisk changes (so all should now remove the awkward `&& attributes` call from anykernel3.sh, see next commit)
- for multi-partition zips with multiple ramdisks requiring different files, multiple attributes functions may now be specified, either redefine attributes() in anykernel.sh for the next partition, or add a different function for each partition, e.g. boot_attributes() and vendor_boot_attributes()
- fix block=auto multi-partition setup creating an "auto-files" directory instead of final found block, e.g. "init_boot-files"
2023-08-10 13:11:32 -03:00
Chris Renshaw a5ce1c04d1 Backend: hide shcon workaround stderr on (likely) working recoveries
- some recoveries don't allow reading/changing shell context and will show an error:

sh: write error: Invalid argument

- these recoveries seem to allow loop mounts unlike most LOS Recovery builds lately, so hide the error output
2023-08-10 12:36:28 -03:00
Chris Renshaw 9ab60a49de Backend: work around for chcon on broken recoveries 2023-08-01 11:04:26 -03:00
Chris Renshaw 4030d36655 AK3+Backend: helper module improvements and full KernelSU support
- only parse kernel strings when both do.modules=1 and do.systemless=1 are set
- support post-fs-data.sh in systemless kernel helper module (gets renamed and sourced from the built-in one)
- show systemless kernel helper module as an update pending reboot in module apps if flashed while booted
- add system_ext support to systemless kernel helper module
- show a warning during flash if systemless kernel helper module is configured but there's no decrypted /data access to be able to install it
- detect the installed KernelSU app as the indicator the user intends to use KernelSU, and install systemless kernel helper module to modules_update.img accordingly
- do KernelSU directory setup and create modules_update.img if this appears to be the initial KernelSU install
- set all systemless kernel helper module files to system_file context, since unlabeled files are not gracefully handled by KernelSU (they trigger a reboot and the module gets rejected)

NOTE: currently it appears KernelSU won't parse the modules_update.img on the first boot where it sets itself up from initial KernelSU install, but it will then do it after the following reboot. Hopefully this can be fixed by a future KernelSU release so that the systemless kernel helper module is active right away as this might be necessary to boot fully on some devices
2023-07-16 16:33:47 -03:00
osm0sis 0b37d0bfa4 AK3+Backend: add preliminary KernelSU support 2023-07-04 15:32:02 -03:00
osm0sis c91542d29f AK3: don't attempt to AVBv1 sign if /system/bin/dalvikvm is not present
- latest Android has moved dalvikvm to /apex/com.android.art/bin/dalvikvm but there's currently no way to run this from recovery due to linkerconfig
- AVBv1 signing is most likely only needed on older devices running older Android which will still have /system/bin/dalvikvm so this shouldn't really affect anything
2023-06-05 12:56:37 -03:00
osm0sis c878b3e62b Backend: fix loop mounts on newer Lineage-based recoveries
- loops would fail only in LOS Recovery from direct mount .img and losetup .img+loop mount with, e.g. "mount: mounting /dev/block/loop0 on /apex/com.android.adbd failed: Invalid argument"
- this started ~LOS19, I believe, though I haven't tracked down the specific change yet
- confusing to diagnose, since it always works in recovery adb shell, until I realized there was a context difference: "su" for adb shell and "recovery" for zip flashes
- switch shell context temporarily to "su" to do apex mounts, then return to original context (currently only necessary for mounting loops)
2023-05-26 07:25:10 -03:00
osm0sis 15b90dc7db tools: newer busybox (1.36.1) patched to fix loop mounts on kernels <5.x
Compiled from my own updated fork:
https://github.com/osm0sis/android-busybox-ndk
2023-05-25 18:41:34 -03:00
osm0sis 5c916de64c Backend: abort apex loop mounts early if failing
- /dev/block/loop* nodes don't behave correctly in Lineage Recovery anymore (beginning ~ LOS19), not sure why, but mount and losetup can't use them
- bail out early so we don't slow the install to a crawl with the rapid mount failures
2023-05-25 18:36:51 -03:00
osm0sis f4cbd4b68d Backend: fixup now that mount_apex direct .img mount works 2023-05-24 15:26:02 -03:00
osm0sis 8055e75b8e Backend: move busybox bin setup to setup_bb function, add tools to PATH 2023-05-06 15:21:34 -03:00
Captain Trips 68564baf10 AK3: clear cow before logical partition replace or resize (#78) 2023-05-04 13:36:15 -03:00
osm0sis ba82924dab AK3+Backend: pass AKHOME via export 2023-05-03 15:45:34 -03:00
osm0sis dee204c197 Backend: simpify getprop replacement propval return 2023-05-03 15:32:06 -03:00
osm0sis b3c769f1db AK3+Backend: use busybox as much as possible + OLD_PATH for exceptions 2023-04-23 00:09:54 -03:00
osm0sis f080b80e30 Backend: refactor mount_all and umount_all
- only umount /metadata and /persist if not already mounted, as some recoveries have these always mounted
- combine into list of possibly pre-mounted partitions to umount
2023-04-22 08:18:14 -03:00
osm0sis c45a8d52c0 Backend: support /metadata mount + debugging improvements
- look for .ak3-debugging file in /tmp /cache /metadata or /persist to allow debugging better on recoveries that only support sideload
- use /tmp for ak3-debug.tgz if sideloading, and fix .tgz compression when apex fails to mount
2023-04-21 16:42:22 -03:00
osm0sis d6e040c227 AK3: update for latest magiskboot, don't un/repack kernel if not patched 2023-04-18 13:27:44 -03:00
Captain Trips ddbb40edc8 AK3: detect flashing to inactive slot during OTA on VAB devices (#77) 2023-04-16 18:06:44 -03:00
engstk 9664985a0b tools: update magisk utils to v26.0(26000) beta
Signed-off-by: engstk <eng.stk@sapo.pt>
2023-04-06 09:34:56 -03:00
osm0sis 8588147d67 Backend: fix byname finding on modern Android versions for devices without super
- /dev/block/mapper exists on all devices with apex but only contains system partition symlinks on devices with super partition logical partitions
2023-04-05 23:19:05 -03:00
osm0sis 7a3e6df8ca Backend: fix showing ui_printfile padding char in error when booted 2023-03-23 17:05:57 -03:00
osm0sis 7c8c1e7e9b Backend: fix ui_printfile on Lineage-based recoveries
- add padding character to work around bad handling of leading whitespace which CWM-based and TWRP-based both handle fine
2023-03-16 17:10:24 -03:00
osm0sis 398b9631df Backend: correct build.prop locations for getprop replacement
- system_ext and odm only have build.prop in /<partition>/etc
- product may have build.prop in /product and/or /product/etc
2023-02-08 12:56:54 -04:00
osm0sis c2e33f95d1 AK3+Backend: support AMLogic devices where A-only sets slot=normal 2023-02-08 12:53:48 -04:00
osm0sis 6ffb765c8c AK3: correct cmdline to remove any type of leading whitespace 2023-01-20 12:37:19 -04:00
osm0sis 8077d11135 AK3: also remove leading spaces from cmdline 2023-01-09 19:19:13 -04:00
osm0sis e49ea0be95 Backend: don't unmount any existing apex at start of flash 2023-01-08 14:03:30 -04:00
osm0sis c2e0bd7c4b AK3: flash_* display/output/debug improvements
- tidy up flash_generic block display output to match setup_ak
- add helpful flash_generic debugging stderr for mapper flashing
- hide flash_boot harmless stderr from strings command in TWRP
2023-01-07 14:25:44 -04:00