mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-10-19 05:41:59 +00:00
Use VERSION_CODES instead of raw numbers
This commit is contained in:
@@ -186,7 +186,7 @@ public class DownloadActivity extends Activity {
|
||||
}
|
||||
|
||||
private void loadResources() throws Exception {
|
||||
if (Build.VERSION.SDK_INT >= 30) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
|
||||
var fd = Os.memfd_create("res.apk", 0);
|
||||
try {
|
||||
decryptResources(new FileOutputStream(fd));
|
||||
|
@@ -104,7 +104,7 @@ public class DynLoad {
|
||||
// Dynamically load APK and create the Application instance from the loaded APK
|
||||
static Application createAndSetupApp(Application context) {
|
||||
// On API >= 29, AppComponentFactory will replace the ClassLoader for us
|
||||
if (Build.VERSION.SDK_INT < 29)
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q)
|
||||
replaceClassLoader(context);
|
||||
|
||||
// noinspection InlinedApi
|
||||
@@ -145,7 +145,7 @@ public class DynLoad {
|
||||
.newInstance(data.getObject());
|
||||
|
||||
// Create the receiver component factory
|
||||
if (Build.VERSION.SDK_INT >= 28 && componentFactory != null) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P && componentFactory != null) {
|
||||
Object factory = cl.loadClass(appInfo.appComponentFactory).newInstance();
|
||||
var delegate = (DelegateComponentFactory) componentFactory;
|
||||
delegate.receiver = (AppComponentFactory) factory;
|
||||
|
Reference in New Issue
Block a user