Commit Graph

4349 Commits

Author SHA1 Message Date
topjohnwu
2f824f59dc Better logging system
Use C++ magic to strip out debug logs at compile time
2020-06-01 04:15:37 -07:00
Chris Renshaw
ad94f10205 Fix direct install on NAND devices
Co-authored-by: John Wu <topjohnwu@gmail.com>
2020-06-01 02:08:13 -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
Ilya Kushnir
f8a814a588 Fix RU strings 2020-05-31 05:32:18 -07:00
topjohnwu
4c4338cc02 Adapt to AGP 4.0 2020-05-30 13:06:03 -07:00
Facundo Montero
5675a1ae7d
app/stub: values-es: update to provide more consistency.
This update aims to provide better consistency to the Spanish
translation by properly separating each possible pronoun.

Other small grammar errors have also been corrected.
2020-05-30 12:56:37 -07:00
AioiLight
0952224c3d
Update JA strings 2020-05-30 12:56:02 -07:00
JoanVC100
4e26c10287
Fix CA strings 2020-05-30 12:55:26 -07:00
vvb2060
f3e82b9ef1
Add DoH using cloudflare-dns 2020-05-30 12:53:46 -07:00
osm0sis
e50295d337 magiskboot: add support for lz4 compressed dt (extra)
- legacy devices brought up to Android 10 may now use a compressed dt in a hdr_v0 AOSP dt variant extra section, so detect, decompress and recompress this
- so far these have only been done using lz4 compression (latest format revision magic), e.g. LOS 17.1 victara (Moto X)
2020-05-30 12:52:15 -07:00
topjohnwu
fde78be2b4 Update Android Studio 2020-05-30 12:50:08 -07:00
topjohnwu
c071ac8973 Remove unused code 2020-05-29 10:41:52 -07:00
topjohnwu
599ee57d39 Simplify sepolicy rules 2020-05-25 02:30:39 -07:00
topjohnwu
4499cebcd9 Support new sepolicy rules
Support declare new type with attribute and declare new attributes
2020-05-25 02:09:43 -07:00
topjohnwu
cd6eca1dc2 Optimize match-all-type rules
For match-all-type rules (e.g. "allow magisk * * *" used in Magisk),
we used to iterate and apply rules on all existing types. However, this
is actually unnecessary as all selinux types should have at least 1
attributes assigned to it (process types "domain", file context types
"file_type" etc.). This means in order to create rules that applies to
all types, we actually only need to create rules for all attributes.

This optimization SIGNIFICANTLY reduces the patched sepolicy that is
loaded into the kernel when running Magisk. For example on Pixel 4 XL
running Android R DP4, the sepolicy sizes are
patched (before) : 3455948
patched (after)  : 843176
stock            : 630229

The active sepolicy size actually impacts the performance of every single
operation in the operating system, because the larger the policies gets,
the longer it takes for the kernel to lookup and match rules.
2020-05-24 05:41:19 -07:00
topjohnwu
951273f8ef Cleanup some implementations 2020-05-24 04:16:40 -07:00
vvb2060
51eeb89f67 Allow consecutive points 2020-05-23 14:58:17 -07:00
topjohnwu
0efa73d96c Update selinux libs 2020-05-23 05:02:26 -07:00
topjohnwu
63512b39b2 Update NDK to r21b 2020-05-23 00:48:49 -07:00
topjohnwu
f392ade78d Rewrite sepolicy.c in C++ 2020-05-23 00:18:25 -07:00
topjohnwu
0236ab887e Several statement parsing improvements
- Update help message to match the spec
- Make tokenization not seg fault in certain conditions
- Moar template + macro magic to reduce boilerplate
2020-05-22 14:05:56 -07:00
topjohnwu
d4baae411b Modernize magiskpolicy 2020-05-21 06:48:02 -07:00
topjohnwu
e02e46d0fc Detect volume down key combo for safe mode
It is possible that a module is breaking the device so bad that zygote
cannot even be started. In this case, system_server cannot start and
detect the safe mode key combo, set the persist property, and reboot.

Also on old Android versions, the system directly goes to safe mode
after detecting a key combo without rebooting, defeating the purpose of
Magisk's safe mode protection if we only check for the persist property.

Directly adding key combo check natively in magiskd allows us to enter
Magisk safe mode before the system is even aware of it.
2020-05-19 04:57:47 -07:00
Chris Renshaw
3c04dab472 magiskhide: fix late_prop_key setprop, reorganize props slightly 2020-05-18 23:31:22 -07:00
topjohnwu
fc1844b4df Update policy for handling /data/adb 2020-05-18 23:29:26 -07:00
topjohnwu
99ef20627a Remove unused code 2020-05-18 05:45:08 -07:00
topjohnwu
4497e0aaca Don't expose module_list 2020-05-18 05:36:02 -07:00
topjohnwu
c3e045e367 Use daemon state to determine late prop hiding 2020-05-18 05:21:47 -07:00
topjohnwu
501d3e6c32 Maintain global daemon status 2020-05-18 05:18:49 -07:00
topjohnwu
b27b9c1d18 Minor code changes 2020-05-18 04:56:51 -07:00
topjohnwu
f7d3d1eeaf Increase post-fs-data mode to 40 secs 2020-05-18 04:56:51 -07:00
topjohnwu
0d72a4c8ba Fix compile error 2020-05-18 04:56:51 -07:00
topjohnwu
dbdb0a2560 Move late props to boot complete 2020-05-18 03:51:41 -07:00
Tornike Khintibidze
18a09703de
Updated Georgian translation 2020-05-17 15:09:51 -07:00
topjohnwu
bc6a14d30f Remove property ro.build.selinux 2020-05-17 15:01:37 -07:00
topjohnwu
97db49a57b Move vendor property manipulation to late start 2020-05-17 15:01:37 -07:00
topjohnwu
eca2168685 Guard magiskhide state with mutexes 2020-05-17 15:01:37 -07:00
Hen Ry
1bcef38739
Fix German translation 2020-05-16 22:29:26 -07:00
topjohnwu
aac6ad73da Fix collect modules 2020-05-16 13:45:22 -07:00
topjohnwu
122b4d66b6 Move Android logging out of libutils 2020-05-10 00:48:41 -07:00
topjohnwu
0f8f4e361b Update collect log logic 2020-05-10 00:30:11 -07:00
Chris Renshaw
3733b589ac native: fix slower build on non-Windows platforms 2020-05-09 04:41:07 -07:00
Chris Renshaw
6a2e781db2 magiskhide: add vendor.* props 2020-05-09 04:40:55 -07:00
vvb2060
c6569ce022 Fix service scripts 2020-05-09 04:40:05 -07:00
topjohnwu
a62bdc58cb Use env variables to enable standalone mode 2020-05-08 04:09:58 -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
232ae2a189 Update resetprop to partially use system impl 2020-05-07 23:54:00 -07:00
topjohnwu
aa8b23105f Modernize resetprop with fancy C++ 2020-05-07 06:08:30 -07:00
topjohnwu
c113f854a2 Fix overlay.d on SAR again 2020-05-07 02:30:43 -07:00