title: Mismatch Dep Signature after Modifications on Android framework
body: <p>I modified some code in PackageManagerService.java in Android framework(Android 4.2). After a make, and start the emulator, it report the following error:</p>
  
  <pre><code>10-05 08:20:34.213: I/dalvikvm(575): DexOpt: mismatch dep signature for '/system/framework/core.odex'
  10-05 08:20:34.213: E/dalvikvm(575): /system/app/PackageInstaller.apk odex has stale dependencies
  10-05 08:20:34.213: E/dalvikvm(575): odex source not available -- failing
  10-05 08:20:34.223: W/PackageManager(575): StaleDexCacheError when reading apk: /system/app/PackageInstaller.apk
  10-05 08:20:34.223: W/PackageManager(575): dalvik.system.StaleDexCacheError: /system/app/PackageInstaller.apk
  10-05 08:20:34.223: W/PackageManager(575):  at dalvik.system.DexFile.isDexOptNeeded(Native Method)
  10-05 08:20:34.223: W/PackageManager(575):  at com.android.server.pm.PackageManagerService.performDexOptLI(PackageManagerService.java:3375)
  10-05 08:20:34.223: W/PackageManager(575):  at com.android.server.pm.PackageManagerService.scanPackageLI(PackageManagerService.java:3960)
  10-05 08:20:34.223: W/PackageManager(575):  at com.android.server.pm.PackageManagerService.scanPackageLI(PackageManagerService.java:3238)
  10-05 08:20:34.223: W/PackageManager(575):  at com.android.server.pm.PackageManagerService.scanDirLI(PackageManagerService.java:3017)
  10-05 08:20:34.223: W/PackageManager(575):  at com.android.server.pm.PackageManagerService.&lt;init&gt;(PackageManagerService.java:1058)
  10-05 08:20:34.223: W/PackageManager(575):  at com.android.server.pm.PackageManagerService.main(PackageManagerService.java:837)
  10-05 08:20:34.223: W/PackageManager(575):  at com.android.server.ServerThread.run(SystemServer.java:177)
  </code></pre>
  
  <p>If I clean and then make the full project again, it works ok. But it will report the same error after another modification. Since making a full build again will last a very long time, I prefer other solution. </p>
  
  <p>I noticed the code in DexPrepare.cpp:</p>
  
  <pre><code>if (memcmp(signature, ptr, kSHA1DigestLen) != 0) {  
      LOGI("DexOpt: mismatch dep signature for '%s'", cacheFileName);  
      goto bail;  
  }  
  </code></pre>
  
  <p>If I remove these lines of code, it will work. I used to work on Android 2.3, and there are still a signature checking in Android 2.3(Gingerbread), but after modifications on Gingerbread's framework, it will never report such errors. Why is that?</p>