mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-20 19:16:08 +00:00
c23518dae0
A tester with a server on his home network could not open the Android app
away from it: after closing the app and turning Wi-Fi off it stayed on the
address screen ("No server answered at this address").
- Android keeps the server's UI itself (TrekOfflineShell): the start page
and every file of the build, listed by native/offlineShell.ts from the
server's manifest and downloaded natively. A web view runs no service
worker on a plain-http server, the usual address of a server at home, so
the old "Android has the service worker" assumption did not hold.
- Without a network, or once the server failed to load twice, the web view
serves the copy under the server's origin with Capacitor's bridge; the UI
runs on its own offline data and the API answers again once the server
is back. The address screen opens the copy too (openOfflineCopy).
- The check an update asks for no longer locks the app out offline: on both
platforms a server out of reach is put back on its copy and checked on
the next launch that reaches it. iOS no longer throws its copy away when
the update check runs.
46 lines
1.8 KiB
Prolog
46 lines
1.8 KiB
Prolog
# Add project specific ProGuard rules here.
|
|
# You can control the set of applied configuration files using the
|
|
# proguardFiles setting in build.gradle.
|
|
#
|
|
# For more details, see
|
|
# http://developer.android.com/guide/developing/tools/proguard.html
|
|
|
|
# If your project uses WebView with JS, uncomment the following
|
|
# and specify the fully qualified class name to the JavaScript interface
|
|
# class:
|
|
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
|
# public *;
|
|
#}
|
|
|
|
# Uncomment this to preserve the line number information for
|
|
# debugging stack traces.
|
|
#-keepattributes SourceFile,LineNumberTable
|
|
|
|
# If you keep the line number information, uncomment this to
|
|
# hide the original source file name.
|
|
#-renamesourcefileattribute SourceFile
|
|
|
|
# TREK's own classes: TrekShellPlugin is reached from JavaScript by name and its
|
|
# methods through reflection, so R8 must neither rename nor drop them.
|
|
-keep class com.liketrek.trek.** { *; }
|
|
|
|
# Every Capacitor plugin: the bridge finds plugins by their annotation and calls
|
|
# the annotated methods reflectively.
|
|
-keep @com.getcapacitor.annotation.CapacitorPlugin public class * {
|
|
@com.getcapacitor.PluginMethod public <methods>;
|
|
}
|
|
|
|
# The WebView bridge: Capacitor's message handler is called from JavaScript
|
|
# through @JavascriptInterface, and every plugin class is instantiated by name.
|
|
-keepclassmembers class * {
|
|
@android.webkit.JavascriptInterface <methods>;
|
|
}
|
|
-keep public class * extends com.getcapacitor.Plugin
|
|
|
|
# The stored copy of the server's UI gets Capacitor's bridge the way the
|
|
# server's own page does (TrekOfflineShell.withBridge reads it by reflection).
|
|
-keepclassmembers class com.getcapacitor.Bridge {
|
|
private com.getcapacitor.JSInjector getJSInjector();
|
|
}
|
|
-keep class com.getcapacitor.JSInjector { public *; }
|