[app] Bypass hidden api (#606)

This commit is contained in:
LoveSy 2021-05-17 17:02:08 +08:00 committed by GitHub
parent c45303c5ce
commit feadd30608
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 0 deletions

View File

@ -219,6 +219,7 @@ dependencies {
implementation("io.noties.markwon:linkify:$markwonVersion")
implementation("me.zhanghai.android.appiconloader:appiconloader-glide:1.3.1")
implementation("me.zhanghai.android.fastscroll:library:1.1.5")
implementation("org.lsposed.hiddenapibypass:hiddenapibypass:1.1")
implementation(project(":manager-service"))
}

View File

@ -24,11 +24,13 @@ import android.annotation.SuppressLint;
import android.app.Application;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Build;
import android.util.Log;
import androidx.annotation.NonNull;
import androidx.preference.PreferenceManager;
import org.lsposed.hiddenapibypass.HiddenApiBypass;
import org.lsposed.manager.repo.RepoLoader;
import org.lsposed.manager.ui.activity.CrashReportActivity;
import org.lsposed.manager.util.DoHDNS;
@ -45,6 +47,13 @@ import okhttp3.logging.HttpLoggingInterceptor;
import rikka.material.app.DayNightDelegate;
public class App extends Application {
static {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
HiddenApiBypass.setHiddenApiExemptions("L");
}
}
public static final String TAG = "LSPosedManager";
@SuppressLint("StaticFieldLeak")
private static App instance = null;