Skip to content

Commit

Permalink
Merge pull request #81 from beeware/revert-80-revert-79-permissions
Browse files Browse the repository at this point in the history
Restore "Add extension points for permissions."
  • Loading branch information
mhsmith authored Jan 15, 2024
2 parents 97eb0e2 + aab0554 commit 652a537
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 9 deletions.
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ repos:
- id: check-yaml
- id: check-json
- id: check-xml
exclude: AndroidManifest.xml
- id: check-case-conflict
- id: end-of-file-fixer
- id: trailing-whitespace
11 changes: 10 additions & 1 deletion cookiecutter.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,19 @@
"primary_color_dark": "#00574B",
"accent_color": "#D81B60",
"splash_background_color": "#FFFFFF",
"permissions": "",
"features": "",
"version": "1.0",
"version_code": "10000",
"python_version": "3.X.0",
"extract_packages" : "",
"build_gradle_extra_content": "",
"android_manifest_attrs_extra_content": "",
"android_manifest_extra_content": "",
"android_manifest_application_attrs_extra_content": "",
"android_manifest_application_extra_content": "",
"android_manifest_activity_attrs_extra_content": "",
"android_manifest_activity_extra_content": "",
"_copy_without_render": [
"gradlew",
"gradle.bat",
Expand All @@ -24,6 +32,7 @@
"*.png"
],
"_extensions": [
"briefcase.integrations.cookiecutter.PythonVersionExtension"
"briefcase.integrations.cookiecutter.PythonVersionExtension",
"briefcase.integrations.cookiecutter.XMLExtension"
]
}
22 changes: 14 additions & 8 deletions {{ cookiecutter.format }}/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,25 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<manifest xmlns:android="http://schemas.android.com/apk/res/android" {{ cookiecutter.android_manifest_attrs_extra_content }}>
{%- for permission in cookiecutter.permissions %}
<uses-permission android:name="{{ permission }}" />
{%- endfor %}
{%- for feature, value in cookiecutter.features.items() %}
<uses-feature android:name="{{ feature }}" android:required="{{ value|bool_attr }}" />
{%- endfor %}
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/formal_name"
android:networkSecurityConfig="@xml/network_security_config"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme.Launcher">
<!-- https://developer.android.com/guide/topics/resources/runtime-changes#HandlingTheChange -->
<activity
android:theme="@style/AppTheme.Launcher" {{ cookiecutter.android_manifest_application_attrs_extra_content }}>
<!-- https://developer.android.com/guide/topics/resources/runtime-changes#HandlingTheChange -->
<activity
android:configChanges="orientation|screenSize|screenLayout|keyboardHidden"
android:name="org.beeware.android.MainActivity"
android:exported="true">
android:exported="true" {{ cookiecutter.android_manifest_activity_attrs_extra_content }}>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
{{ cookiecutter.android_manifest_activity_extra_content }}
</activity>
{{ cookiecutter.android_manifest_application_extra_content }}
</application>

{{ cookiecutter.android_manifest_extra_content }}
</manifest>

0 comments on commit 652a537

Please sign in to comment.