From dc9f69bab0a8d5d4cc8ca0f673d968c4b313240c Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Wed, 30 Oct 2019 04:15:53 -0400 Subject: [PATCH] Minor changes --- shared/proguard-rules.pro | 2 +- .../java/com/topjohnwu/magisk/DynAPK.java | 4 +-- stub/src/main/AndroidManifest.xml | 18 ++++++------- stub/src/main/java/a/{x.java => a.java} | 2 +- stub/src/main/java/a/{z.java => c.java} | 2 +- stub/src/main/java/a/{y.java => e.java} | 2 +- stub/src/main/java/a/{w.java => h.java} | 2 +- .../topjohnwu/magisk/DelegateApplication.java | 6 ++--- .../topjohnwu/magisk/obfuscate/Mapping.java | 26 ++++++++----------- 9 files changed, 30 insertions(+), 34 deletions(-) rename stub/src/main/java/a/{x.java => a.java} (57%) rename stub/src/main/java/a/{z.java => c.java} (59%) rename stub/src/main/java/a/{y.java => e.java} (58%) rename stub/src/main/java/a/{w.java => h.java} (62%) diff --git a/shared/proguard-rules.pro b/shared/proguard-rules.pro index e0a7aa840..708dc21be 100644 --- a/shared/proguard-rules.pro +++ b/shared/proguard-rules.pro @@ -20,6 +20,6 @@ # hide the original source file name. #-renamesourcefileattribute SourceFile --keepclassmembers class * implements javax.net.ssl.SSLSocketFactory { +-keepclassmembers class * extends javax.net.ssl.SSLSocketFactory { ** delegate; } diff --git a/shared/src/main/java/com/topjohnwu/magisk/DynAPK.java b/shared/src/main/java/com/topjohnwu/magisk/DynAPK.java index e7b69633a..648e054e1 100644 --- a/shared/src/main/java/com/topjohnwu/magisk/DynAPK.java +++ b/shared/src/main/java/com/topjohnwu/magisk/DynAPK.java @@ -50,7 +50,7 @@ public class DynAPK { public static Object pack(Data data) { Object[] arr = new Object[2]; - arr[STUB_VERSION_ENTRY] = STUB_VERSION; + arr[STUB_VERSION_ENTRY] = data.version; arr[COMPONENT_MAP] = data.componentMap; return arr; } @@ -64,7 +64,7 @@ public class DynAPK { } public static class Data { - public int version; + public int version = STUB_VERSION; public Map componentMap; } } diff --git a/stub/src/main/AndroidManifest.xml b/stub/src/main/AndroidManifest.xml index 729d39a19..6d3dcb4bd 100644 --- a/stub/src/main/AndroidManifest.xml +++ b/stub/src/main/AndroidManifest.xml @@ -16,8 +16,8 @@ @@ -25,7 +25,7 @@ @@ -37,24 +37,24 @@ @@ -70,7 +70,7 @@ map = new HashMap<>(); - // This mapping will be sent into the guest app - public static Data data = new Data(); - static { - map.put(a.z.class.getName(), "a.c"); - map.put("a.x", "a.f"); - map.put("a.o", "a.b"); - map.put("a.g", "a.m"); - map.put(a.w.class.getName(), "a.h"); - map.put("a.v", "a.j"); - map.put("a.j", "androidx.work.impl.background.systemjob.SystemJobService"); - - data.componentMap = new HashMap<>(map.size()); - for (Map.Entry e : map.entrySet()) { - data.componentMap.put(e.getValue(), e.getKey()); - } + map.put("a.x", "androidx.work.impl.background.systemjob.SystemJobService"); } public static String get(String name) { @@ -31,4 +17,14 @@ public class Mapping { return n != null ? n : name; } + public static Data data() { + Map componentMap = new HashMap<>(map.size()); + for (Map.Entry e : map.entrySet()) { + componentMap.put(e.getValue(), e.getKey()); + } + Data data = new Data(); + data.componentMap = componentMap; + return data; + } + }