diff options
Diffstat (limited to 'packages/meshbay-android')
5 files changed, 53 insertions, 0 deletions
diff --git a/packages/meshbay-android/LICENSE-EXCEPTION.txt b/packages/meshbay-android/LICENSE-EXCEPTION.txt new file mode 100644 index 0000000..bd526f6 --- /dev/null +++ b/packages/meshbay-android/LICENSE-EXCEPTION.txt @@ -0,0 +1,24 @@ +MeshBay for Android — additional permission under GNU AGPL version 3, section 7 +============================================================================== + +The MeshBay Android application is free software under the GNU Affero General +Public License, version 3 or (at your option) any later version — see LICENSE +at the root of the repository — with the following additional permission. +(Its protocol files, those marked SPDX-License-Identifier: LGPL-3.0-or-later, +are under the GNU Lesser GPL instead, which needs no such permission.) + + If you modify this Program, or any covered work, by linking or combining + it with the Google Play services client libraries (the Maven group + com.google.android.gms, or a modified version of those libraries), + containing parts covered by the terms of the licence under which Google + distributes them, the licensors of this Program grant you additional + permission to convey the resulting work. Corresponding Source for a + non-source form of such a combination shall not include the source code + for the parts of those libraries used as well as that of the covered work. + +Why: casting to a television goes through Google's cast sender SDK, which is +not free software and is linked into the application. Without this permission, +nobody but the copyright holders could lawfully distribute the application as +it is built, including from a fork. The permission covers those libraries only; +nothing else in the application is exempt from the AGPL, and anybody who +distributes a modified version may remove it (section 7). diff --git a/packages/meshbay-android/app/src/main/kotlin/org/meshbay/client/MainActivity.kt b/packages/meshbay-android/app/src/main/kotlin/org/meshbay/client/MainActivity.kt index fc446b9..0fa63d6 100644 --- a/packages/meshbay-android/app/src/main/kotlin/org/meshbay/client/MainActivity.kt +++ b/packages/meshbay-android/app/src/main/kotlin/org/meshbay/client/MainActivity.kt @@ -6,9 +6,11 @@ import android.content.Intent import android.net.Uri import android.os.Build import android.os.Bundle +import android.os.SystemClock import android.util.Log import android.view.View import android.view.ViewGroup +import android.view.ViewTreeObserver import android.view.WindowInsets import android.webkit.ConsoleMessage import android.webkit.PermissionRequest @@ -66,6 +68,7 @@ class MainActivity : Activity() { root = FrameLayout(this) setContentView(root) applyInsets(root) + if (savedInstanceState == null && Build.VERSION.SDK_INT >= 31) holdSplash() // A WebView too old for the page's crypto would fail at the first // handshake; say so before loading anything. @@ -255,6 +258,22 @@ class MainActivity : Activity() { catch (e: android.content.ActivityNotFoundException) { Log.w(Bridge.TAG, "no browser for $url") } } + /** + * Android 12+ shows the launcher icon until the first frame is drawn, which + * on a warm process is a flash. Holding that frame keeps it up long enough + * to be seen; the WebView loads underneath in the meantime. + */ + private fun holdSplash() { + val until = SystemClock.uptimeMillis() + SPLASH_MS + root.viewTreeObserver.addOnPreDrawListener(object : ViewTreeObserver.OnPreDrawListener { + override fun onPreDraw(): Boolean { + if (SystemClock.uptimeMillis() < until) return false + root.viewTreeObserver.removeOnPreDrawListener(this) + return true + } + }) + } + /** Edge-to-edge is enforced from Android 15: keep the page clear of the bars and the keyboard. */ private fun applyInsets(view: View) { view.setOnApplyWindowInsetsListener { v, insets -> @@ -296,4 +315,8 @@ class MainActivity : Activity() { if (::web.isInitialized) { root.removeView(web); web.destroy() } super.onDestroy() } + + companion object { + private const val SPLASH_MS = 500L + } } diff --git a/packages/meshbay-android/app/src/main/kotlin/org/meshbay/client/keys/Kdf.kt b/packages/meshbay-android/app/src/main/kotlin/org/meshbay/client/keys/Kdf.kt index 30f094e..404efcb 100644 --- a/packages/meshbay-android/app/src/main/kotlin/org/meshbay/client/keys/Kdf.kt +++ b/packages/meshbay-android/app/src/main/kotlin/org/meshbay/client/keys/Kdf.kt @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-later +// Part of MeshBay's protocol layer, under the LGPL so that any client may use it. package org.meshbay.client.keys import org.bouncycastle.crypto.digests.SHA256Digest diff --git a/packages/meshbay-android/app/src/main/kotlin/org/meshbay/client/keys/Keyring.kt b/packages/meshbay-android/app/src/main/kotlin/org/meshbay/client/keys/Keyring.kt index fa8ff71..9a7dd9f 100644 --- a/packages/meshbay-android/app/src/main/kotlin/org/meshbay/client/keys/Keyring.kt +++ b/packages/meshbay-android/app/src/main/kotlin/org/meshbay/client/keys/Keyring.kt @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-later +// Part of MeshBay's protocol layer, under the LGPL so that any client may use it. package org.meshbay.client.keys import org.bouncycastle.crypto.agreement.X25519Agreement diff --git a/packages/meshbay-android/app/src/main/kotlin/org/meshbay/client/keys/Transcripts.kt b/packages/meshbay-android/app/src/main/kotlin/org/meshbay/client/keys/Transcripts.kt index 4d183f7..cf20a0b 100644 --- a/packages/meshbay-android/app/src/main/kotlin/org/meshbay/client/keys/Transcripts.kt +++ b/packages/meshbay-android/app/src/main/kotlin/org/meshbay/client/keys/Transcripts.kt @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-later +// Part of MeshBay's protocol layer, under the LGPL so that any client may use it. package org.meshbay.client.keys import org.json.JSONObject |