Commit 321d11c2 authored by topjohnwu's avatar topjohnwu

Move Mapping class

parent ee447bc4
...@@ -9,6 +9,7 @@ import android.content.res.Configuration; ...@@ -9,6 +9,7 @@ import android.content.res.Configuration;
import android.os.Build; import android.os.Build;
import android.util.Log; import android.util.Log;
import com.topjohnwu.magisk.obfuscate.Mapping;
import com.topjohnwu.magisk.utils.DynamicClassLoader; import com.topjohnwu.magisk.utils.DynamicClassLoader;
import java.io.File; import java.io.File;
......
...@@ -14,6 +14,7 @@ import com.topjohnwu.magisk.dummy.DummyActivity; ...@@ -14,6 +14,7 @@ import com.topjohnwu.magisk.dummy.DummyActivity;
import com.topjohnwu.magisk.dummy.DummyProvider; import com.topjohnwu.magisk.dummy.DummyProvider;
import com.topjohnwu.magisk.dummy.DummyReceiver; import com.topjohnwu.magisk.dummy.DummyReceiver;
import com.topjohnwu.magisk.dummy.DummyService; import com.topjohnwu.magisk.dummy.DummyService;
import com.topjohnwu.magisk.obfuscate.Mapping;
import static com.topjohnwu.magisk.DownloadActivity.TAG; import static com.topjohnwu.magisk.DownloadActivity.TAG;
......
package com.topjohnwu.magisk; package com.topjohnwu.magisk.obfuscate;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import static com.topjohnwu.magisk.DynAPK.*; import static com.topjohnwu.magisk.DynAPK.*;
import static com.topjohnwu.magisk.R.drawable.*;
class Mapping { public class Mapping {
private static Map<String, String> map = new HashMap<>(); private static Map<String, String> map = new HashMap<>();
// This mapping will be sent into the guest app // This mapping will be sent into the guest app
static Data data = new Data(); public static Data data = new Data();
static { static {
map.put(a.z.class.getName(), "a.c"); map.put(a.z.class.getName(), "a.c");
...@@ -25,15 +26,15 @@ class Mapping { ...@@ -25,15 +26,15 @@ class Mapping {
data.componentMap.put(e.getValue(), e.getKey()); data.componentMap.put(e.getValue(), e.getKey());
} }
int[] res = new int[5]; int[] res = new int[5];
res[NOTIFICATION] = R.drawable.ic_magisk_outline; res[NOTIFICATION] = ic_magisk_outline;
res[SUPERUSER] = R.drawable.sc_superuser; res[SUPERUSER] = sc_superuser;
res[MAGISKHIDE] = R.drawable.sc_magiskhide; res[MAGISKHIDE] = sc_magiskhide;
res[DOWNLOAD] = R.drawable.sc_cloud_download; res[DOWNLOAD] = sc_cloud_download;
res[MODULES] = R.drawable.sc_extension; res[MODULES] = sc_extension;
data.resourceMap = res; data.resourceMap = res;
} }
static String get(String name) { public static String get(String name) {
String n = map.get(name); String n = map.get(name);
return n != null ? n : name; return n != null ? n : name;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment