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
|
||||
## F-Droid. This script also changes the app name, but DOESN'T change the
|
||||
## URLs of the default repos, or the icons.
|
||||
|
||||
#! /bin/sh
|
||||
NEW_PACKAGE=org.your.fdroid
|
||||
NEW_PATH=org/your/fdroid
|
||||
NEW_PROJ_NAME="Your App"
|
||||
mkdir -p src/org/your
|
||||
perl -pi -e"s|org/fdroid/fdroid/R.java|$NEW_PATH/R.java|g" build.xml
|
||||
find src/org/fdroid res -type f |xargs -n 1 perl -pi -e"s/org.fdroid.fdroid(?=\W)/$NEW_PACKAGE/g"
|
||||
perl -pi -e"s|org.fdroid.fdroid|$NEW_PACKAGE|g" AndroidManifest.xml
|
||||
mv src/org/fdroid/fdroid src/$NEW_PATH
|
||||
perl -pi -e"s|FDroid|$NEW_PROJ_NAME|g" build.xml
|
||||
find res/ -type f -print0 | xargs -0 sed -i 's/F-Droid/Your App/g'
|
||||
ant $@
|
||||
## Arguments: org.your.fdroid "Your FDroid"
|
||||
## org.your.fdroid will be the new package id
|
||||
## "Your FDroid" will be the name of the application
|
||||
|
||||
PACKAGE=${1:-org.your.fdroid}
|
||||
NAME=${2:-Your FDroid}
|
||||
PATH=${PACKAGE//./\/}
|
||||
|
||||
mkdir -p "src/$PATH"
|
||||
perl -pi -e"s|org/fdroid/fdroid/R.java|$PATH/R.java|g" build.xml
|
||||
|
||||
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