Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions micopay/frontend/android/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,9 @@ app/src/main/assets/public
app/src/main/assets/capacitor.config.json
app/src/main/assets/capacitor.plugins.json
app/src/main/res/xml/config.xml


# Android signing — never commit
android/keystore.properties
*.keystore
*.jks
17 changes: 9 additions & 8 deletions micopay/frontend/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
versionName "1.0.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
aaptOptions {
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.
// Default: https://android.googlesource.com/platform/frameworks/base/+/282e181b58cf72b6ca770dc7ca5f91f135444502/tools/aapt/AaptAssets.cpp#61
ignoreAssetsPattern = '!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~'
}
}
Expand All @@ -22,8 +20,6 @@ android {
if (propsFile.exists()) {
def props = new Properties()
props.load(new FileInputStream(propsFile))
// storeFile path in keystore.properties is resolved relative to
// the android/ project root, not android/app/.
storeFile rootProject.file(props['storeFile'])
storePassword props['storePassword']
keyAlias props['keyAlias']
Expand All @@ -33,13 +29,18 @@ android {
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
minifyEnabled true
shrinkResources true
debuggable false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
def propsFile = rootProject.file('keystore.properties')
if (propsFile.exists()) {
signingConfig signingConfigs.release
}
}
debug {
applicationIdSuffix ".debug"
}
}
}

Expand Down Expand Up @@ -70,4 +71,4 @@ try {
}
} catch(Exception e) {
logger.info("google-services.json not found, google-services plugin not applied. Push Notifications won't work")
}
}
69 changes: 48 additions & 21 deletions micopay/frontend/android/app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -1,21 +1,48 @@
# 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
# ── Capacitor core ──────────────────────────────────────────────────────────
-keep class com.getcapacitor.** { *; }
-keepclassmembers class com.getcapacitor.** { *; }
-keep @com.getcapacitor.annotation.CapacitorPlugin class * { *; }
-keep @com.getcapacitor.annotation.Permission class * { *; }

# ── Capacitor plugins used by MicoPay ────────────────────────────────────────
# Secure Storage (@aparajita/capacitor-secure-storage)
-keep class com.aparajita.capacitor.securestorage.** { *; }

# Barcode Scanning (@capacitor-mlkit/barcode-scanning)
-keep class io.capawesome.capacitorjs.plugins.mlkit.barcodescanning.** { *; }
# MLKit barcode — keep model classes
-keep class com.google.mlkit.** { *; }
-keep class com.google.android.gms.internal.mlkit_vision_barcode.** { *; }

# Geolocation (@capacitor/geolocation)
-keep class com.getcapacitor.plugin.geolocation.** { *; }

# Status Bar (@capacitor/status-bar)
-keep class com.getcapacitor.plugin.statusbar.** { *; }

# App plugin (@capacitor/app)
-keep class com.getcapacitor.plugin.app.** { *; }

# ── WebView / JS bridge ───────────────────────────────────────────────────────
-keepclassmembers class * {
@android.webkit.JavascriptInterface <methods>;
}

# ── AndroidX / support ───────────────────────────────────────────────────────
-keep class androidx.core.app.CoreComponentFactory { *; }

# ── Reflection & serialization safety ────────────────────────────────────────
-keepattributes *Annotation*
-keepattributes Signature
-keepattributes Exceptions
-keepattributes EnclosingMethod
-keepattributes InnerClasses

# ── Stack traces (keep for crash reporting) ───────────────────────────────────
-keepattributes SourceFile,LineNumberTable
-renamesourcefileattribute SourceFile

# ── Gson / JSON (if used anywhere) ───────────────────────────────────────────
-keepclassmembers,allowobfuscation class * {
@com.google.gson.annotations.SerializedName <fields>;
}
16 changes: 10 additions & 6 deletions micopay/frontend/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
<?xml version="1.0" encoding="utf-8" ?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application
android:allowBackup="false"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
android:allowBackup="false"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:networkSecurityConfig="@xml/network_security_config"
android:usesCleartextTraffic="false"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode|navigation|density"
android:name=".MainActivity"
Expand Down
13 changes: 13 additions & 0 deletions micopay/frontend/android/app/src/main/res/xml/backup_rules.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<full-backup-content>
<!--
MicoPay handles Stellar keypairs, JWT tokens, and USDC balances.
Nothing in shared prefs, databases, or files should ever be backed up
to Google Drive — a restored device must re-authenticate from scratch.
-->
<exclude domain="sharedpref" path="." />
<exclude domain="database" path="." />
<exclude domain="file" path="." />
<exclude domain="external" path="." />
<exclude domain="root" path="." />
</full-backup-content>
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<data-extraction-rules>

<cloud-backup>
<exclude domain="sharedpref" path="." />
<exclude domain="database" path="." />
<exclude domain="file" path="." />
<exclude domain="external" path="." />
<exclude domain="root" path="." />
</cloud-backup>

<device-transfer>
<exclude domain="sharedpref" path="." />
<exclude domain="database" path="." />
<exclude domain="file" path="." />
<exclude domain="external" path="." />
<exclude domain="root" path="." />
</device-transfer>

</data-extraction-rules>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>

<!--
Production: system CAs only, no cleartext ever.
This blocks all HTTP traffic in release builds.
-->
<base-config cleartextTrafficPermitted="false">
<trust-anchors>
<certificates src="system" />
</trust-anchors>
</base-config>

<!--
Debug only: trust user-installed CAs so Charles/Proxyman
can intercept for local dev. Never ships in release.
-->
<debug-overrides>
<trust-anchors>
<certificates src="system" />
<certificates src="user" />
</trust-anchors>
</debug-overrides>

</network-security-config>
8 changes: 7 additions & 1 deletion micopay/frontend/android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx1536m
org.gradle.jvmargs=-Xmx2048m

# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
Expand All @@ -20,3 +20,9 @@ org.gradle.jvmargs=-Xmx1536m
# Android operating system, and which are packaged with your app's APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true

# Enable R8 full mode for release builds
android.enableR8.fullMode=true

# Disable Jetifier if you're on full AndroidX (speeds up builds)
android.enableJetifier=false
4 changes: 1 addition & 3 deletions micopay/frontend/capacitor.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ const config: CapacitorConfig = {
server: {
androidScheme: 'https',
},
android: {
allowMixedContent: true,
},
};


export default config;
19 changes: 17 additions & 2 deletions micopay/frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion micopay/frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "micopay-frontend",
"private": true,
"version": "0.0.0",
"version": "1.0.0",
"type": "module",
"scripts": {
"dev": "vite",
Expand Down