Commit Graph

4182 Commits

Author SHA1 Message Date
topjohnwu
9820296e92 Update files.cpp in libutils 2020-04-02 02:17:45 -07:00
topjohnwu
dbfde74c1e Clean rootfs in switch_root 2020-04-01 23:37:11 -07:00
topjohnwu
b28668e18d Prevent possible race condition 2020-04-01 22:40:59 -07:00
topjohnwu
5f1174de27 Introduce new boot flow to handle SAR 2SI
The existing method for handling legacy SAR is:
1. Mount /sbin tmpfs overlay
2. Dump all patched/new files into /sbin
3. Magic mount root dir and re-exec patched stock init

With Android 11 removing the /sbin folder, it is quite obvious that
things completely break down right in step 1.

To overcome this issue, we have to find a way to swap out the init
binary AFTER we re-exec stock init. This is where 2SI comes to rescue!

2SI normal boot procedure is:
1st stage -> Load sepolicy -> 2nd stage -> boot continue...

2SI Magisk boot procedure is:
MagiskInit 1st stage -> Stock 1st stage -> MagiskInit 2nd Stage ->
-> Stock init load sepolicy -> Stock 2nd stage -> boot continue...

As you can see, the trick is to make stock 1st stage init re-exec back
into MagiskInit so we can do our setup. This is possible by manipulating
some ramdisk files on initramfs based 2SI devices (old ass non SAR
devices AND super modern devices like Pixel 3/4), but not possible
on device that are stuck using legacy SAR (device that are not that
modern but not too old, like Pixel 1/2. Fucking Google logic!!)

This commit introduces a new way to intercept stock init re-exec flow:
ptrace init with forked tracer, monitor PTRACE_EVENT_EXEC, then swap
out the init file with bind mounts right before execv returns!

Going through this flow however will lose some necessary backup files,
so some bookkeeping has to be done by making the tracer hold these
files in memory and act as a daemon. 2nd stage MagiskInit will ack the
daemon to release these files at the correct time.

It just works™  ¯\_(ツ)_/¯
2020-04-01 04:39:28 -07:00
topjohnwu
543ce937ec Don't need to find system_dev 2020-03-31 22:41:25 -07:00
topjohnwu
5537b083a8 Move surequest out of legacy 2020-03-30 23:53:21 -07:00
Viktor De Pasquale
6b0854749f Added setting resetting state on install screen
It will additionally show that download is complete rather than being stuck on loading.
2020-03-30 21:58:26 -07:00
Viktor De Pasquale
09ba4772b8 Fixed using wrong argument for flashing order 2020-03-30 21:58:26 -07:00
topjohnwu
06a1d08465 Replace ellipsis with recommended characters 2020-03-30 04:50:10 -07:00
fessmm
d510ead877 fix letters 2020-03-30 04:47:10 -07:00
topjohnwu
2968a1559e Get rid of the final Java file in app 2020-03-30 04:41:54 -07:00
topjohnwu
cba26eedb5 Move several stuffs out of shared 2020-03-30 04:25:42 -07:00
topjohnwu
23e74b2781 Prevent showing empty screen in stealth mode 2020-03-30 04:03:56 -07:00
topjohnwu
ef0277d10e Properly set themes for dialogs in stub 2020-03-30 04:03:33 -07:00
topjohnwu
a623a5b7cc Set proper component name in FlashFragment 2020-03-29 23:11:09 -07:00
Davy Defaud
be8479fdba
French translation update 2020-03-29 06:13:28 -07:00
Taras
e97e6d467c
Update Ukrainian strings 2020-03-29 06:12:56 -07:00
JoanVC100
75ec890d46 module_permission_declined string 2020-03-29 06:12:27 -07:00
Vladimír Kubala
871a9c29c8 Update strings.xml 2020-03-29 06:12:10 -07:00
dark-basic
a4f903d947 Update strings.xml
Add new line.
2020-03-29 06:11:55 -07:00
Viktor De Pasquale
1920a52829 Added progressbar indicating content loading on modules screen 2020-03-29 06:10:19 -07:00
Viktor De Pasquale
6e14a727b1 Fixed modules screen not offering reboot when local modules change 2020-03-29 06:10:19 -07:00
Viktor De Pasquale
ea855837df Fixed melting UI on pre A10 devices 2020-03-29 06:10:19 -07:00
Chris Renshaw
d05ed0e59c Manager: remove v from download names
- now that Canaries are only commit hashes for the version string, the v is unnecessary/confusing, so the simplest solution is to just remove the v from the filename for all Manager-based downloads of Magisk and Manager
2020-03-28 22:53:38 -07:00
topjohnwu
a9eb443072 Ignore existing attributes in manifest
Close #2595
2020-03-28 21:42:31 -07:00
topjohnwu
d382b00efd Accept all paths in FileProvider
Get rid of file_paths.xml
2020-03-28 01:27:41 -07:00
topjohnwu
ef9d077c7f Update build.py 2020-03-27 23:23:26 -07:00
topjohnwu
e4b20abf8e Update gradle files 2020-03-27 22:42:02 -07:00
John Wu
e9f0a10175
Update stable release badges 2020-03-27 21:43:52 -07:00
topjohnwu
c3968a26cf Remove dynamic loading code
All these code are moved into a private repo. The stub is actually
just a stub now; mixing dynamic load and stub is confusing.
2020-03-27 01:25:05 -07:00
topjohnwu
9371515ecc Disable animations in superuser fragment 2020-03-27 00:53:38 -07:00
topjohnwu
a83e055b19 Fix strings 2020-03-27 00:53:13 -07:00
Viktor De Pasquale
6907651756 Updated flash screen so it's a fragment
The FlashActivity has been removed and all of it's functionality has been transferred to the FlashFragment.
The FlashFragment needs to be however launched in a different way than the activity using the MainActivity's stub and so seemingly massive changes had to be made.

Notably the RemoteFileService didn't seem to be calling Service.startForeground(), which has been crashing the application due to the system requirements, so that's been fixed.
2020-03-26 03:42:52 -07:00
Viktor De Pasquale
fc2d0246e6 Added requesting navigation being hidden when showing alternative view 2020-03-26 03:42:52 -07:00
Viktor De Pasquale
bb9c362bab Added back button for ModuleFragment when displaying filter 2020-03-26 03:42:52 -07:00
Viktor De Pasquale
51402e68d2 Fixed log not displaying back button when alternative view is shown 2020-03-26 03:42:52 -07:00
Viktor De Pasquale
1b8813228b Updated the app to use navigation components instead of custom solution
Welcome to mid 2018.
2020-03-26 03:42:52 -07:00
Viktor De Pasquale
922e36cfb0 Updated the width of bottom navigation 2020-03-26 03:42:52 -07:00
Viktor De Pasquale
edff094626 Added log as primary fragment 2020-03-26 03:42:52 -07:00
Chris Renshaw
aa72a080b0 core: clean up /data/adb/magisk.img, etc. as well
- now that magisk.img -> /data/adb/modules migration is no longer taking place make sure all magisk.img locations get cleaned up
2020-03-26 03:39:49 -07:00
John Wu
2a93d1c652
Update shields.io URL for caching 2020-03-25 09:08:10 -07:00
topjohnwu
6b2f23712c Add live download counts 2020-03-25 04:00:21 -07:00
topjohnwu
375ab93ee3 Update logo.png 2020-03-23 05:12:30 -07:00
topjohnwu
d5962e9d71 Update README.MD 2020-03-23 04:45:06 -07:00
topjohnwu
ffaa264bd3 Update documentation 2020-03-23 04:24:20 -07:00
topjohnwu
ba7cb47383 Make version reporting consistent 2020-03-23 01:17:13 -07:00
topjohnwu
48d417f9af Add symlink for backwards compatibility
The native code has to run with an old verison of Magisk Manager,
add this back so things will work properly.
2020-03-22 21:00:40 -07:00
Heimen Stoffels
df4db6bf6b Added Dutch translation for stub 2020-03-22 13:45:26 -07:00
Heimen Stoffels
b8ef491bc7 Updated Dutch translation 2020-03-22 13:45:26 -07:00
kam821
ea1ebb8d00 Polish translation - fix missing string
Add previously deleted string, due incorrent (duplicated) variable name.
Described in: 31142180cb
2020-03-22 13:45:02 -07:00