Commit Graph

2721 Commits

Author SHA1 Message Date
topjohnwu a4a661bf34 Small code restructuring 2019-03-11 12:44:50 -04:00
topjohnwu 771e500468 Use dark theme by default 2019-03-11 07:39:01 -04:00
topjohnwu 7e3ff03109 Default to canary channel if running canary build 2019-03-11 07:38:31 -04:00
topjohnwu a1827fd680 Make sure to read db before 2019-03-11 07:30:37 -04:00
topjohnwu 9ce334feac Update the way to deal with configs 2019-03-11 07:03:36 -04:00
topjohnwu ed11e0bff6 Fix repackage manager settings migration 2019-03-11 05:43:48 -04:00
topjohnwu 5111086637 Don't care if child threads were unknown 2019-03-10 01:46:32 -05:00
topjohnwu 20f204810e Use RAII to detach PIDs 2019-03-10 01:14:41 -05:00
topjohnwu 4581354e7a Allow zygote to execve
Allow zygote to execute other programs (such as dex2oat).
This fixes the bug that cause ART framework boot images failed to load
and result to extremely serious performance degradation.

Fix #1195
2019-03-09 22:58:05 -05:00
topjohnwu faf4d76388 Use large vector<bool> instead of set<pid>
vector<bool> uses bitsets, so we actually only use 12k memory to
store all 3 possible PID info tables. PID checkup will be now become
O(1) instead of O(logn).

P.S. The reason why we don't use unordered_map is because including it
will result in significant binary size increase (might be due to the
complex hash table STL implementation? I really don't know).
2019-03-09 22:28:43 -05:00
topjohnwu a46e255709 Fix strings.xml 2019-03-09 05:47:19 -05:00
Vladimír Kubala 63e2bbb4d1 Slovak translation update 2019-03-09 05:37:50 -05:00
bubuleur c3dabae237 Update French Language
Small correction line 108 thank you
2019-03-09 05:37:41 -05:00
topjohnwu f1abcbb7fb Update WorkManager 2019-03-09 05:36:49 -05:00
topjohnwu 70efddb90f Only use SELinux if necessary in init 2019-03-09 05:30:42 -05:00
topjohnwu f24a5dfd45 More efficient xml parsing 2019-03-09 04:27:04 -05:00
topjohnwu 081074ad9d Better zygote process detection 2019-03-08 23:53:53 -05:00
topjohnwu ab0cc78d2c Update README.md 2019-03-08 10:23:42 -05: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 745865ee53 Add canary channels
Only show if user is already on canary channels
2019-03-08 06:23:13 -05:00
topjohnwu c134fb1939 Remove unnecessary rules 2019-03-08 04:21:23 -05:00
topjohnwu 0204d05316 Remove Zygote notifier
Temporary trigger process scan on packages.xml updates, will find better methods
2019-03-08 03:35:17 -05:00
topjohnwu c345633d80 Fix build error
Close #1182
2019-03-08 01:01:42 -05:00
topjohnwu a57a94040e Update some format magics 2019-03-08 00:47:15 -05:00
topjohnwu 1bde78d121 Rename patch_level -> os_patch_level 2019-03-07 21:59:03 -05:00
topjohnwu bbd014ad1b More saftey checks and improvements 2019-03-07 21:49:47 -05:00
topjohnwu 1287372f5a Support patching header in magiskboot 2019-03-07 21:32:01 -05:00
topjohnwu d2cb638fcd Use our own function to parse int 2019-03-07 20:31:35 -05:00
topjohnwu bbe4b69c8d Fix LZ4FEncoder constructor 2019-03-07 19:58:59 -05:00
topjohnwu 7f08c06943 Remove unnecessary '--' from magiskboot actions 2019-03-07 18:07:23 -05:00
topjohnwu 8f4a6415cd Use ToT r8 for releases 2019-03-07 17:33:06 -05:00
topjohnwu 0442d6d509 Only compress kernel and ramdisk if input not compressed 2019-03-07 07:24:20 -05:00
lindwurm a3fc6d2a27 l10n: Update Japanese translation
Signed-off-by: lindwurm <lindwurm.q@gmail.com>
2019-03-07 06:10:42 -05:00
linar10 7db05ac927 Update strings.xml 2019-03-07 06:10:29 -05:00
Igor Dyatlov 8bed93b3c5 Updated Russian translation 2019-03-07 06:10:14 -05:00
topjohnwu 915b49014f Build libsqlite.so only with magisk
Fix #1175
2019-03-07 05:21:27 -05:00
topjohnwu c699f30831 Fix some build issues 2019-03-07 05:05:46 -05:00
topjohnwu 3e73e3a906 Play with Java streams 2019-03-07 03:43:28 -05:00
topjohnwu 32c65d8a88 Upgrade Android Studio 2019-03-07 03:41:24 -05:00
topjohnwu a49328edd3 Workaround Binder transaction limits 2019-03-07 02:07:34 -05:00
topjohnwu 9a15365a57 Welcome, Java 8/9 APIs
Fix #1162
2019-03-07 00:01:07 -05:00
topjohnwu 82c864d57e Make zygote notifier more reliable 2019-03-06 18:22:04 -05:00
topjohnwu 6226f875ff Make db settings constructor more readable 2019-03-06 08:21:23 -05:00
topjohnwu 370015a853 Modernize database code (again) 2019-03-06 08:16:12 -05:00
topjohnwu 6597b7adc0 Add MicroG DroidGuardHelper as target
MicroG uses a different package to handle DroidGuard service (SafetyNet),
but still uses the same com.google.android.gms.unstable process name.
Thanks to the changes in 4e53ebfe, we can target both official GMS
and MicroG SafetyNet services at the same time.
2019-03-06 05:43:52 -05:00
topjohnwu 4e53ebfe44 Use both package name and process name as key
Different packages could potentially use the same process name,
and they shouldn't conflict with each other.
2019-03-06 05:40:52 -05:00
topjohnwu 04ef1e6405 Make parse prop file a util function 2019-03-05 20:27:09 -05:00
topjohnwu b278d07b05 Switch to Zygote ptrace-ing
No matter if we use the old, buggy, error prone am_proc_start monitoring,
or the new APK inotify method, both methods rely on MagiskHide 'reacting'
fast enough to hijack the process before any detection has been done.

However, this is not reliable and practical. There are apps that utilize
native libraries to start detects and register SIGCONT signal handlers
to mitigate all existing MagiskHide process monitoring mechanism. So
our only solution is to hijack an app BEFORE it is started.

All Android apps' process is forked from zygote, so it is easily the
target to be monitored. All forks will be notified, and subsequent
thread spawning (Android apps are heaviliy multithreaded) from children
are also closely monitored to find the earliest possible point to
identify what the process will eventually be (before am_proc_bound).

ptrace is extremely complicated and very difficult to get right. The
current code is heaviliy tested on a stock Android 9.0 Pixel system,
so in theory it should work fine on most devices, but more tests and
potentially fixes are expected to follow this commit.
2019-03-05 20:23:27 -05:00
topjohnwu 6c3896079d Add zygote server notifier 2019-03-05 20:23:27 -05:00