What is the original-package AndroidManifest attri

2019-04-18 14:13发布

问题:

I used apktool to extract the manifest of the default browser on Jelly Bean and this line appeared in the manifest--

  <manifest ... package="com.google.android.browser">
    <original-package android:name="com.android.browser" />
    ...
  </manifest>

Any idea what this is used for? The

回答1:

Check out attrs_manifest.xml in android/platform_frameworks_base source:

<!-- Private tag to declare the original package name that this package is
     based on.  Only used for packages installed in the system image.  If
     given, and different than the actual package name, and the given
     original package was previously installed on the device but the new
     one was not, then the data for the old one will be renamed to be
     for the new package.

     <p>This appears as a child tag of the root
     {@link #AndroidManifest manifest} tag. -->
<declare-styleable name="AndroidManifestOriginalPackage" parent="AndroidManifest">
    <attr name="name" />
</declare-styleable>

The comments should answer your question.



回答2:

I believe the original-package AndroidManifest attribute is used when the userID is not shared with any other package