diff --git a/.github/workflows/native-owner-android.yml b/.github/workflows/native-owner-android.yml new file mode 100644 index 00000000..f2ae165f --- /dev/null +++ b/.github/workflows/native-owner-android.yml @@ -0,0 +1,44 @@ +name: PAYNEX Native Owner Android +on: + push: + branches: [feat/native-owner-android-app] + paths: ["android/**", ".github/workflows/native-owner-android.yml"] + pull_request: + branches: [main] + paths: ["android/**", ".github/workflows/native-owner-android.yml"] +jobs: + build-owner-apk: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: "17" + - name: Install Android SDK + run: | + SDK_ROOT="${ANDROID_HOME:-$ANDROID_SDK_ROOT}" + SDKMANAGER="$(find "$SDK_ROOT/cmdline-tools" -type f -name sdkmanager | sort | tail -n 1)" + test -x "$SDKMANAGER" + yes | "$SDKMANAGER" --licenses >/dev/null + "$SDKMANAGER" "platforms;android-35" "build-tools;35.0.0" "platform-tools" + - name: Build LocalProof and PAYNEX Owner debug APKs + uses: gradle/gradle-build-action@v3 + with: + gradle-version: "8.9" + build-root-directory: android + arguments: --no-daemon :app:assembleDebug :ownerApp:assembleDebug + - name: Upload PAYNEX Owner APK + uses: actions/upload-artifact@v4 + with: + name: paynex-native-owner-debug-apk + path: android/ownerApp/build/outputs/apk/debug/ownerApp-debug.apk + if-no-files-found: error + retention-days: 14 + - name: Upload LocalProof APK + uses: actions/upload-artifact@v4 + with: + name: paynex-localproof-debug-apk + path: android/app/build/outputs/apk/debug/app-debug.apk + if-no-files-found: error + retention-days: 14 diff --git a/android/README.md b/android/README.md index 3741ea5a..a816dcb1 100644 --- a/android/README.md +++ b/android/README.md @@ -1,31 +1,30 @@ -# PAYNEX LocalProof Android companion (early access) +# PAYNEX Android apps -This is an opt-in notification observation companion, not a payment app or bank integration. +The Android workspace contains two separate applications: -## Build -- Android Studio with JDK 17 and Android SDK 35 -- Open the `android/` folder and build the `app` debug variant. -- The CI workflow builds a debug APK and stores it as a GitHub Actions artifact. - -## Pairing -1. Sign in to the PAYNEX merchant dashboard and create/use an active merchant API key. -2. Enter the Worker URL and API key in the app. -3. Add only the exact package names of UPI apps you choose to observe. -4. Tap Enroll this device. -5. Tap Enable notification access and explicitly enable PAYNEX LocalProof in Android Settings. -6. Keep the phone unlocked/online when notifications arrive. +- `app` — PAYNEX LocalProof companion for opt-in notification observation. It is not a payment gateway or bank-verification app. +- `ownerApp` — PAYNEX Native Owner operations app, with its own application ID and launcher. -The P-256 private key is generated and held by Android Keystore; it is not exported. The server receives only the public key. The app signs timestamp + nonce + exact JSON request bytes. +## Build +- Android Studio, JDK 17 and Android SDK 35 +- Open `android/` +- Build LocalProof: `./gradlew :app:assembleDebug` +- Build PAYNEX Owner: `./gradlew :ownerApp:assembleDebug` -## Data minimisation -Notification text is processed locally only. The app uploads the source package, parser version, event ID, observation time and optional parsed amount/UTR. Full notification bodies, account numbers, contacts and inbox history are not uploaded. Configure an explicit package allowlist. The app does not read SMS inboxes. +GitHub Actions workflow `PAYNEX Native Owner Android` builds both debug APKs and uploads separate artifacts. Debug APKs are for testing; production distribution requires a protected signing key and release validation. -## Limits -- Notification formats vary by UPI app, bank and language; parsing is best-effort and requires real-device testing. -- Notifications may be delayed, absent, duplicated or spoofed. -- A LocalProof observation never marks an order/payment paid, posts a verified ledger journal, activates a subscription, or triggers fulfilment. -- This initial companion does not yet have a durable offline retry queue or in-app observation history. -- Do not use this as a substitute for checking the receiving bank/UPI app. +## Native Owner app scope +- Merchant-key connection over HTTPS; API key encrypted at rest using Android Keystore AES-GCM. +- Live merchant summary, transaction list and payment-link list via existing Worker endpoints. +- Direct UPI QR/Intent for the configured receiving UPI ID; opening UPI is never treated as proof of payment. +- Create hosted payment links, list/create/revoke merchant API keys where the backend permits, and access limited sandbox API key routes. +- LocalProof companion entry and truthful unverified-observation status. +- Refund/reconciliation entry points only where backend endpoints exist; unsupported endpoints are shown as unavailable, not simulated. +- Merchant administration and global admin controls are intentionally gated: a merchant API key is not an admin credential. A dedicated owner/admin session integration is required before those functions can be enabled. -## Privacy and control -Disable notification access in Android Settings to stop observation. Revoke the device in-app to invalidate its API identity. Clear app data/uninstalling the app removes local settings; server-side device revocation should be done first where possible. +## Payment and security boundaries +- The current personal UPI QR/Intent is a direct payment request; customer funds are sent by the UPI network directly to the receiving account. +- UPI app launch, redirect, screenshot, notification, or customer-provided UTR never establishes bank-confirmed success. +- Only an authorised provider's authenticated server-to-server confirmation may establish provider-verified payment. LocalProof observations remain unverified hints. +- Do not embed live API keys in websites or APK resources. The app stores the entered merchant key encrypted locally; use a scoped, revocable key and rotate it if exposed. +- No production release or payment verification claim is implied by a successful debug build. diff --git a/android/ownerApp/build.gradle.kts b/android/ownerApp/build.gradle.kts new file mode 100644 index 00000000..fe0d2f9e --- /dev/null +++ b/android/ownerApp/build.gradle.kts @@ -0,0 +1,21 @@ +plugins { + id("com.android.application") + id("org.jetbrains.kotlin.android") +} +android { + namespace = "com.paynex.owner" + compileSdk = 35 + defaultConfig { + applicationId = "com.paynex.owner" + minSdk = 26 + targetSdk = 35 + versionCode = 1 + versionName = "0.1.0" + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } + kotlinOptions { jvmTarget = "17" } +} +dependencies { implementation("com.google.zxing:core:3.5.3") } diff --git a/android/ownerApp/src/main/AndroidManifest.xml b/android/ownerApp/src/main/AndroidManifest.xml new file mode 100644 index 00000000..f3ddecca --- /dev/null +++ b/android/ownerApp/src/main/AndroidManifest.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/android/ownerApp/src/main/java/com/paynex/owner/MainActivity.kt b/android/ownerApp/src/main/java/com/paynex/owner/MainActivity.kt new file mode 100644 index 00000000..ca0e06bc --- /dev/null +++ b/android/ownerApp/src/main/java/com/paynex/owner/MainActivity.kt @@ -0,0 +1,93 @@ +package com.paynex.owner +import android.app.Activity +import android.content.Intent +import android.graphics.Bitmap +import android.graphics.Color +import android.net.Uri +import android.os.Bundle +import android.view.Gravity +import android.widget.* +import org.json.JSONObject +import com.google.zxing.BarcodeFormat +import com.google.zxing.MultiFormatWriter +import kotlin.concurrent.thread + +class MainActivity : Activity() { + private val defaultBase="https://paynex-api.sbn50088.workers.dev" + private val prefs by lazy { getSharedPreferences("paynex_owner",MODE_PRIVATE) } + private lateinit var root:LinearLayout; private lateinit var content:LinearLayout + private lateinit var base:EditText; private lateinit var key:EditText; private lateinit var upi:EditText + private var current="Overview"; private var summary=JSONObject(); private var upiProfile=JSONObject() + private val bg=Color.rgb(7,15,30); private val panel=Color.rgb(17,31,53); private val fg=Color.rgb(238,245,255); private val muted=Color.rgb(151,170,194); private val lime=Color.rgb(184,244,119) + override fun onCreate(savedInstanceState:Bundle?){super.onCreate(savedInstanceState);login()} + private fun d(v:Int)=(v*resources.displayMetrics.density).toInt() + private fun txt(s:String,size:Float=14f,color:Int=fg,bold:Boolean=false)=TextView(this).apply{text=s;textSize=size;setTextColor(color);if(bold)setTypeface(null,android.graphics.Typeface.BOLD)} + private fun btn(s:String,run:()->Unit)=Button(this).apply{text=s;isAllCaps=false;setTextColor(bg);backgroundTintList=android.content.res.ColorStateList.valueOf(lime);setOnClickListener{run()}} + private fun input(h:String,v:String="",secret:Boolean=false)=EditText(this).apply{hint=h;setText(v);setSingleLine(true);setTextColor(fg);setHintTextColor(muted);setPadding(d(13),d(12),d(13),d(12));if(secret)inputType=android.text.InputType.TYPE_CLASS_TEXT or android.text.InputType.TYPE_TEXT_VARIATION_PASSWORD} + private fun login(){ + root=LinearLayout(this).apply{orientation=1;setPadding(d(24),d(36),d(24),d(24));setBackgroundColor(bg)} + root.addView(txt("PAYNEX",32f,lime,true));root.addView(txt("OWNER • NATIVE CONTROL CENTER",11f,muted,true)) + root.addView(Space(this).apply{minimumHeight=d(45)}) + root.addView(txt("Connect your PAYNEX workspace",23f,fg,true)) + root.addView(txt("Merchant API keys provide merchant-scoped tools. Admin and cross-merchant actions require the secure PAYNEX owner/admin session.",13f,muted)) + base=input("PAYNEX Worker HTTPS URL",prefs.getString("base",defaultBase)!!) + key=input("Active API key",SecureStore.decrypt(prefs.getString("key_enc","")),true) + upi=input("Receiving UPI ID",prefs.getString("upi_id","kr69@ptyes")!!) + root.addView(base);root.addView(key);root.addView(upi);root.addView(btn("Connect securely"){connect()}) + root.addView(txt("API keys are encrypted locally with Android Keystore. Never share a live key.",11f,muted)) + setContentView(root) + } + private fun connect(){ + val b=base.text.toString().trim();val k=key.text.toString().trim() + if(!b.startsWith("https://")||k.isBlank()){toast("HTTPS URL and API key required");return} + prefs.edit().putString("base",b).putString("key_enc",SecureStore.encrypt(k)).putString("upi_id",upi.text.toString().trim()).apply() + thread{try{val s=PaynexApi.request(b,"/api/v1/summary",key=k); val u=PaynexApi.request(b,"/api/v1/merchant/upi",key=k);runOnUiThread{summary=s;upiProfile=u;workspace()}}catch(e:Exception){runOnUiThread{toast(e.message?:"Connection failed")}}} + } + private fun workspace(){ + root=LinearLayout(this).apply{orientation=1;setBackgroundColor(bg)} + val head=LinearLayout(this).apply{orientation=1;setPadding(d(18),d(18),d(18),d(10))} + head.addView(txt("PAYNEX / OWNER",20f,lime,true));head.addView(txt("Your payment operations",12f,muted));root.addView(head) + val nav=HorizontalScrollView(this);val row=LinearLayout(this).apply{orientation=0} + listOf("Overview","Collect","Transactions","Links","API Keys","LocalProof","Refunds","Reconcile","Merchants","Admin").forEach{n->row.addView(txt(n,12f,if(n==current)lime else muted,true).apply{setPadding(d(12),d(12),d(12),d(12));setOnClickListener{current=n;render()}})} + nav.addView(row);root.addView(nav) + val sc=ScrollView(this);content=LinearLayout(this).apply{orientation=1;setPadding(d(16),d(12),d(16),d(28))};sc.addView(content);root.addView(sc,LinearLayout.LayoutParams(-1,0,1f));setContentView(root);render() + } + private fun card(t:String,b:String){val box=LinearLayout(this).apply{orientation=1;setPadding(d(15),d(14),d(15),d(14));setBackgroundColor(panel);addView(txt(t,12f,muted,true));addView(txt(b,20f,fg,true))};val p=LinearLayout.LayoutParams(-1,-2);p.bottomMargin=d(10);content.addView(box,p)} + private fun action(t:String,sub:String,run:()->Unit){val box=LinearLayout(this).apply{orientation=1;setPadding(d(14),d(13),d(14),d(13));setBackgroundColor(panel);addView(txt(t,15f,fg,true));addView(txt(sub,11f,muted));setOnClickListener{run()}};val p=LinearLayout.LayoutParams(-1,-2);p.bottomMargin=d(8);content.addView(box,p)} + private fun render(){ + content.removeAllViews();content.addView(txt(current,25f,fg,true));content.addView(txt("Connected workspace • live Worker data",11f,muted)) + when(current){ + "Overview"->{val tx=summary.optJSONObject("transactions")?:JSONObject();val links=summary.optJSONObject("payment_links")?:JSONObject();card("VERIFIED COLLECTION",money(tx.optLong("verified_volume_minor")));card("TRANSACTIONS",tx.optInt("total").toString()+" total • "+tx.optInt("verified")+" verified • "+tx.optInt("pending")+" pending");card("PAYMENT LINKS",links.optInt("total").toString()+" total • "+links.optInt("active")+" active");action("Payment collection","UPI QR, intent and hosted links"){current="Collect";render()};action("Transactions","Payment state monitoring"){current="Transactions";render()};action("Integrations","API keys and sandbox tools"){current="API Keys";render()}} + "Collect"->collect() + "Transactions"->load("/api/v1/transactions?limit=50&offset=0") + "Links"->load("/api/v1/payment-links") + "API Keys"->keys() + "LocalProof"->{card("LOCALPROOF","Device observations are unverified hints, never bank confirmation.");action("Pair LocalProof companion","Open the separate companion app to enroll/revoke a device"){toast("Install and pair PAYNEX LocalProof companion separately.")}} + "Refunds"->{card("REFUND CONTROL","Submit full refund requests for verified transactions. Approval is not a money movement; settlement requires an authorised provider webhook.");load("/api/v1/refunds")} + "Reconcile"->{card("RECONCILIATION","Global reconciliation cases require the secure owner/admin session. Merchant-scoped refund status is shown in Refunds. UTR or screenshot alone is not bank confirmation.");action("Open owner admin session","Admin reconciliation is not available with a merchant API key"){login()}} + "Merchants","Admin"->{card("OWNER SESSION REQUIRED","A merchant API key cannot access admin or cross-merchant records. Use PAYNEX secure owner/admin authentication.");action("Reconnect","Return to secure sign-in"){login()}} + } + } + private fun collect(){ + content.addView(txt("Direct UPI collection",15f,fg,true));content.addView(txt("Funds go directly to the configured UPI account. UPI app launch is not payment verification.",12f,muted)) + val upi=input("Receiving UPI ID",upiProfile.optString("upi_id",""));val amount=input("Amount in INR");val note=input("Payment description");content.addView(upi);content.addView(btn("Save receiving UPI profile"){val v=upi.text.toString().trim();if(!v.contains("@")){toast("Enter valid UPI ID");return@btn};thread{try{val p=PaynexApi.request(baseUrl(),"/api/v1/merchant/upi","POST",apiKey(),JSONObject().put("upi_id",v).put("account_type","personal"));val u=PaynexApi.request(baseUrl(),"/api/v1/merchant/upi",key=apiKey());runOnUiThread{upiProfile=u;toast(p.optString("message","UPI profile saved. Ownership approval reset."));}}catch(e:Exception){runOnUiThread{toast(e.message?:"UPI profile save failed")}}}});content.addView(amount);content.addView(note) + content.addView(btn("Generate UPI QR + open UPI app"){ + val v=amount.text.toString().toDoubleOrNull();if(v==null||v<=0){toast("Enter valid amount");return@btn} + val receivingUpi=upi.text.toString().trim();if(!receivingUpi.contains("@")){toast("Enter a valid receiving UPI ID");return@btn} + val uri="upi://pay?pa="+Uri.encode(upiProfile.optString("upi_id",receivingUpi))+"&pn="+Uri.encode(upiProfile.optString("business_name","PAYNEX"))+"&am="+String.format(java.util.Locale.US,"%.2f",v)+"&cu=INR&tn="+Uri.encode(note.text.toString()) + qr(uri);val i=Intent(Intent.ACTION_VIEW,Uri.parse(uri));if(i.resolveActivity(packageManager)!=null)startActivity(i)else toast("No UPI app found; scan the QR") + }) + val title=input("Payment link title");val price=input("Payment link amount INR");content.addView(txt("Hosted payment link",15f,fg,true));content.addView(title);content.addView(price) + content.addView(btn("Create payment link"){ + val v=price.text.toString().toDoubleOrNull();if(title.text.isBlank()||v==null||v<=0){toast("Enter title and valid amount");return@btn} + thread{try{val out=PaynexApi.request(baseUrl(),"/api/v1/payment-links","POST",apiKey(),JSONObject().put("title",title.text.toString()).put("amount_minor",(v*100).toLong()).put("currency","INR"));runOnUiThread{card("LINK CREATED",out.toString())}}catch(e:Exception){runOnUiThread{toast(e.message?:"Create failed")}}} + }) + } + private fun qr(value:String){try{val m=MultiFormatWriter().encode(value,BarcodeFormat.QR_CODE,d(240),d(240));val bmp=Bitmap.createBitmap(m.width,m.height,Bitmap.Config.ARGB_8888);for(x in 0 until m.width)for(y in 0 until m.height)bmp.setPixel(x,y,if(m[x,y])Color.BLACK else Color.WHITE);content.addView(ImageView(this).apply{setImageBitmap(bmp);setPadding(d(10),d(10),d(10),d(10));setBackgroundColor(Color.WHITE)},LinearLayout.LayoutParams(d(260),d(260)));content.addView(txt("UPI ID: "+upiProfile.optString("upi_id","Not configured")+" • "+upiProfile.optString("account_type","personal")+" • "+(if(upiProfile.optBoolean("public_collection_eligible"))"ownership approved" else "private testing only")+" • Pending until independently verified",12f,muted))}catch(e:Exception){toast("QR error: "+e.message)}} + private fun load(path:String){val wait=txt("Loading…",12f,muted);content.addView(wait);thread{try{val out=PaynexApi.request(baseUrl(),path,key=apiKey());runOnUiThread{content.removeView(wait);content.addView(txt(out.toString(2),12f,fg))}}catch(e:Exception){runOnUiThread{content.removeView(wait);card("UNAVAILABLE",e.message?:"Endpoint not available")}}}} + private fun keys(){card("API KEY SECURITY","New keys are shown once. Existing plaintext keys cannot be recovered.");val l=input("Key label");content.addView(l);content.addView(btn("Create API key"){thread{try{val o=PaynexApi.request(baseUrl(),"/api/v1/api-keys","POST",apiKey(),JSONObject().put("label",l.text.toString().ifBlank{"Native Owner App"}));runOnUiThread{card("COPY AND STORE THIS KEY NOW",o.toString(2))}}catch(e:Exception){runOnUiThread{toast(e.message?:"Key creation failed")}}}});action("List and revoke keys","Key metadata and revocation"){load("/api/v1/api-keys")};action("Sandbox keys","Limited-access pn_test_ keys"){load("/api/v1/limited/api-keys")}} + private fun baseUrl()=prefs.getString("base",defaultBase)!! + private fun apiKey()=SecureStore.decrypt(prefs.getString("key_enc","")) + private fun money(v:Long)=if(v==0L)"—" else "₹"+String.format(java.util.Locale.US,"%.2f",v/100.0) + private fun toast(s:String)=Toast.makeText(this,s,Toast.LENGTH_LONG).show() +} diff --git a/android/ownerApp/src/main/java/com/paynex/owner/PaynexApi.kt b/android/ownerApp/src/main/java/com/paynex/owner/PaynexApi.kt new file mode 100644 index 00000000..50dd272c --- /dev/null +++ b/android/ownerApp/src/main/java/com/paynex/owner/PaynexApi.kt @@ -0,0 +1,17 @@ +package com.paynex.owner +import org.json.JSONObject +import java.net.HttpURLConnection +import java.net.URL +object PaynexApi { + fun request(base:String,path:String,method:String="GET",key:String,body:JSONObject?=null):JSONObject { + require(base.startsWith("https://",true)) { "HTTPS Worker URL required" } + val c=URL(base.trimEnd('/')+path).openConnection() as HttpURLConnection + c.requestMethod=method; c.connectTimeout=15000; c.readTimeout=15000 + c.setRequestProperty("Accept","application/json"); c.setRequestProperty("x-api-key",key) + if(body!=null){c.doOutput=true;c.setRequestProperty("Content-Type","application/json");c.outputStream.use{it.write(body.toString().toByteArray())}} + val code=c.responseCode; val stream=if(code in 200..299)c.inputStream else c.errorStream + val raw=stream?.bufferedReader()?.use{it.readText()} ?: "{}"; c.disconnect() + if(code !in 200..299) throw IllegalStateException("PAYNEX API HTTP $code: $raw") + return JSONObject(raw) + } +} diff --git a/android/ownerApp/src/main/java/com/paynex/owner/SecureStore.kt b/android/ownerApp/src/main/java/com/paynex/owner/SecureStore.kt new file mode 100644 index 00000000..4840c952 --- /dev/null +++ b/android/ownerApp/src/main/java/com/paynex/owner/SecureStore.kt @@ -0,0 +1,34 @@ +package com.paynex.owner +import android.security.keystore.KeyGenParameterSpec +import android.security.keystore.KeyProperties +import android.util.Base64 +import java.security.KeyStore +import javax.crypto.Cipher +import javax.crypto.KeyGenerator +import javax.crypto.SecretKey +import javax.crypto.spec.GCMParameterSpec +object SecureStore { + private const val ALIAS = "paynex-owner-aes" + private fun key(): SecretKey { + val store = KeyStore.getInstance("AndroidKeyStore").apply { load(null) } + (store.getKey(ALIAS, null) as? SecretKey)?.let { return it } + val gen = KeyGenerator.getInstance(KeyProperties.KEY_ALGORITHM_AES, "AndroidKeyStore") + gen.init(KeyGenParameterSpec.Builder(ALIAS, KeyProperties.PURPOSE_ENCRYPT or KeyProperties.PURPOSE_DECRYPT) + .setBlockModes(KeyProperties.BLOCK_MODE_GCM).setEncryptionPaddings(KeyProperties.ENCRYPTION_PADDING_NONE) + .setRandomizedEncryptionRequired(true).build()) + return gen.generateKey() + } + fun encrypt(value: String): String { + if (value.isBlank()) return "" + val c = Cipher.getInstance("AES/GCM/NoPadding"); c.init(Cipher.ENCRYPT_MODE, key()) + return Base64.encodeToString(c.iv + c.doFinal(value.toByteArray()), Base64.NO_WRAP) + } + fun decrypt(value: String?): String { + if (value.isNullOrBlank()) return "" + return try { + val b=Base64.decode(value,Base64.NO_WRAP); val c=Cipher.getInstance("AES/GCM/NoPadding") + c.init(Cipher.DECRYPT_MODE,key(),GCMParameterSpec(128,b.copyOfRange(0,12))) + String(c.doFinal(b.copyOfRange(12,b.size))) + } catch (_:Exception) { "" } + } +} diff --git a/android/settings.gradle.kts b/android/settings.gradle.kts index a2ab70a8..a65e33c0 100644 --- a/android/settings.gradle.kts +++ b/android/settings.gradle.kts @@ -1,4 +1,4 @@ pluginManagement { repositories { google(); mavenCentral(); gradlePluginPortal() } } dependencyResolutionManagement { repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS); repositories { google(); mavenCentral() } } -rootProject.name = "PAYNEX-LocalProof" -include(":app") +rootProject.name = "PAYNEX-Android" +include(":app", ":ownerApp") diff --git a/docs/NATIVE-OWNER-ANDROID-STATUS.md b/docs/NATIVE-OWNER-ANDROID-STATUS.md new file mode 100644 index 00000000..30a96173 --- /dev/null +++ b/docs/NATIVE-OWNER-ANDROID-STATUS.md @@ -0,0 +1,30 @@ +# PAYNEX Native Owner Android — implementation status + +**Current status: initial native app module and CI build workflow added on feature branch. Not yet merged or deployed.** + +## Added +- Separate ownerApp Android application module; existing LocalProof app remains separate. +- Dark PAYNEX-styled native workspace navigation for Overview, Collect, Transactions, Links, API Keys, LocalProof, Refunds, Reconcile, Merchants and Admin. +- HTTPS Worker API client and Android Keystore AES-GCM encrypted local API-key storage. +- Merchant summary, transaction and payment-link API reads. +- Direct UPI QR generation and UPI Intent for the configured personal UPI ID. +- Hosted payment-link creation and merchant API-key create/list/sandbox access. +- LocalProof status boundary and explicit admin-session gating. +- CI workflow to build and upload separate Owner and LocalProof debug APK artifacts. + +## Important scope boundaries / remaining work +- This first pass uses native programmatic UI, not a pixel-perfect port of every web portal. Full portal parity, responsive visual QA, Material components, navigation state, accessibility and screenshots remain follow-up tasks. +- Merchant and global admin management require the dedicated secure owner/admin session. A merchant API key must never bypass that boundary. +- Refund and reconciliation screens call candidate endpoints if available; backend support and full action workflows need verification before marking complete. +- QR currently uses the configured receiving UPI ID; production configuration must be verified against the owner's actual UPI profile before release. +- No real device QA, debug APK artifact, production deployment, signed release APK, or production payment verification is claimed yet. +- Physical Android device testing is required for UPI app chooser, QR scanning, process recreation, offline states, and API error handling. + +## Release gates +1. CI build and tests pass. +2. Add backend contract tests for every screen/action and confirm route permissions. +3. Integrate owner/admin session using the existing secure auth flow; no raw admin token in app. +4. Load UPI profile from authenticated server config rather than hardcoding. +5. Implement full refund/reconciliation permissions and states. +6. Run Android 16 physical-device QA and accessibility checks. +7. User approves production rollout separately.