私も同じような状況に陥りました。
私は単一のアプリを持っていましたが、さまざまな顧客向けに構築しました (リソース、プロパティなどの特定のカスタマイズがあります...)。最終的には、maven を使用してすべてを管理することにしました。
私が行ったことは、コードベースに「config」フォルダーを作成し、その中にプロの顧客に関連するプロパティ、文字列、写真を含むフォルダーを追加しました。
私の構造は次のようなものです:
MyAppBase
src/
build/
BaseAndroidManifest.xml
...
config/
customerA/
logo.png
customerA.xml
customerA.properties
customerB/
customerC/
...
コピー、移動、置換に Maven アーティファクトを使用して、次の方法で顧客固有の apk を構築することができました。
1) すべてのコードがコピーされる一時的な顧客固有のソース フォルダーを作成します。
<copy todir="src_${customer}">
<fileset dir="src"/>
</copy>
2) パッケージとインポートの名前を変更する
<!-- Rename main package -->
<move file="src_${customer}/ch/wizche/myapp" tofile="src_${customer}/ch/wizche/${customer}"/>
<!-- Replace package imports with the newly one -->
<replace dir="src_${customer}/" value="ch.wizche.${customer}">
<include name="**/*.java"/>
<replacetoken>ch.wizche.myapp</replacetoken>
</replace>
3) 顧客に基づいて特定のリソースを置き換えます
<!-- Copy images icon to the drawable folder -->
<copy file="./configs/${customer}/ic_launcher_l.png" tofile="./res/drawable-ldpi/ic_launcher.png" overwrite="true" verbose="true"/>
<copy file="./configs/${customer}/ic_launcher_m.png" tofile="./res/drawable-mdpi/ic_launcher.png" overwrite="true" verbose="true"/>
4) 「テンプレート」の AndroidManifest を置き換え、顧客のバージョン、名前などを注入する ...
<copy file="./BaseAndroidManifest.xml" tofile="./AndroidManifest.xml" overwrite="true" verbose="true"/>
<replace file="./AndroidManifest.xml" value="ch.wizche.${customer}" token="ch.wizche.myapp"/>
<replace file="./AndroidManifest.xml" value="android:versionCode="${versionCode}" token="android:versionCode="1"/>
5) 顧客エイリアスを使用した署名
6) APK のビルド
7) お客様一時フォルダの削除
したがって、顧客固有のアプリを構築するには、次のことを行う必要があります。
mvn install -Dcustomer=customerA -P release
これがあなたにいくつかのインプットを与えることを願っています。