Compare commits
	
		
			1 Commits
		
	
	
		
			renovate/c
			...
			62ef309f25
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 62ef309f25 | 
| @@ -42,20 +42,20 @@ jobs: | |||||||
|     - run: flutter pub get |     - run: flutter pub get | ||||||
|       working-directory: ./frontend |       working-directory: ./frontend | ||||||
|  |  | ||||||
|     - run: flutter build apk --release --split-per-abi |     - name: Add required secrets | ||||||
|  |       run: | | ||||||
|  |         echo ${{ secrets.ANDROID_SECRETS_BASE64 }} | base64 -d > android/secrets.properties | ||||||
|       working-directory: ./frontend |       working-directory: ./frontend | ||||||
|  |  | ||||||
|     - name: Release APK |     - run: flutter build apk --release --split-per-abi --build-number=${{ gitea.run_number }} | ||||||
|       uses: https://gitea.com/akkuman/gitea-release-action@v1 |       working-directory: ./frontend | ||||||
|       with: |  | ||||||
|         files: ./frontend/build/app/outputs/flutter-apk/*.apk |     - name: Upload APKs to artifacts | ||||||
|         name: Testing release |       uses: https://gitea.com/actions/upload-artifact@v4 | ||||||
|         release_name: testing |       with: | ||||||
|         tag: testing |         name: app-release | ||||||
|         tag_name: testing |         path: frontend/build/app/outputs/flutter-apk/ | ||||||
|         release_body: "This is a testing release." |         if-no-files-found: error | ||||||
|         prerelease: true |         retention-days: 15 | ||||||
|         token: ${{ secrets.GITEA_TOKEN }} |  | ||||||
|       env: |  | ||||||
|         NODE_OPTIONS: '--experimental-fetch' |  | ||||||
|        |        | ||||||
|   | |||||||
							
								
								
									
										1
									
								
								frontend/android/.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								frontend/android/.gitignore
									
									
									
									
										vendored
									
									
								
							| @@ -4,6 +4,7 @@ gradle-wrapper.jar | |||||||
| /gradlew | /gradlew | ||||||
| /gradlew.bat | /gradlew.bat | ||||||
| /local.properties | /local.properties | ||||||
|  | /secrets.properties | ||||||
| GeneratedPluginRegistrant.java | GeneratedPluginRegistrant.java | ||||||
|  |  | ||||||
| # Remember to never publicly share your keystore. | # Remember to never publicly share your keystore. | ||||||
|   | |||||||
							
								
								
									
										48
									
								
								frontend/android/README.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										48
									
								
								frontend/android/README.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,48 @@ | |||||||
|  | ## Android Setup | ||||||
|  |  | ||||||
|  | ### Keystore setup | ||||||
|  | ```bash | ||||||
|  | keytool -genkey -v -keystore release.keystore -keyalg RSA -keysize 2048 -validity 10000 -alias release | ||||||
|  | ``` | ||||||
|  | - This is required to store local credentials securely (not used for now). | ||||||
|  | - But necesseary in order to restrict the particular api key to a particular app (through the sha1 of the associated keystore). | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ### Building and secret credentials | ||||||
|  | Following the guide under [https://developers.google.com/maps/flutter-package/config#android_1](https://developers.google.com/maps/flutter-package/config#android_1). | ||||||
|  | - Add the following to `android/build.gradle`: | ||||||
|  |     ```gradle | ||||||
|  |     buildscript { | ||||||
|  |         dependencies { | ||||||
|  |             classpath "com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:2.0.1" | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  |     ``` | ||||||
|  | - Add the following to `android/app/build.gradle`: | ||||||
|  |     ```gradle | ||||||
|  |     plugins { | ||||||
|  |         // ... | ||||||
|  |         id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin' | ||||||
|  |     } | ||||||
|  |     ``` | ||||||
|  | - Add the credentials to `android/secrets.properties`: | ||||||
|  |     ```properties | ||||||
|  |     MAPS_API_KEY=YOUR_API_KEY | ||||||
|  |     ``` | ||||||
|  | - Reference the credentials in `android/app/src/main/AndroidManifest.xml`: | ||||||
|  |     ```xml | ||||||
|  |     <meta-data | ||||||
|  |         android:name="com.google.android.geo.API_KEY" | ||||||
|  |         android:value="${MAPS_API_KEY}" /> | ||||||
|  |     ``` | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ### Using the credentials in CI | ||||||
|  | - Add the base64 encoded credentials to the repository secrets (e.g. `ANDROID_SECRETS`). | ||||||
|  |     ```bash | ||||||
|  |     base64 -i android/secrets.properties | ||||||
|  |     ``` | ||||||
|  | - Use the following in the CI script: | ||||||
|  |     ```bash | ||||||
|  |     echo {{ secrets.ANDROID_SECRETS }} | base64 -d > android/secrets.properties | ||||||
|  |     ``` | ||||||
| @@ -2,6 +2,8 @@ plugins { | |||||||
|     id "com.android.application" |     id "com.android.application" | ||||||
|     id "kotlin-android" |     id "kotlin-android" | ||||||
|     id "dev.flutter.flutter-gradle-plugin" |     id "dev.flutter.flutter-gradle-plugin" | ||||||
|  |     id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin' | ||||||
|  |  | ||||||
| } | } | ||||||
|  |  | ||||||
| def localProperties = new Properties() | def localProperties = new Properties() | ||||||
|   | |||||||
| @@ -32,7 +32,7 @@ | |||||||
|         /> |         /> | ||||||
|         <meta-data |         <meta-data | ||||||
|             android:name="com.google.android.geo.API_KEY" |             android:name="com.google.android.geo.API_KEY" | ||||||
|             android:value="AIzaSyCeWk_D2xvfOHLidvV56EZeQCUybypEntw" |             android:value="${MAPS_API_KEY}" | ||||||
|         /> |         /> | ||||||
|  |  | ||||||
|  |  | ||||||
|   | |||||||
| @@ -16,3 +16,14 @@ subprojects { | |||||||
| tasks.register("clean", Delete) { | tasks.register("clean", Delete) { | ||||||
|     delete rootProject.buildDir |     delete rootProject.buildDir | ||||||
| } | } | ||||||
|  |  | ||||||
|  | buildscript { | ||||||
|  |     repositories { | ||||||
|  |         google() | ||||||
|  |         mavenCentral() | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     dependencies { | ||||||
|  |         classpath "com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:2.0.1" | ||||||
|  |     } | ||||||
|  | } | ||||||
		Reference in New Issue
	
	Block a user