Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to build Different Android Apps using ant scripts

Tags:

android

ant

Hello i'm building a custom application. PRE:

  • The app will be restricted to a limited amount of user. ( let's say 20 people )
  • The app should be unique per each user so each apk will refer to a user only.
  • Each app should have a different package name

So i was starting to think a building script that takes the user list and creates 20 apks ( one for each user ) and updates the strings.xml file with the custom modification needed per-user.

But i really don't know where to start. Is there a good way or a tutorial where i can refer to ?

Just to be clear i'd like to have a manifest like this:

 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="$pname"
    android:versionCode="1"
    android:versionName="1.0">
        <application>...</application>
    </manifest>

And then replace the $pname using ant.

like image 708
Andrea Baccega Avatar asked Jan 29 '26 07:01

Andrea Baccega


1 Answers

Perhaps you are looking for the aapt command. It has an additional flag --rename-manifest-package. The help says

 Rewrite the manifest so that its package name is the package name
 given here.  Relative class names (for example .Foo) will be
 changed to absolute names with the old package so that the code
 does not need to change.
like image 148
Vino Avatar answered Jan 30 '26 20:01

Vino



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!