Remove more pre SDK 21 stuffs

This commit is contained in:
topjohnwu 2021-04-09 21:29:42 -07:00
parent 1f0a35f073
commit 01b985eded
9 changed files with 15 additions and 48 deletions

View File

@ -4,17 +4,17 @@
## Introduction
Magisk is a suite of open source tools for customizing Android, supporting devices higher than Android 4.2. It covers fundamental parts of Android customization: root, boot scripts, SELinux patches, AVB2.0 / dm-verity / forceencrypt removals etc.
Magisk is a suite of open source software for customizing Android, supporting devices higher than Android 5.0.<br>
Here are some feature highlights:
- **MagiskSU**: Provide root access to your device
- **MagiskSU**: Provide root access for applications
- **Magisk Modules**: Modify read-only partitions by installing modules
- **MagiskHide**: Hide Magisk from root detections / system integrity checks
- **MagiskBoot**: The most complete tool for unpacking and repacking Android boot images
## Downloads
Please note that the only source of official Magisk information and downloads is [Github](https://github.com/topjohnwu/Magisk/). Beware of any other websites.
[Github](https://github.com/topjohnwu/Magisk/) is the only source where you can get official Magisk information and downloads.
[![](https://img.shields.io/badge/Magisk-v22.1-blue)](https://github.com/topjohnwu/Magisk/releases/tag/v22.1)
[![](https://img.shields.io/badge/Magisk%20Beta-v22.1-blue)](https://github.com/topjohnwu/Magisk/releases/tag/v22.1)
@ -27,13 +27,6 @@ Please note that the only source of official Magisk information and downloads is
- [Magisk Documentation](https://topjohnwu.github.io/Magisk/)
- [Magisk Troubleshoot Wiki](https://www.didgeridoohan.com/magisk/HomePage) (by [@Didgeridoohan](https://github.com/Didgeridoohan))
## Android Version Support
- Android 4.2+: MagiskSU and Magisk Modules Only
- Android 4.4+: All core features available
- Android 6.0+: Guaranteed MagiskHide support
- Android 7.0+: Full MagiskHide protection
## Bug Reports
**Only bug reports from Canary builds will be accepted.**

View File

@ -31,7 +31,7 @@ static int call_applet(int argc, char *argv[]) {
int main(int argc, char *argv[]) {
umask(0);
dload_selinux();
enable_selinux();
cmdline_logging();
init_argv0(argc, argv);

View File

@ -140,12 +140,6 @@ static bool magisk_env() {
xmkdir(SECURE_DIR "/post-fs-data.d", 0755);
xmkdir(SECURE_DIR "/service.d", 0755);
// Disable/remove magiskhide, resetprop
if (SDK_INT < 19) {
unlink("/sbin/resetprop");
unlink("/sbin/magiskhide");
}
if (access(DATABIN "/busybox", X_OK))
return false;

View File

@ -264,9 +264,6 @@ static void update_hide_config() {
int launch_magiskhide(bool late_props) {
mutex_guard lock(hide_state_lock);
if (SDK_INT < 19)
return DAEMON_ERROR;
if (hide_state)
return HIDE_IS_ENABLED;
@ -325,7 +322,7 @@ void auto_start_magiskhide(bool late_props) {
pthread_kill(monitor_thread, SIGALRM);
#endif
hide_late_sensitive_props();
} else if (SDK_INT >= 19) {
} else {
db_settings dbs;
get_db_settings(dbs, HIDE_CONFIG);
if (dbs[HIDE_CONFIG])

View File

@ -36,7 +36,6 @@ extern int (*fsetfilecon)(int fd, const char *con);
void getfilecon_at(int dirfd, const char *name, char **con);
void setfilecon_at(int dirfd, const char *name, const char *con);
void selinux_builtin_impl();
void dload_selinux();
void enable_selinux();
void restorecon();
void restore_tmpcon();

View File

@ -99,7 +99,7 @@ void setfilecon_at(int dirfd, const char *name, const char *con) {
lsetfilecon(path, con);
}
void selinux_builtin_impl() {
void enable_selinux() {
setcon = __setcon;
getfilecon = __getfilecon;
lgetfilecon = __lgetfilecon;
@ -108,13 +108,3 @@ void selinux_builtin_impl() {
lsetfilecon = __lsetfilecon;
fsetfilecon = __fsetfilecon;
}
void dload_selinux() {
if (access("/system/lib/libselinux.so", F_OK) && access("/system/lib64/libselinux.so", F_OK))
return;
/* We only check whether libselinux.so exists but don't dlopen.
* For some reason calling symbols returned from dlsym
* will result to SEGV_ACCERR on some devices.
* Always use builtin implementations for SELinux stuffs. */
selinux_builtin_impl();
}

View File

@ -11,7 +11,7 @@
# in the emulator. The constructed Magisk environment is not a
# fully functional one as if it is running on an actual device.
#
# The script assumes you are using x86/x64 emulator images.
# The script assumes you are using x64 emulator images.
# Build binaries with `./build.py binary` before running this script.
#
#####################################################################
@ -29,14 +29,8 @@ mount_sbin() {
if [ ! -f /system/build.prop ]; then
# Running on PC
cd "$(dirname "$0")/.."
tmp="/data/local/tmp"
adb push native/out/x86/busybox native/out/x86/magiskinit scripts/emulator.sh $tmp
emu_arch=$(adb shell "chmod 777 $tmp/busybox; $tmp/busybox uname -m")
if [ "$emu_arch" = "x86_64" ]; then
adb push native/out/x86_64/magisk /data/local/tmp
else
adb push native/out/x86/magisk /data/local/tmp
fi
adb push native/out/x86/busybox native/out/x86/magiskinit \
native/out/x86_64/magisk scripts/emulator.sh /data/local/tmp
adb shell sh /data/local/tmp/emulator.sh
exit 0
fi
@ -89,7 +83,7 @@ elif [ -e /sbin ]; then
mount_sbin
if ! grep -q '/sbin/.magisk/mirror/system_root' /proc/mounts; then
mkdir -p /sbin/.magisk/mirror/system_root
block=`mount | grep ' / ' | awk '{ print $1 }'`
block=$(mount | grep ' / ' | awk '{ print $1 }')
[ $block = "/dev/root" ] && block=/dev/block/dm-0
mount -o ro $block /sbin/.magisk/mirror/system_root
fi
@ -98,7 +92,7 @@ elif [ -e /sbin ]; then
if [ -L $file ]; then
cp -af $file /sbin
else
sfile=/sbin/`basename $file`
sfile=/sbin/$(basename $file)
touch $sfile
mount -o bind $file $sfile
fi

View File

@ -48,7 +48,7 @@ ui_print "- Target image: $BOOTIMAGE"
# Detect version and architecture
api_level_arch_detect
[ $API -lt 17 ] && abort "! Magisk only support Android 4.2 and above"
[ $API -lt 21 ] && abort "! Magisk only support Android 5.0 and above"
ui_print "- Device platform: $ARCH"

View File

@ -448,7 +448,7 @@ flash_image() {
install_magisk() {
cd $MAGISKBIN
if [ $API -ge 21 -a ! -c $BOOTIMAGE ]; then
if [ ! -c $BOOTIMAGE ]; then
eval $BOOTSIGNER -verify < $BOOTIMAGE && BOOTSIGNED=true
$BOOTSIGNED && ui_print "- Boot image is signed with AVB 1.0"
fi