How can I change and republish an AOSP application?

I am annoyed by the simple feature that is missing from the Android email application. Since this application is released as open source , I can fix this quite easily.

Question: How can I cancel this modification so that I and other users can install the modified EMail application (without root access)? I tried the following:

  • With many copies, I was able to create an EMail application with the standard Eclipse / ant toolchain and without the ASOP toolchain that uses make scripts.
  • Installing this application now leads to an error because the package is already installed (obviously, and I do not have keys for singing to update)
  • Disabling the EMail application on the device also does not help, I still can not install a new application.

Although I’m about changing the name of the application package in the manifest, it’s not so simple: you also need to move all the classes to the new package. In addition, as you can see in AndroidManifest , the application defines new permissions ( com.android.email.permission.READ_ATTACHMENT ) and other things that lead to duplication errors when installing a modified package. These permissions are links in the form of strings in the source.

Modifies each file manually and then debugs every error, is it really the only solution to my problem? These changes will also make it difficult to work with newer versions of the EMail application, as I modified and moved each file.

+6
source share
2 answers

I though about changing the name of the application package in the manifest

It will be required.

You also need to move all classes to a new package.

Not necessary. R will be generated in the package declared in the manifest, and so you will need to organize the import of this class R And you will need to update the manifest itself to use fully qualified class names, rather than bare class names, if applicable.

In addition, as you can see in AndroidManifest, the application defines new permissions (com.android.email.permission.READ_ATTACHMENT) and other things that lead to duplication errors when installing a modified package.

You can fully determine the existing resolution. I have no idea where / how you get "duplication errors."

Modifies each file manually and then debugs every error, is it really the only solution to my problem?

More or less. See paragraph β€œoptional” above.

These modifications will also make it difficult to work with new versions of the EMail application, as I modified and moved each file.

It was you who decided to start this quest, and not make changes to an existing open source application, such as K-9 Mail (which also deployed the AOSP Email application, years ago) or the AOSP Email application directly (through the AOSP submission process ).

+3
source

This question may be outdated, but I thought I would share what I did for posterity. I was able to use the above information to change the source of the browser and create my own version of the application (which can be installed in parallel with the stock application). What I've done:

  • In the manifest, change the package name
  • In the parameters res-> values-> change the application label (this is just for convenience, so as not to have 2 applications with the same name)
  • In the manifest, remove the original-package attribute (may not be required).
  • In the manifest, change the provider credentials (to match my new package name)
  • Ensure that all class names in the manifest are fully qualified.

At the last stage, several attempts were made, but this is just a matter of building, installing, starting and checking LogCat for erroneous links.

+2
source

All Articles