Update build scripts, constants, and Android configurations for improved web view handling and debugging

- Rename `proxy.ts` to `_proxy.ts` temporarily during build scripts and clean up backup files.
- Adjust Compass URLs to consistently include "www."
- Introduce WebView debugging toggle via `BuildConfig.ENABLE_WEBVIEW_DEBUG`.
- Bump Android version code to 79 and enable `buildConfig` features.
This commit is contained in:
MartinBraquet
2026-04-02 13:38:37 +02:00
parent 0d758eb5b1
commit 2db74bf256
4 changed files with 21 additions and 5 deletions

View File

@@ -11,7 +11,7 @@ android {
applicationId "com.compassconnections.app"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 78
versionCode 79
versionName "1.16.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
aaptOptions {
@@ -20,10 +20,17 @@ android {
ignoreAssetsPattern '!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~'
}
}
buildFeatures {
buildConfig = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
buildConfigField "boolean", "ENABLE_WEBVIEW_DEBUG", "false"
}
debug {
buildConfigField "boolean", "ENABLE_WEBVIEW_DEBUG", "true"
}
}
}

View File

@@ -216,8 +216,9 @@ public class MainActivity extends BridgeActivity implements ModifiedMainActivity
WebView webView = this.bridge.getWebView();
webView.setWebViewClient(new BridgeWebViewClient(this.bridge));
// WebView.setWebContentsDebuggingEnabled(true);
if (BuildConfig.ENABLE_WEBVIEW_DEBUG) {
WebView.setWebContentsDebuggingEnabled(true);
}
// Set a recognizable User-Agent (always reliable)
WebSettings settings = webView.getSettings();
settings.setUserAgentString(settings.getUserAgentString() + " CompassAppWebView");

View File

@@ -54,8 +54,8 @@ export const LOCAL_WEB_DOMAIN = `localhost:3000`
export const LOCAL_BACKEND_DOMAIN = `${IS_WEBVIEW_DEV_PHONE ? '192.168.1.3' : IS_LOCAL_ANDROID ? '10.0.2.2' : 'localhost'}:8088`
export const DOMAIN = IS_LOCAL ? LOCAL_WEB_DOMAIN : ENV_CONFIG.domain
export const DEPLOYED_WEB_URL = `https://${ENV_CONFIG.domain}`
export const WEB_URL = IS_LOCAL ? `http://${LOCAL_WEB_DOMAIN}` : `https://${DOMAIN}`
export const DEPLOYED_WEB_URL = `https://www.${ENV_CONFIG.domain}`
export const WEB_URL = IS_LOCAL ? `http://${LOCAL_WEB_DOMAIN}` : `https://www.${DOMAIN}`
export const BACKEND_DOMAIN = IS_LOCAL ? LOCAL_BACKEND_DOMAIN : ENV_CONFIG.backendDomain
export const FIREBASE_CONFIG = ENV_CONFIG.firebaseConfig
export const PROJECT_ID = ENV_CONFIG.firebaseConfig.projectId

View File

@@ -49,8 +49,16 @@ sed -i.bak 's/\bgetStaticPaths\b/_getStaticPaths/g' $USERNAME_PAGE
# rename getServerSideProps to _getServerSideProps
sed -i.bak 's/\bgetServerSideProps\b/_getServerSideProps/g' $HOME_PAGE
# rename proxy to _proxy
mv proxy.ts _proxy.ts
yarn build
sed -i.bak 's/\b_getStaticProps\b/getStaticProps/g' $USERNAME_PAGE
sed -i.bak 's/\b_getStaticPaths\b/getStaticPaths/g' $USERNAME_PAGE
sed -i.bak 's/\b_getServerSideProps\b/getServerSideProps/g' $HOME_PAGE
mv _proxy.ts proxy.ts
# Remove backup files
rm -f "$USERNAME_PAGE.bak" "$HOME_PAGE.bak"