diff --git a/bundle/src/ctrip/android/bundle/framework/Framework.java b/bundle/src/ctrip/android/bundle/framework/Framework.java index ab79fcf..e1a5c24 100644 --- a/bundle/src/ctrip/android/bundle/framework/Framework.java +++ b/bundle/src/ctrip/android/bundle/framework/Framework.java @@ -74,9 +74,9 @@ static void startup() throws BundleException { deleteDirectory(file); } file.mkdirs(); - - } else { storeProfile(); + } else { + restoreProfile(); } long endTimeMillis = System.currentTimeMillis() - currentTimeMillis; @@ -157,9 +157,7 @@ private static void storeProfile() { private static void storeMetadata() { try { DataOutputStream dataOutputStream = new DataOutputStream(new FileOutputStream(new File(STORAGE_LOCATION, "meta"))); - dataOutputStream.writeLong(nextBundleID); - dataOutputStream.flush(); dataOutputStream.close(); } catch (Throwable e) { @@ -173,7 +171,6 @@ private static int restoreProfile() { File file = new File(STORAGE_LOCATION, "meta"); if (file.exists()) { DataInputStream dataInputStream = new DataInputStream(new FileInputStream(file)); - int readInt = dataInputStream.readInt(); nextBundleID = dataInputStream.readLong(); dataInputStream.close(); File file2 = new File(STORAGE_LOCATION); @@ -190,7 +187,7 @@ private static int restoreProfile() { } i++; } - return readInt; + return 1; } // System.out.println("Profile not found, performing clean start ..."); log.log("Profile not found, performing clean start ...", Logger.LogLevel.DBUG); diff --git a/sample/src/ctrip/android/sample/BundleBaseApplication.java b/sample/src/ctrip/android/sample/BundleBaseApplication.java index c96ab24..05ad4a6 100644 --- a/sample/src/ctrip/android/sample/BundleBaseApplication.java +++ b/sample/src/ctrip/android/sample/BundleBaseApplication.java @@ -38,7 +38,7 @@ public void onCreate() { String lastBundleKey = sharedPreferences.getString("last_bundle_key", ""); bundleKey = buildBundleKey(); if (!TextUtils.equals(bundleKey, lastBundleKey)) { - properties.put("osgi.init", "true"); + properties.put("ctrip.bundle.init", "true"); isDexInstalled = false; HotPatchManager.getInstance().purge(); }