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

@ -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();
}