BobStore/tools/change-package-name.sh

25 lines
824 B
Bash
Raw Normal View History

2014-01-08 13:06:53 +01:00
#!/bin/bash -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.
## Arguments: org.your.fdroid "Your FDroid"
## org.your.fdroid will be the new package id
## "Your FDroid" will be the name of the application
2013-06-30 22:31:56 +02:00
FDROID_PACKAGE=${1:-org.your.fdroid}
FDROID_NAME=${2:-Your FDroid}
2013-06-30 22:34:42 +02:00
FDROID_PATH=${FDROID_PACKAGE//./\/}
2013-06-30 22:31:56 +02:00
mkdir -p "src/${FDROID_PATH}"
2013-06-30 22:31:56 +02:00
find src/org/fdroid/ res/ -type f |xargs -n 1 perl -pi -e"s/org.fdroid.fdroid(?=\W)/${FDROID_PACKAGE}/g"
perl -pi -e"s|org.fdroid.fdroid|${FDROID_PACKAGE}|g" AndroidManifest.xml
2013-06-30 22:31:56 +02:00
mv src/org/fdroid/fdroid/* src/${FDROID_PATH}/
rm -rf src/org/fdroid/fdroid/
2013-06-30 22:31:56 +02:00
find res/ -type f -print0 | xargs -0 sed -i "s/F-Droid/${FDROID_NAME}/g"