Commit Graph

349 Commits

Author SHA1 Message Date
ca99808fd2 Update AVD support
- Support arm64 AVD images
- Support setup on Windows

 Close #4637
2021-09-07 03:03:02 -07:00
477ff12cde print sepolicy rules dir 2021-09-02 21:46:43 -07:00
773bf0c6bc Do not use glob in the system's unzip parameter
https://android.googlesource.com/platform/system/core/+/refs/tags/android-10.0.0_r47/libziparchive/unzip.cpp#57 unzip did not support glob before Android 11
2021-08-29 13:03:41 -07:00
350144df29 Do not allow remove the module to be updated 2021-08-29 11:35:46 -07:00
4771c2810b Significantly better AVD support 2021-08-26 03:09:56 -07:00
9b3efffba9 Use magiskd to setup files 2021-08-18 03:44:32 -07:00
7717f0a6b0 Support Android S AVD 2021-05-13 04:45:13 -07:00
5e1fba3603 Build a single APK for all ABIs 2021-05-13 00:21:04 -07:00
66cc9bc545 Pure 64bit support 2021-05-12 16:38:34 -07:00
93ba4cca68 Fix copy sepolicy rules when install module 2021-05-04 22:11:10 -07:00
fe4981da21 Fix strings fallback in find_manager_apk
There is no preceding character (at least on some devices).
This regex should work in any cases, with and without preceding character.
2021-04-23 18:10:02 -07:00
e4f94c4c52 Adapt find_magisk_apk for A11
Add a fallback for Android 11's new app location.
2021-04-23 18:10:02 -07:00
01b985eded Remove more pre SDK 21 stuffs 2021-04-09 21:29:42 -07:00
9c0e18975c Fallback to getprop when reading system props
Close #4153
2021-04-06 03:56:49 -07:00
aa02057895 Do not use -f flag for readlink
Close #4104, fix #4098
2021-03-28 04:47:13 -07:00
8b5cb4c7b0 Fix #3735 2021-03-24 04:43:45 -07:00
f332e87cab Ensure the installer knows the API version when running from addon.d 2021-03-24 03:08:59 -07:00
023dbc6cb5 scripts: fix empty module cleanup
- should be sufficient for all basic modules, see https://github.com/topjohnwu/Magisk/issues/3119#issuecomment-704000783 for ideas for fixing it further on the daemon module-processing side

Fixes #3119
2021-03-24 03:06:57 -07:00
7b9a71c9af scripts: improve boot_patch 64bit detection
- use existing api_level_arch_detect function

Fixes #3961
2021-03-24 03:06:57 -07:00
901d22cdfa scripts: add boot_patch unpack error catching
- failure to unpack wasn't being caught so boot_patch would continue to build a new cpio out of nothing and attempt to repack it (identified in #4049)
2021-03-24 03:06:57 -07:00
93e1266ee7 scripts: fix find_boot_image using wrong partition list on non-slot
- revert logic changes introduced by ec8fffe61c which break find_boot_image on NAND devices and any others using non-standard naming supported by the A-only device boot partition name list
- despite being accepted equivalents in modern shells -n does not work on Android in some shell/env scenarios where ! -z always does
2021-03-24 03:06:57 -07:00
0a4e7eea41 scripts: clean up remaining Manager references 2021-03-24 03:06:57 -07:00
7a007b342a Correct comment
For file-based encryption, /data/adb is always required to encrypt
https://android.googlesource.com/platform/system/extras/+/refs/tags/android-7.0.0_r36/ext4_utils/ext4_crypt_init_extensions.cpp
68258e8444%5E%21/
2021-03-13 21:10:02 -08:00
48bde7375f uninstaller: consistency improvements
since there's no more "Magisk Manager"
2021-03-09 03:05:47 -08:00
9cc91b30b3 Fix #3871 2021-02-20 02:49:43 -08:00
f37e8f4ca8 Fix boot image patching 2021-02-07 01:54:08 -08:00
8794141b7f Support super old emulators 2021-01-30 00:56:16 -08:00
1024e68eb6 Remove class mapping in full APK 2021-01-26 07:27:35 -08:00
3f0136362b Move nand flash handling into boot_patch.sh 2021-01-25 03:37:41 -08:00
b8090a8e18 Ensure cwd is writable in module scripts
Close #3763
2021-01-24 20:58:30 -08:00
ec31bb9a82 Rename scripts 2021-01-24 07:18:14 -08:00
963d248cc7 Rename apk to be uninstaller 2021-01-24 07:02:36 -08:00
f2ca042915 Fix script for handling .apex files 2021-01-23 16:09:30 -08:00
ec8fffe61c Merge Magisk install zip into Magisk Manager
Distribute Magisk directly with Magisk Manager APK. The APK will
contain all required binaries and scripts for installation and
uninstallation. App versions will now align with Magisk releases.

Extra effort is spent to make the APK itself also a flashable zip that
can be used in custom recoveries, so those still prefer to install
Magisk with recoveries will not be affected with this change.

As a bonus, this makes the whole installation and uninstallation
process 100% offline. The existing Magisk Manager was not really
functional without an Internet connection, as the installation process
was highly tied to zips hosted on the server.

An additional bonus: since all binaries are now shipped as "native
libraries" of the APK, we can finally bump the target SDK version
higher than 28. The target SDK version was stuck at 28 for a long time
because newer SELinux restricts running executables from internal
storage. More details can be found here: https://github.com/termux/termux-app/issues/1072
The target SDK bump will be addressed in a future commit.

Co-authored with @vvb2060
2021-01-22 02:29:54 -08:00
d2bc2cfcf8 Install both 32 and 64 bit binaries 2021-01-18 12:37:08 -08:00
5a71998b4e Stop embedding magisk in magiskinit 2021-01-18 04:25:26 -08:00
51bc27a869 Avoid F2FS like a plague 2021-01-15 02:24:11 -08:00
bb303d2da1 Remove old unused code 2021-01-14 05:59:53 -08:00
b51b884fc7 Fix module installs in recovery
Close #3494
2020-12-28 00:25:01 -08:00
dc3d57deba utils_functions: Added a check for the system_root
now on addon while flashing recovery usign mount point /system_root by which this is causing a flashing error.
Let's first check and unmount /system_root if mounted

Signed-off-by: Mohd Faraz <androiabledroid@gmail.com>
2020-12-22 23:30:14 -08:00
6ce9225f52 Check block dev ro status
magisk is shared object, use static busybox instead
2020-12-19 14:12:12 -08:00
13a8820603 Double check $DATA_DE 2020-12-19 14:08:32 -08:00
503997a09a Trim out \r 2020-12-19 14:08:06 -08:00
17efdff134 remove_system_su only on recovery mode
We may mount su to /system/bin/su
2020-12-19 13:59:08 -08:00
984f32f994 Move copy_sepolicy_rules to manager
We don’t need it when patch boot
2020-12-19 13:58:53 -08:00
125ee46685 scripts: fix find_manager_apk
- the strings fallback was broken when the preceding character changed from 5 to ! recently, this new regex should cover any preceding character going forward
2020-12-06 23:49:03 -08:00
ce84f1762c scripts: fix sloppy/unpredictable cmd && this || that statements
- be a bit more POSIX to avoid any potential issues when full shell stdout/err are redirected
- actual logic chains remain unchanged
2020-12-06 23:48:43 -08:00
e0afbb647b Minor changes 2020-11-13 02:31:54 -08:00
bd1dd9d863 Fix ensure_bb by assigning the arguments propery
If we assign the execution output directly it will fail (tested on Android 11):

pdx201:/ # INSTALLER=/data/adb/magisk_install /data/adb/magisk_install/flash_script.sh                                                                          
/data/adb/magisk_install/flash_script.sh[31]: typeset: -o: is not an identifier

Because:

local cmds=$($bb sh -o standalone -c "
	  for arg in \$(tr '\0' '\n' < /proc/$$/cmdline); do
	    if [ -z \"\$cmds\" ]; then
	      # Skip the first argument as we want to change the interpreter
	      cmds=\"sh -o standalone\"
	    else
	      cmds=\"\$cmds '\$arg'\"
	    fi
	  done
	  echo \$cmds")
/system/bin/sh: typeset: -o: is not an identifier

Signed-off-by: Pablo Mendez Hernandez <pablomh@gmail.com>
2020-11-07 14:39:03 -08:00
16e4c67992 Significantly broaden sepolicy.rule compatibility
Previously, Magisk uses persist or cache for storing modules' custom
sepolicy rules. In this commit, we significantly broaden its
compatibility and also prevent mounting errors.

The persist partition is non-standard and also critical for Snapdragon
devices, so we prefer not to use it by default.

We will go through the following logic to find the best suitable
non-volatile, writable location to store and load sepolicy.rule files:

Unencrypted data -> FBE data unencrypted dir -> cache -> metadata -> persist

This should cover almost all possible cases: very old devices have
cache partitions; newer devices will use FBE; latest devices will use
metadata FBE (which guarantees a metadata parition); and finally,
all Snapdragon devices have the persist partition (as a last resort).

Fix #3179
2020-11-02 23:20:38 -08:00