[core] No more live patch (#317)

This commit is contained in:
LoveSy 2021-03-10 14:40:13 +08:00 committed by GitHub
parent 3325e275f4
commit a7a59d21e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 16 deletions

View File

@ -41,7 +41,7 @@ val commitCount = Git(repo).log().add(refId).call().count()
val defaultManagerPackageName by extra("io.github.lsposed.manager") val defaultManagerPackageName by extra("io.github.lsposed.manager")
val verCode by extra(commitCount + 4200) val verCode by extra(commitCount + 4200)
val verName by extra("v1.3.0") val verName by extra("v1.3.1")
val androidTargetSdkVersion by extra(30) val androidTargetSdkVersion by extra(30)
val androidMinSdkVersion by extra(27) val androidMinSdkVersion by extra(27)
val androidBuildToolsVersion by extra("30.0.3") val androidBuildToolsVersion by extra("30.0.3")

View File

@ -58,7 +58,6 @@ import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.TimeUnit;
import io.github.lsposed.lspd.Application; import io.github.lsposed.lspd.Application;
import io.github.lsposed.lspd.BuildConfig; import io.github.lsposed.lspd.BuildConfig;
@ -164,22 +163,9 @@ public class ConfigManager {
} }
} }
private static boolean checkSepolicy() {
return SELinux.checkSELinuxAccess("u:r:system_server:s0", "u:r:system_server:s0", "process", "execmem");
}
// for system server, cache is not yet ready, we need to query database for it // for system server, cache is not yet ready, we need to query database for it
public boolean shouldSkipSystemServer() { public boolean shouldSkipSystemServer() {
if (!checkSepolicy()) { if (!SELinux.checkSELinuxAccess("u:r:system_server:s0", "u:r:system_server:s0", "process", "execmem")) {
Log.d(TAG, "sepolicy is not loaded, trying livepatch");
try {
Process p = Runtime.getRuntime().exec(new String[]{"supolicy", "--live",
"allow system_server system_server process execmem"});
p.waitFor(5, TimeUnit.SECONDS);
} catch (Throwable ignored) {
}
}
if (!checkSepolicy()) {
sepolicyLoaded = false; sepolicyLoaded = false;
Log.e(TAG, "skip injecting into android because sepolicy was not loaded properly"); Log.e(TAG, "skip injecting into android because sepolicy was not loaded properly");
return true; // skip return true; // skip