Send bitmap to notifications and shortcuts

On API 23+, the platform unifies the way to handle drawable
resources across processes: all drawables can be passed via Icon.
This allows us to send raw bitmap to the system without the need to
specify a resource ID. This means that we are allowed to NOT include
these drawable resources within our stub APK, since our full APK can
draw the images programmatically and send raw bitmaps to the system.
This commit is contained in:
topjohnwu
2019-10-30 01:02:53 -04:00
parent 5e87483f34
commit fdf04f77f2
18 changed files with 152 additions and 110 deletions

View File

@ -3,8 +3,7 @@ package com.topjohnwu.magisk.obfuscate;
import java.util.HashMap;
import java.util.Map;
import static com.topjohnwu.magisk.DynAPK.*;
import static com.topjohnwu.magisk.R.drawable.*;
import static com.topjohnwu.magisk.DynAPK.Data;
public class Mapping {
private static Map<String, String> map = new HashMap<>();
@ -25,13 +24,6 @@ public class Mapping {
for (Map.Entry<String, String> e : map.entrySet()) {
data.componentMap.put(e.getValue(), e.getKey());
}
int[] res = new int[5];
res[NOTIFICATION] = ic_magisk_outline;
res[SUPERUSER] = sc_superuser;
res[MAGISKHIDE] = sc_magiskhide;
res[DOWNLOAD] = sc_cloud_download;
res[MODULES] = sc_extension;
data.resourceMap = res;
}
public static String get(String name) {