Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(411)

Side by Side Diff: build/android/incremental_install/java/org/chromium/incrementalinstall/BootstrapApplication.java

Issue 2499923003: Disable access to secondary dex files. (Closed)
Patch Set: Findbugs Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.incrementalinstall; 5 package org.chromium.incrementalinstall;
6 6
7 import android.app.Application; 7 import android.app.Application;
8 import android.app.Instrumentation; 8 import android.app.Instrumentation;
9 import android.content.ComponentName; 9 import android.content.ComponentName;
10 import android.content.Context; 10 import android.content.Context;
11 import android.content.pm.ApplicationInfo; 11 import android.content.pm.ApplicationInfo;
12 import android.content.pm.PackageManager; 12 import android.content.pm.PackageManager;
13 import android.content.pm.PackageManager.NameNotFoundException; 13 import android.content.pm.PackageManager.NameNotFoundException;
14 import android.os.Bundle; 14 import android.os.Bundle;
15 import android.util.Log; 15 import android.util.Log;
16 16
17 import org.chromium.base.Reflect;
18
17 import java.io.File; 19 import java.io.File;
18 import java.lang.ref.WeakReference; 20 import java.lang.ref.WeakReference;
19 import java.util.List; 21 import java.util.List;
20 import java.util.Map; 22 import java.util.Map;
21 23
22 /** 24 /**
23 * An Application that replaces itself with another Application (as defined in 25 * An Application that replaces itself with another Application (as defined in
24 * an AndroidManifext.xml meta-data tag). It loads the other application only 26 * an AndroidManifext.xml meta-data tag). It loads the other application only
25 * after side-loading its .so and .dex files from /data/local/tmp. 27 * after side-loading its .so and .dex files from /data/local/tmp.
26 * 28 *
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 for (Map.Entry<String, WeakReference<?>> entry : packageMap.entrySet ()) { 275 for (Map.Entry<String, WeakReference<?>> entry : packageMap.entrySet ()) {
274 Object loadedApk = entry.getValue().get(); 276 Object loadedApk = entry.getValue().get();
275 if (loadedApk != null && Reflect.getField(loadedApk, "mApplicati on") == this) { 277 if (loadedApk != null && Reflect.getField(loadedApk, "mApplicati on") == this) {
276 Reflect.setField(loadedApk, "mApplication", mRealApplication ); 278 Reflect.setField(loadedApk, "mApplication", mRealApplication );
277 Reflect.setField(mRealApplication, "mLoadedApk", loadedApk); 279 Reflect.setField(mRealApplication, "mLoadedApk", loadedApk);
278 } 280 }
279 } 281 }
280 } 282 }
281 } 283 }
282 } 284 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698