From a7fa9d8a97024434f136e5789c528a6813316ea1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Wed, 14 Oct 2020 15:48:18 +0200 Subject: [PATCH] feat(pwa) update generated Android project --- twa/app/build.gradle | 34 ++++++++++++-------- twa/app/src/main/AndroidManifest.xml | 2 ++ twa/gradle/wrapper/gradle-wrapper.properties | 3 +- twa/twa-manifest.json | 6 ++-- 4 files changed, 27 insertions(+), 18 deletions(-) diff --git a/twa/app/build.gradle b/twa/app/build.gradle index a764cd932..cba11e374 100644 --- a/twa/app/build.gradle +++ b/twa/app/build.gradle @@ -24,12 +24,12 @@ def twaManifest = [ launchUrl: '/', // The start path for the TWA. Must be relative to the domain. name: 'Jitsi Meet', // The application name. launcherName: 'Jitsi Meet', // The name shown on the Android Launcher. - themeColor: '#2A3A4B', // The color used for the status bar. + themeColor: '#17A0DB', // The color used for the status bar. navigationColor: '#000000', // The color used for the navigation bar. navigationColorDark: '#000000', // The color used for the dark navbar. navigationDividerColor: '#000000', // The navbar divider color. navigationDividerColorDark: '#000000', // The dark navbar divider color. - backgroundColor: '#2A3A4B', // The color used for the splash screen background. + backgroundColor: '#17A0DB', // The color used for the splash screen background. enableNotifications: false, // Set to true to enable notification delegation. // Every shortcut must include the following fields: // - name: String that will show up in the shortcut. @@ -46,14 +46,20 @@ def twaManifest = [ enableSiteSettingsShortcut: 'true', ] +// Use the number of seconds/10 since Jan 1 2019 as the versionCode. +// This lets us upload a new build at most every 10 seconds for the +// next ~680 years. +// https://stackoverflow.com/a/38643838 +def vcode = (int) (((new Date().getTime() / 1000) - 1546297200) / 10) + android { compileSdkVersion 29 defaultConfig { applicationId "org.jitsi.meet" minSdkVersion 19 targetSdkVersion 29 - versionCode 1 - versionName "1" + versionCode vcode + versionName "20.5.0" // The name for the application resValue "string", "appName", twaManifest.name @@ -65,12 +71,12 @@ android { def launchUrl = "https://" + twaManifest.hostName + twaManifest.launchUrl resValue "string", "launchUrl", launchUrl - + // The URL the Web Manifest for the Progressive Web App that the TWA points to. This // is used by Chrome OS to open the Web version of the PWA instead of the TWA, as it // will probably give a better user experience for non-mobile devices. - resValue "string", "webManifestUrl", 'https://alpha.jitsi.net/static/pwa/manifest.json' - + resValue "string", "webManifestUrl", 'https://meet.jit.si/static/pwa/manifest.json' + // The hostname is used when building the intent-filter, so the TWA is able to // handle Intents to open https://svgomg.firebaseapp.com. @@ -100,13 +106,13 @@ android { // compile. If not set, the navigation bar color defaults to #000000 - black. resValue "color", "navigationColorDark", twaManifest.navigationColorDark - // This attribute sets the navbar divider color for the TWA. It can be either - // set here or in `res/values/colors.xml`. Setting in both places is an error and the app + // This attribute sets the navbar divider color for the TWA. It can be either + // set here or in `res/values/colors.xml`. Setting in both places is an error and the app // will not compile. If not set, the divider color defaults to #00000000 - transparent. resValue "color", "navigationDividerColor", twaManifest.navigationDividerColor - // This attribute sets the dark navbar divider color for the TWA. It can be either - // set here or in `res/values/colors.xml`. Setting in both places is an error and the + // This attribute sets the dark navbar divider color for the TWA. It can be either + // set here or in `res/values/colors.xml`. Setting in both places is an error and the //app will not compile. If not set, the divider color defaults to #000000 - black. resValue "color", "navigationDividerColorDark", twaManifest.navigationDividerColorDark @@ -186,11 +192,11 @@ task generateShorcutsFile { preBuild.dependsOn(generateShorcutsFile) repositories { - + } dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') - - implementation 'com.google.androidbrowserhelper:androidbrowserhelper:2.0.0' + + implementation 'com.google.androidbrowserhelper:androidbrowserhelper:2.0.0' } diff --git a/twa/app/src/main/AndroidManifest.xml b/twa/app/src/main/AndroidManifest.xml index 287798a51..ddc4c5a4a 100644 --- a/twa/app/src/main/AndroidManifest.xml +++ b/twa/app/src/main/AndroidManifest.xml @@ -25,6 +25,8 @@ + +