Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(https://github.com/PnX-SI/gn_mobile_occtax/issues/264): name permissions from applicationId #47

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions commons/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
xmlns:android="http://schemas.android.com/apk/res/android">

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="fr.geonature.sync.permission.READ" />
<uses-permission android:name="fr.geonature.sync.permission.WRITE" />
<uses-permission android:name="${applicationId}.provider.permission.READ" />
<uses-permission android:name="${applicationId}.provider.permission.WRITE" />

<permission
android:name="fr.geonature.sync.permission.READ"
android:name="${applicationId}.provider.permission.READ"
android:protectionLevel="signature" />
<permission
android:name="fr.geonature.sync.permission.WRITE"
android:name="${applicationId}.provider.permission.WRITE"
android:protectionLevel="signature" />

</manifest>
4 changes: 0 additions & 4 deletions commons/src/main/res/values-fr/strings.xml

This file was deleted.

9 changes: 0 additions & 9 deletions commons/src/main/res/values/strings.xml

This file was deleted.

22 changes: 21 additions & 1 deletion docs/styles_themes.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,24 @@ Then, we can edit each `strings.xml` file and keep only the node containing the

Gradle will simply merge the default resources (`src/main/res`) with the resources of the variant
selected during the build. So you don't need to keep everything copied to the variant but just take
the resources we want to replace.
the resources we want to replace.

== Application ID

Changing the app name doesn't prevent conflicts with other Occtax applications. If you think your users may install and use your application alongside another Occtax applications, you may want to change it's ID in the `occtax/build.gradle` file, so that the terminal can understand it's a distinct application.

[source,gradle]
----
android {
// ...
defaultConfig {
applicationId "fr.geonature.myocctax"
// ...
}
// ...
}
----

Be aware that if you do so, your application will be treated by the user's terminal as a different app from any previous version. Opening the new apk will not launch an update of the existing app, but the installation of a new one. To obtain the new version, users will have to fully uninstall the previous version before. Therefore, it is preferable to make this change before you release your application.

Changing the ID also changes the repository where the application files are located (settings, local db). Don't forget to set the `gn_commons.t_mobile_apps.package` field accordingly in your GeoNature instance.