Obfuscate WorkManager components

Remove unused components and hack the context sent into WorkManager
This commit is contained in:
topjohnwu
2019-10-16 17:03:55 -04:00
parent a910c8ccd8
commit 9f9de8c43b
17 changed files with 295 additions and 212 deletions

View File

@ -75,36 +75,14 @@
android:name="com.google.android.gms.version"
android:value="12451000" />
<!-- WorkManager -->
<provider
android:name="androidx.work.impl.WorkManagerInitializer"
android:authorities="${applicationId}.workmanager-init"
android:directBootAware="false"
android:exported="false"
android:multiprocess="true"
tools:targetApi="n" />
<!-- WorkManager SystemJobService -->
<service
android:name="androidx.work.impl.background.systemjob.SystemJobService"
android:name="a.j"
android:directBootAware="false"
android:enabled="true"
android:exported="true"
android:permission="android.permission.BIND_JOB_SERVICE"
tools:targetApi="n" />
<receiver
android:name="androidx.work.impl.utils.ForceStopRunnable$BroadcastReceiver"
android:directBootAware="false"
android:enabled="true"
android:exported="false"
tools:targetApi="n" />
<!-- Room -->
<service
android:name="androidx.room.MultiInstanceInvalidationService"
android:exported="false" />
android:permission="android.permission.BIND_JOB_SERVICE" />
</application>

View File

@ -4,7 +4,7 @@ import java.util.HashMap;
import java.util.Map;
class ComponentMap {
private static Map<String, String> map = new HashMap<>(6);
private static Map<String, String> map = new HashMap<>();
// This mapping will be sent into the guest app
static Map<String, String> inverseMap;
@ -16,7 +16,7 @@ class ComponentMap {
map.put("a.g", "a.m");
map.put(a.w.class.getName(), "a.h");
map.put("a.v", "a.j");
map.put("a.s", "androidx.work.impl.WorkManagerInitializer");
map.put("a.j", "androidx.work.impl.background.systemjob.SystemJobService");
inverseMap = new HashMap<>(map.size());
for (Map.Entry<String, String> e : map.entrySet()) {