diff --git a/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/loader2/Loader.java b/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/loader2/Loader.java index aa054aa3..cbd6887f 100644 --- a/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/loader2/Loader.java +++ b/replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/loader2/Loader.java @@ -190,6 +190,12 @@ final boolean loadDex(ClassLoader parent, int load) { } mPackageInfo.applicationInfo.sourceDir = mPath; mPackageInfo.applicationInfo.publicSourceDir = mPath; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { + mPackageInfo.applicationInfo.dataDir = mContext.getDataDir().getAbsolutePath(); + } else { + String filesDir = mContext.getFilesDir().getAbsolutePath(); + mPackageInfo.applicationInfo.dataDir = filesDir.substring(0, filesDir.lastIndexOf('/')); + } if (TextUtils.isEmpty(mPackageInfo.applicationInfo.processName)) { mPackageInfo.applicationInfo.processName = mPackageInfo.applicationInfo.packageName;