change-package-name changes:
- It now takes two arguments, new package ID and new package name - Source path is now resolved from the package ID - Add -x so that executed commands are seen on screen
This commit is contained in:
parent
048eca0457
commit
bd906c2f68
33
tools/change-package-name.sh
Normal file → Executable file
33
tools/change-package-name.sh
Normal file → Executable file
@ -1,17 +1,26 @@
|
|||||||
|
#!/bin/sh -x
|
||||||
|
|
||||||
## For changing the package name so that your app can be installed alongside
|
## For changing the package name so that your app can be installed alongside
|
||||||
## F-Droid. This script also changes the app name, but DOESN'T change the
|
## F-Droid. This script also changes the app name, but DOESN'T change the
|
||||||
## URLs of the default repos, or the icons.
|
## URLs of the default repos, or the icons.
|
||||||
|
|
||||||
#! /bin/sh
|
## Arguments: org.your.fdroid "Your FDroid"
|
||||||
NEW_PACKAGE=org.your.fdroid
|
## org.your.fdroid will be the new package id
|
||||||
NEW_PATH=org/your/fdroid
|
## "Your FDroid" will be the name of the application
|
||||||
NEW_PROJ_NAME="Your App"
|
|
||||||
mkdir -p src/org/your
|
PACKAGE=${1:-org.your.fdroid}
|
||||||
perl -pi -e"s|org/fdroid/fdroid/R.java|$NEW_PATH/R.java|g" build.xml
|
NAME=${2:-Your FDroid}
|
||||||
find src/org/fdroid res -type f |xargs -n 1 perl -pi -e"s/org.fdroid.fdroid(?=\W)/$NEW_PACKAGE/g"
|
PATH=${PACKAGE//./\/}
|
||||||
perl -pi -e"s|org.fdroid.fdroid|$NEW_PACKAGE|g" AndroidManifest.xml
|
|
||||||
mv src/org/fdroid/fdroid src/$NEW_PATH
|
mkdir -p "src/$PATH"
|
||||||
perl -pi -e"s|FDroid|$NEW_PROJ_NAME|g" build.xml
|
perl -pi -e"s|org/fdroid/fdroid/R.java|$PATH/R.java|g" build.xml
|
||||||
find res/ -type f -print0 | xargs -0 sed -i 's/F-Droid/Your App/g'
|
|
||||||
ant $@
|
find src/org/fdroid/ res/ -type f |xargs -n 1 perl -pi -e"s/org.fdroid.fdroid(?=\W)/$PACKAGE/g"
|
||||||
|
perl -pi -e"s|org.fdroid.fdroid|$PACKAGE|g" AndroidManifest.xml
|
||||||
|
|
||||||
|
mv src/org/fdroid/fdroid/* src/$PATH/
|
||||||
|
rm -rf src/org/fdroid/fdroid/
|
||||||
|
|
||||||
|
perl -pi -e"s|FDroid|$NAME|g" build.xml
|
||||||
|
find res/ -type f -print0 | xargs -0 sed -i "s/F-Droid/$NAME/g"
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user