下面列出了android.app.Application#getDir ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
/**
* Enable hotswapping on an application instance. This call is not necessary if using {@link
* ExopackageApplication}. If enabling manually, make sure the app is set up to support the
* "modules" exopackage mode, and the initial call to {@link
* ExopackageDexLoader#loadExopackageJars(Context, boolean)} passed true as the second arg
*/
public static synchronized void setupHotswap(Application application) {
if (!sIsHotswapSetup) {
final File dexOptDir = application.getDir("exopackage_modular_dex_opt", Context.MODE_PRIVATE);
DelegatingClassLoader.getInstance().setDexOptDir(dexOptDir);
application.registerReceiver(
new ModularDexChangedReceiver(),
ModularDexChangedReceiver.getIntentFilter(application.getPackageName()));
sIsHotswapSetup = true;
}
}
private File getKeyStoreFile() {
Application app = getApplication(mContext);
File dir = app.getDir(KEYSTORE_DIR, Context.MODE_PRIVATE);
return new File(dir, KEYSTORE_FILE);
}