Commit Graph

209 Commits

Author SHA1 Message Date
topjohnwu
ffcd093db1 Fix #5589
Close #5598
2022-03-17 02:25:31 -07:00
LoveSy
c849759682 Use magiskboot to patch avd
Fix #5421
2022-02-11 00:25:07 -08:00
topjohnwu
d3d28f0623 Update to NDK r23b
Credits: @yujincheng08

Close #5193
2022-01-30 07:11:51 -08:00
topjohnwu
a699dab5b3 Add option to skip building for AVD commands 2022-01-20 01:42:41 -08:00
topjohnwu
20ef724fad Add new build command avd_patch 2022-01-19 05:12:11 -08:00
topjohnwu
770b28ca30 Build on API 21 headers 2021-10-20 03:17:42 -07:00
topjohnwu
eca37bce38 Separate dependency and build cache 2021-09-08 01:16:26 -07:00
topjohnwu
de2306bd12 Proper incremental builds
Auto generate flag.h for precise rebuilding
2021-09-07 19:35:28 -07:00
topjohnwu
ca99808fd2 Update AVD support
- Support arm64 AVD images
- Support setup on Windows

 Close #4637
2021-09-07 03:03:02 -07:00
topjohnwu
5e1fba3603 Build a single APK for all ABIs 2021-05-13 00:21:04 -07:00
vvb2060
66cc9bc545 Pure 64bit support 2021-05-12 16:38:34 -07:00
topjohnwu
94ec11db58 Update snet.jar extension
The existing API key was revoked for some reason.
Release an updated extension jar with a new API key.

In addition, add some offline signature verification and change how
results are parsed to workaround some dumbass Xposed module "faking"
success results, since many users really don't know better.
2021-04-15 04:47:57 -07:00
Rikka
afe3c2bc1b
Fix "rm_rf" in build.py on Windows
prebuilt/windows-x86_64/bin/libpython2.7.dll
prebuilt/windows-x86_64/lib/python2.7/config/libpython2.7.dll.a

These two files in NDK has read-only attribute on Windows, remove these files with Python will get "WindowsError: [Error 5] Access is denied". It will finally make "build.py ndk" unable to remove the "magisk" folder.

This commit add a onerror callback for "shutil.rmtree" which clear the "read-only" attribute and retry.
2021-03-13 17:51:39 -08:00
topjohnwu
bf80b08b5f Fix build script 2021-03-07 04:34:06 -08:00
topjohnwu
851404205b Update NDK to r21e 2021-03-02 23:18:44 -08:00
topjohnwu
9164bf22c2 Update terminology 2021-02-23 23:56:58 -08:00
vvb2060
26b2e7dc5d Care version code changes 2021-01-30 11:58:10 -08:00
topjohnwu
6623195bd5 Cleanup scripts 2021-01-24 07:24:13 -08:00
topjohnwu
ec31bb9a82 Rename scripts 2021-01-24 07:18:14 -08:00
vvb2060
963d248cc7 Rename apk to be uninstaller 2021-01-24 07:02:36 -08:00
vvb2060
06773235da Fix Windows build 2021-01-23 18:06:01 -08:00
topjohnwu
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
topjohnwu
5a71998b4e Stop embedding magisk in magiskinit 2021-01-18 04:25:26 -08:00
topjohnwu
622dd84c9e Fix uninstaller zip 2020-12-26 22:45:05 -08:00
topjohnwu
f983bfc883 Embed keys into dex files 2020-12-26 21:33:30 -08:00
topjohnwu
e9e6ad3bb0 Sign zips with apksigner 2020-12-26 16:04:41 -08:00
topjohnwu
ab78a81d15 Fix GitHub actions 2020-12-25 15:54:47 -08:00
topjohnwu
8a2a6d9232 Make versionCode unconfigurable 2020-12-25 05:34:15 -08:00
topjohnwu
12aa6d86e4 Make config.prop optional 2020-12-24 04:46:31 -08:00
vvb2060
0b4dd63d36 Stub module always use release build 2020-12-19 21:02:05 -08:00
vvb2060
38d0f85deb Avoid unnecessary builds 2020-12-19 15:57:11 -08:00
topjohnwu
2da5fcb00b ANDROID_HOME is deprecated 2020-10-17 06:42:34 -07:00
topjohnwu
a079966f97 Migrate to AGP 4.1.0 2020-10-17 06:32:49 -07:00
topjohnwu
d6062944f1 Update snet extension to prevent crashes on release builds 2020-08-24 06:24:58 -07:00
topjohnwu
0835ff88b2 Update zipsigner version 2020-08-08 05:12:02 -07:00
topjohnwu
f7abc03dac Move copy util_functions.sh from Python scripts to gradle 2020-07-17 00:44:51 -07:00
topjohnwu
67f7935421 Restructure project 2020-07-04 04:09:19 -07:00
topjohnwu
53904b0627 Use gradle magic to optimize resources 2020-07-02 04:02:20 -07:00
topjohnwu
4bbd7989dd Update snet extension
Receive full snet payload from extension
2020-06-30 02:24:58 -07:00
vvb2060
ddf0c379be
Fix build 2020-06-20 03:03:46 -07:00
topjohnwu
56602cb9a3 Update gradle files 2020-06-17 02:33:33 -07:00
topjohnwu
2f824f59dc Better logging system
Use C++ magic to strip out debug logs at compile time
2020-06-01 04:15:37 -07:00
Shaka Huang
02b2290b16 Correct path of x86 libraries
Signed-off-by: Shaka Huang <shakalaca@gmail.com>
2020-05-31 05:33:35 -07:00
topjohnwu
fde78be2b4 Update Android Studio 2020-05-30 12:50:08 -07:00
topjohnwu
63512b39b2 Update NDK to r21b 2020-05-23 00:48:49 -07:00
topjohnwu
912009494d Revert accidental build script change 2020-05-08 01:44:10 -07:00
topjohnwu
a5d7c41d20 Support Safe Mode detection
When detecting device is booting as Safe Mode, disable all modules and
MagiskHide and skip all operations. The only thing that'll be available
in this state is root (Magisk Manager will also be disabled by system).

Since the next normal boot will also have all modules disabled, this can
be used to rescue a device in the case when a rogue module causes
bootloop and no custom recovery is available (or recoveries without
the ability to decrypt data).
2020-05-08 00:45:11 -07:00
topjohnwu
4066e5bf14 Update Makefiles 2020-04-06 22:45:08 -07:00
topjohnwu
4729514a22 Remove snet module from Magisk 2020-04-05 02:13:53 -07:00
topjohnwu
67d746a62c Let build.py setup NDK 2020-04-03 03:34:07 -07:00
zivmc
fef2da3c0b Fix bug in compiling elf_cleaner with g++
Signed-off-by: zivmc <zivmc@users.noreply.github.com>
2020-04-02 20:52:18 -07:00
topjohnwu
ef9d077c7f Update build.py 2020-03-27 23:23:26 -07:00
topjohnwu
581419b6a3 Update dependencies 2020-02-21 23:40:20 -08:00
topjohnwu
788db036fd Don't use Zopfli 2020-01-29 17:38:36 +08:00
topjohnwu
b13a35057a Support building standalone resetprop 2020-01-21 00:48:52 +08:00
あきと ミズキト
a5fc7891a6 build: Addressed file not found 2019-10-23 06:57:47 -04:00
topjohnwu
935bd01f59 Post process release APKs 2019-10-17 18:02:31 -04:00
topjohnwu
eeb5d669f6 Assign signing keystore location in config 2019-10-17 16:20:01 -04:00
topjohnwu
021994c9f3 Clean elf after building shared binaries 2019-08-22 02:51:17 +08:00
topjohnwu
a797d5d396 Update snet extension 2019-08-08 04:18:32 -07:00
topjohnwu
4c8f357978 Update to support updated FrankeNDK 2019-07-07 17:38:57 -07:00
topjohnwu
7918fc3528 Support building individual applets 2019-05-30 21:17:58 -07:00
topjohnwu
8c40db5730 Don't build snet in all 2019-05-20 01:57:05 -07:00
topjohnwu
6953cc2411 Use separate flags for 64-bit 2019-04-05 15:17:59 -04:00
topjohnwu
08a70f033a Add entrypoint to build test
Just for convenience, nothing special here
2019-04-01 02:46:09 -04:00
topjohnwu
9a7a26407a Update build script 2019-03-12 17:01:37 -04:00
topjohnwu
de5c902fdb Remove app-core module
Less confusion
2019-03-08 10:19:22 -05:00
topjohnwu
cf65169c99 Separate stub Magisk Manager to a module 2019-03-08 10:16:02 -05:00
topjohnwu
6ca8db2f0c Welcome to the 64 bit world!
Close #854
2019-02-24 08:13:27 -05:00
topjohnwu
defbbdfe21 Update scripts 2019-02-24 02:11:11 -05:00
topjohnwu
ed027ec3ee Refactor build flags 2019-02-12 05:17:02 -05:00
Aidan Holland
cfa28f0c4a Empty Exceptions 2019-02-11 17:14:29 -05:00
Aidan Holland
65ebb0d2f8 Misc Formatting
* PEP8 and linting
* empty exceptions
2019-02-11 03:18:15 -05:00
Licaon_Kter
9826640ae6 f-strings need Python 3.6
...this is a blocker for F-Droid since Debian Strech has only Python 3.5.x
2019-02-09 05:35:05 -05:00
topjohnwu
4df1047b07 Native project restructuring 2019-01-30 03:35:07 -05:00
topjohnwu
60f69feaff Full project restructuring 2019-01-30 03:10:12 -05:00
topjohnwu
23e5188422 Update scripts
1. Update build.py to use f-strings
2. Directly append busybox binaries to update-binary
3. Remove b64xz
2019-01-15 08:32:18 -05:00
topjohnwu
ff3d66a661 Separate backend logic from frontend UI 2018-12-13 04:35:50 -05:00
topjohnwu
b127e01845 Simplify debug flag propagation 2018-09-28 02:05:55 -04:00
topjohnwu
60b3b8ddce Better incremental builds 2018-09-27 03:56:56 -04:00
topjohnwu
41446ec9ba Separate libutils and libsystemproperties 2018-09-27 03:30:16 -04:00
topjohnwu
2d7c1da741 Better support for external config file 2018-09-06 14:25:35 -04:00
topjohnwu
ad7ec79903 Support custom config paths 2018-09-05 14:24:28 -04:00
topjohnwu
89a501a3af Fix build scripts 2018-08-21 00:31:41 +08:00
topjohnwu
c19b78180c Read props directly in Gradle 2018-08-20 12:02:38 +08:00
topjohnwu
0f34f0033c Switch to FrankeNDK for building native 2018-08-11 18:46:55 +08:00
topjohnwu
9fbffafdbf Improve build script 2018-08-10 05:57:12 +08:00
topjohnwu
075f0458f7 Split stub APK to new task 2018-08-10 05:57:12 +08:00
topjohnwu
d4568aa0a7 Compress binaries and use xz-embedded in magiskinit 2018-08-10 05:57:12 +08:00
topjohnwu
97588408a2 Reorganize build script 2018-08-10 05:57:11 +08:00
topjohnwu
1def9b301b Use xz-embedded for b64xz 2018-08-10 05:57:11 +08:00
topjohnwu
6add682705 Remove high compression mode 2018-08-10 03:49:25 +08:00
topjohnwu
e139f4fc13 Small build script adjustments 2018-08-06 19:32:37 +08:00
topjohnwu
9c17b8a098 Better subprocess support
Close #444
2018-08-06 02:01:04 +08:00
topjohnwu
32809e56d0 Sign release zips with release-key.jks
Close #408
2018-08-05 02:29:40 +08:00
topjohnwu
c8cc652b71 Prevent build fail when APK is first built without out folder 2018-07-19 16:25:11 +08:00
topjohnwu
8dc9d3bc78 Dump binaries to header at build, not at request 2018-07-18 00:54:31 +08:00
topjohnwu
c2e673f978 Less boilerplate in build script 2018-07-16 06:52:18 +08:00
topjohnwu
f339a087a2 Let Magisk compile against SDK 16 2018-07-13 22:14:32 +08:00
topjohnwu
1affb91f17 Support compiling against lower SDK
Reduce even more size for static binaries
2018-07-13 05:41:29 +08:00