commit 84bc3cb6ad386baf9323d253f59418a777628912 Author: Condorra Date: Fri Feb 17 14:43:57 2023 +1100 Initial bubblewrap setup diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..81db899 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +.gradle +app/build +app-release-unsigned-aligned.apk +app-release-bundle.aab +app-release-signed.apk +app-release-signed.apk.idsig diff --git a/app/build.gradle b/app/build.gradle new file mode 100644 index 0000000..70a8fa2 --- /dev/null +++ b/app/build.gradle @@ -0,0 +1,202 @@ +/* + * Copyright 2019 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import groovy.xml.MarkupBuilder + +plugins { + id 'com.android.application' +} + +def twaManifest = [ + applicationId: 'org.blastmud.game', + hostName: 'www.blastmud.org', // The domain being opened in the TWA. + launchUrl: '/game.html?source=android', // The start path for the TWA. Must be relative to the domain. + name: 'Blastmud', // The application name. + launcherName: 'Blastmud', // The name shown on the Android Launcher. + themeColor: '#FFFFFF', // 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: '#000000', // The color used for the splash screen background. + enableNotifications: true, // Set to true to enable notification delegation. + // Every shortcut must include the following fields: + // - name: String that will show up in the shortcut. + // - short_name: Shorter string used if |name| is too long. + // - url: Absolute path of the URL to launch the app with (e.g '/create'). + // - icon: Name of the resource in the drawable folder to use as an icon. + shortcuts: [], + // The duration of fade out animation in milliseconds to be played when removing splash screen. + splashScreenFadeOutDuration: 300, + generatorApp: 'bubblewrap-cli', // Application that generated the Android Project + // The fallback strategy for when Trusted Web Activity is not avilable. Possible values are + // 'customtabs' and 'webview'. + fallbackType: 'customtabs', + enableSiteSettingsShortcut: 'true', + orientation: 'user', +] + +android { + compileSdkVersion 31 + defaultConfig { + applicationId "org.blastmud.game" + minSdkVersion 19 + targetSdkVersion 31 + versionCode 2 + versionName "2" + + // The name for the application + resValue "string", "appName", twaManifest.name + + // The name for the application on the Android Launcher + resValue "string", "launcherName", twaManifest.launcherName + + // The URL that will be used when launching the TWA from the Android Launcher + 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 and Meta Quest 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://www.blastmud.org/manifest.json' + + + + // This is used by Meta Quest. + resValue "string", "fullScopeUrl", 'https://www.blastmud.org/' + + + + + // The hostname is used when building the intent-filter, so the TWA is able to + // handle Intents to open https://svgomg.firebaseapp.com. + resValue "string", "hostName", twaManifest.hostName + + // This attribute sets the status bar 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 status bar color defaults to #FFFFFF - white. + resValue "color", "colorPrimary", twaManifest.themeColor + + // This attribute sets the navigation bar 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 navigation bar color defaults to #FFFFFF - white. + resValue "color", "navigationColor", twaManifest.navigationColor + + // This attribute sets the dark navigation bar 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 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 + // 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 + //app will not compile. If not set, the divider color defaults to #000000 - black. + resValue "color", "navigationDividerColorDark", twaManifest.navigationDividerColorDark + + // Sets the color for the background used for the splash screen when launching the + // Trusted Web Activity. + resValue "color", "backgroundColor", twaManifest.backgroundColor + + // Defines a provider authority fot the Splash Screen + resValue "string", "providerAuthority", twaManifest.applicationId + '.fileprovider' + + // The enableNotification resource is used to enable or disable the + // TrustedWebActivityService, by changing the android:enabled and android:exported + // attributes + resValue "bool", "enableNotification", twaManifest.enableNotifications.toString() + + twaManifest.shortcuts.eachWithIndex { shortcut, index -> + resValue "string", "shortcut_name_$index", "$shortcut.name" + resValue "string", "shortcut_short_name_$index", "$shortcut.short_name" + } + + // The splashScreenFadeOutDuration resource is used to set the duration of fade out animation in milliseconds + // to be played when removing splash screen. The default is 0 (no animation). + resValue "integer", "splashScreenFadeOutDuration", twaManifest.splashScreenFadeOutDuration.toString() + + resValue "string", "generatorApp", twaManifest.generatorApp + + resValue "string", "fallbackType", twaManifest.fallbackType + + resValue "bool", "enableSiteSettingsShortcut", twaManifest.enableSiteSettingsShortcut + resValue "string", "orientation", twaManifest.orientation + } + buildTypes { + release { + minifyEnabled true + } + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + lintOptions { + checkReleaseBuilds false + } +} + +task generateShorcutsFile { + assert twaManifest.shortcuts.size() < 5, "You can have at most 4 shortcuts." + twaManifest.shortcuts.eachWithIndex { s, i -> + assert s.name != null, 'Missing `name` in shortcut #' + i + assert s.short_name != null, 'Missing `short_name` in shortcut #' + i + assert s.url != null, 'Missing `icon` in shortcut #' + i + assert s.icon != null, 'Missing `url` in shortcut #' + i + } + + def shortcutsFile = new File("$projectDir/src/main/res/xml", "shortcuts.xml") + + def xmlWriter = new StringWriter() + def xmlMarkup = new MarkupBuilder(new IndentPrinter(xmlWriter, " ", true)) + + xmlMarkup + .'shortcuts'('xmlns:android': 'http://schemas.android.com/apk/res/android') { + twaManifest.shortcuts.eachWithIndex { s, i -> + 'shortcut'( + 'android:shortcutId': 'shortcut' + i, + 'android:enabled': 'true', + 'android:icon': '@drawable/' + s.icon, + 'android:shortcutShortLabel': '@string/shortcut_short_name_' + i, + 'android:shortcutLongLabel': '@string/shortcut_name_' + i) { + 'intent'( + 'android:action': 'android.intent.action.MAIN', + 'android:targetPackage': twaManifest.applicationId, + 'android:targetClass': twaManifest.applicationId + '.LauncherActivity', + 'android:data': s.url) + 'categories'('android:name': 'android.intent.category.LAUNCHER') + } + } + } + shortcutsFile.text = xmlWriter.toString() + '\n' +} + +preBuild.dependsOn(generateShorcutsFile) + +repositories { + +} + +dependencies { + implementation fileTree(include: ['*.jar'], dir: 'libs') + + implementation 'com.google.androidbrowserhelper:androidbrowserhelper:2.4.0' + +} diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..21bcf67 --- /dev/null +++ b/app/src/main/AndroidManifest.xml @@ -0,0 +1,175 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/java/org/blastmud/game/Application.java b/app/src/main/java/org/blastmud/game/Application.java new file mode 100644 index 0000000..867b9dd --- /dev/null +++ b/app/src/main/java/org/blastmud/game/Application.java @@ -0,0 +1,29 @@ +/* + * Copyright 2020 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.blastmud.game; + + + +public class Application extends android.app.Application { + + + + @Override + public void onCreate() { + super.onCreate(); + + } +} diff --git a/app/src/main/java/org/blastmud/game/DelegationService.java b/app/src/main/java/org/blastmud/game/DelegationService.java new file mode 100644 index 0000000..f63333d --- /dev/null +++ b/app/src/main/java/org/blastmud/game/DelegationService.java @@ -0,0 +1,14 @@ +package org.blastmud.game; + + + +public class DelegationService extends + com.google.androidbrowserhelper.trusted.DelegationService { + @Override + public void onCreate() { + super.onCreate(); + + + } +} + diff --git a/app/src/main/java/org/blastmud/game/LauncherActivity.java b/app/src/main/java/org/blastmud/game/LauncherActivity.java new file mode 100644 index 0000000..283c102 --- /dev/null +++ b/app/src/main/java/org/blastmud/game/LauncherActivity.java @@ -0,0 +1,54 @@ +/* + * Copyright 2020 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.blastmud.game; + +import android.content.pm.ActivityInfo; +import android.net.Uri; +import android.os.Build; +import android.os.Bundle; + + + +public class LauncherActivity + extends com.google.androidbrowserhelper.trusted.LauncherActivity { + + + + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + // Setting an orientation crashes the app due to the transparent background on Android 8.0 + // Oreo and below. We only set the orientation on Oreo and above. This only affects the + // splash screen and Chrome will still respect the orientation. + // See https://github.com/GoogleChromeLabs/bubblewrap/issues/496 for details. + if (Build.VERSION.SDK_INT > Build.VERSION_CODES.O) { + setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED); + } else { + setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED); + } + } + + @Override + protected Uri getLaunchingUrl() { + // Get the original launch Url. + Uri uri = super.getLaunchingUrl(); + + + + return uri; + } +} diff --git a/app/src/main/res/drawable-anydpi/shortcut_legacy_background.xml b/app/src/main/res/drawable-anydpi/shortcut_legacy_background.xml new file mode 100644 index 0000000..d53c148 --- /dev/null +++ b/app/src/main/res/drawable-anydpi/shortcut_legacy_background.xml @@ -0,0 +1,25 @@ + + + + + + + + + diff --git a/app/src/main/res/drawable-hdpi/ic_notification_icon.png b/app/src/main/res/drawable-hdpi/ic_notification_icon.png new file mode 100644 index 0000000..57aa352 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_notification_icon.png differ diff --git a/app/src/main/res/drawable-hdpi/splash.png b/app/src/main/res/drawable-hdpi/splash.png new file mode 100644 index 0000000..4196e3c Binary files /dev/null and b/app/src/main/res/drawable-hdpi/splash.png differ diff --git a/app/src/main/res/drawable-mdpi/ic_notification_icon.png b/app/src/main/res/drawable-mdpi/ic_notification_icon.png new file mode 100644 index 0000000..686aae7 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_notification_icon.png differ diff --git a/app/src/main/res/drawable-mdpi/splash.png b/app/src/main/res/drawable-mdpi/splash.png new file mode 100644 index 0000000..9bf0cef Binary files /dev/null and b/app/src/main/res/drawable-mdpi/splash.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_notification_icon.png b/app/src/main/res/drawable-xhdpi/ic_notification_icon.png new file mode 100644 index 0000000..7e455fe Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_notification_icon.png differ diff --git a/app/src/main/res/drawable-xhdpi/splash.png b/app/src/main/res/drawable-xhdpi/splash.png new file mode 100644 index 0000000..3924510 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/splash.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_notification_icon.png b/app/src/main/res/drawable-xxhdpi/ic_notification_icon.png new file mode 100644 index 0000000..50cfbf8 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_notification_icon.png differ diff --git a/app/src/main/res/drawable-xxhdpi/splash.png b/app/src/main/res/drawable-xxhdpi/splash.png new file mode 100644 index 0000000..f6f6054 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/splash.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/ic_notification_icon.png b/app/src/main/res/drawable-xxxhdpi/ic_notification_icon.png new file mode 100644 index 0000000..a7d4634 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/ic_notification_icon.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/splash.png b/app/src/main/res/drawable-xxxhdpi/splash.png new file mode 100644 index 0000000..5d171cb Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/splash.png differ diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..0480797 --- /dev/null +++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher.png b/app/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 0000000..50cfbf8 Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-hdpi/ic_maskable.png b/app/src/main/res/mipmap-hdpi/ic_maskable.png new file mode 100644 index 0000000..a20e444 Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_maskable.png differ diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher.png b/app/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 0000000..7e455fe Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-mdpi/ic_maskable.png b/app/src/main/res/mipmap-mdpi/ic_maskable.png new file mode 100644 index 0000000..2fa5143 Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_maskable.png differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/app/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 0000000..a7d4634 Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_maskable.png b/app/src/main/res/mipmap-xhdpi/ic_maskable.png new file mode 100644 index 0000000..4815a12 Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_maskable.png differ diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 0000000..6eef8c1 Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-xxhdpi/ic_maskable.png b/app/src/main/res/mipmap-xxhdpi/ic_maskable.png new file mode 100644 index 0000000..31e7960 Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_maskable.png differ diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 0000000..8b41ed6 Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_maskable.png b/app/src/main/res/mipmap-xxxhdpi/ic_maskable.png new file mode 100644 index 0000000..86ec514 Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_maskable.png differ diff --git a/app/src/main/res/raw/web_app_manifest.json b/app/src/main/res/raw/web_app_manifest.json new file mode 100644 index 0000000..40b1814 --- /dev/null +++ b/app/src/main/res/raw/web_app_manifest.json @@ -0,0 +1 @@ +{"$schema":"https://json.schemastore.org/web-manifest-combined.json","name":"BlastMud","short_name":"BlastMud","start_url":"/game.html?source=android","display":"standalone","background_color":"#000","description":"A post-apocalyptic multi user dungeon game","icons":[{"src":"images/logo48.png","sizes":"48x48","type":"image/png"},{"src":"images/logo72.png","sizes":"72x72","type":"image/png"},{"src":"images/logo96.png","sizes":"96x96","type":"image/png"},{"src":"images/logo144.png","sizes":"144x144","type":"image/png"},{"src":"images/logo168.png","sizes":"168x168","type":"image/png"},{"src":"images/logo192.png","sizes":"192x192","type":"image/png"}],"related_applications":[{"platform":"play","url":"https://play.google.com/store/apps/details?id=org.blastmud.game"}]} \ No newline at end of file diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml new file mode 100644 index 0000000..e66222d --- /dev/null +++ b/app/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ + + + #F5F5F5 + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml new file mode 100644 index 0000000..a5cdeea --- /dev/null +++ b/app/src/main/res/values/strings.xml @@ -0,0 +1,36 @@ + + + + + + + + [{ + \"relation\": [\"delegate_permission/common.handle_all_urls\"], + \"target\": { + \"namespace\": \"web\", + \"site\": \"https://www.blastmud.org\" + } + }] + + + diff --git a/app/src/main/res/xml/filepaths.xml b/app/src/main/res/xml/filepaths.xml new file mode 100644 index 0000000..a543485 --- /dev/null +++ b/app/src/main/res/xml/filepaths.xml @@ -0,0 +1,18 @@ + + + + diff --git a/app/src/main/res/xml/shortcuts.xml b/app/src/main/res/xml/shortcuts.xml new file mode 100644 index 0000000..5effdb1 --- /dev/null +++ b/app/src/main/res/xml/shortcuts.xml @@ -0,0 +1 @@ + diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..4179961 --- /dev/null +++ b/build.gradle @@ -0,0 +1,42 @@ +/* + * Copyright 2019 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Top-level build file where you can add configuration options common to all sub-projects/modules. + +buildscript { + + repositories { + google() + jcenter() + } + dependencies { + classpath 'com.android.tools.build:gradle:4.1.3' + + // NOTE: Do not place your application dependencies here; they belong + // in the individual module build.gradle files + } +} + +allprojects { + repositories { + google() + jcenter() + } +} + +task clean(type: Delete) { + delete rootProject.buildDir +} diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000..784a1d4 --- /dev/null +++ b/gradle.properties @@ -0,0 +1,14 @@ +# Project-wide Gradle settings. +# IDE (e.g. Android Studio) users: +# Gradle settings configured through the IDE *will override* +# any settings specified in this file. +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +org.gradle.jvmargs=-Xmx1536m +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. More details, visit +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects +# org.gradle.parallel=true +android.useAndroidX=true diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..5c2d1cf Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..38c1d48 --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip diff --git a/gradlew b/gradlew new file mode 100755 index 0000000..83f2acf --- /dev/null +++ b/gradlew @@ -0,0 +1,188 @@ +#!/usr/bin/env sh + +# +# Copyright 2015 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=$(save "$@") + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong +if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then + cd "$(dirname "$0")" +fi + +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 0000000..24467a1 --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,100 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/manifest-checksum.txt b/manifest-checksum.txt new file mode 100644 index 0000000..653e262 --- /dev/null +++ b/manifest-checksum.txt @@ -0,0 +1 @@ +7adbb9681fc724319181d399947c6e78a25e7682 \ No newline at end of file diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 0000000..e7b4def --- /dev/null +++ b/settings.gradle @@ -0,0 +1 @@ +include ':app' diff --git a/store_icon.png b/store_icon.png new file mode 100644 index 0000000..b4cee67 Binary files /dev/null and b/store_icon.png differ diff --git a/twa-manifest.json b/twa-manifest.json new file mode 100644 index 0000000..d0f2f19 --- /dev/null +++ b/twa-manifest.json @@ -0,0 +1,42 @@ +{ + "packageId": "org.blastmud.game", + "host": "www.blastmud.org", + "name": "Blastmud", + "launcherName": "Blastmud", + "display": "standalone", + "themeColor": "#FFFFFF", + "navigationColor": "#000000", + "navigationColorDark": "#000000", + "navigationDividerColor": "#000000", + "navigationDividerColorDark": "#000000", + "backgroundColor": "#000000", + "enableNotifications": true, + "startUrl": "/game.html?source=android", + "iconUrl": "https://www.blastmud.org/images/logo192.png", + "maskableIconUrl": "https://www.blastmud.org/images/logo192.png", + "splashScreenFadeOutDuration": 300, + "signingKey": { + "path": "../../../android.keystore", + "alias": "upload" + }, + "appVersionName": "2", + "appVersionCode": 2, + "shortcuts": [], + "generatorApp": "bubblewrap-cli", + "webManifestUrl": "https://www.blastmud.org/manifest.json", + "fallbackType": "customtabs", + "features": {}, + "alphaDependencies": { + "enabled": false + }, + "enableSiteSettingsShortcut": true, + "isChromeOSOnly": false, + "isMetaQuest": false, + "fullScopeUrl": "https://www.blastmud.org/", + "minSdkVersion": 19, + "orientation": "user", + "fingerprints": [], + "additionalTrustedOrigins": [], + "retainedBundles": [], + "appVersion": "2" +} \ No newline at end of file