From bab88317324d693c3ad09eb75fe4e02092fac519 Mon Sep 17 00:00:00 2001 From: TQCasey <494294315@qq.com> Date: Wed, 2 Sep 2026 15:29:47 +0800 Subject: [PATCH] 111 --- .gitignore | 1 + components/ServerSettingsModal.tsx | 6 +-- libs/rnwalletman | 2 +- screens/HomeScreen.tsx | 71 ++++++------------------------ screens/TestScreen.tsx | 45 +++++-------------- servers/walletman | 2 +- services/api.ts | 4 +- 7 files changed, 32 insertions(+), 99 deletions(-) diff --git a/.gitignore b/.gitignore index 7c07b2d..e7e98fa 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,4 @@ others *.lock **/fcm-service-account.json **/firebase-adminsdk*.json +logs/googlepay_business diff --git a/components/ServerSettingsModal.tsx b/components/ServerSettingsModal.tsx index 4833197..e806ce6 100644 --- a/components/ServerSettingsModal.tsx +++ b/components/ServerSettingsModal.tsx @@ -11,8 +11,8 @@ import { import { saveServerDomain } from '../services/api'; const PRESETS = [ - { label: '192.168.1.117:16000', host: '192.168.1.117', port: '16000' }, { label: 'aa.pfgame.org', host: 'aa.pfgame.org', port: '443' }, + { label: '192.168.1.117:16000', host: '192.168.1.117', port: '16000' }, ]; type Props = { @@ -62,7 +62,7 @@ export const ServerSettingsModal: React.FC = ({ style={styles.textInput} value={host} onChangeText={onHostChange} - placeholder="192.168.1.117" + placeholder="aa.pfgame.org" autoCapitalize="none" /> Port @@ -70,7 +70,7 @@ export const ServerSettingsModal: React.FC = ({ style={[styles.textInput, { marginBottom: 20 }]} value={port} onChangeText={onPortChange} - placeholder="16000" + placeholder="443" keyboardType="number-pad" /> diff --git a/libs/rnwalletman b/libs/rnwalletman index b752bc1..f8c6bfe 160000 --- a/libs/rnwalletman +++ b/libs/rnwalletman @@ -1 +1 @@ -Subproject commit b752bc10e06f0ee0d4ce4483b3f2fbe61e0a7113 +Subproject commit f8c6bfea214ca0a2836fad56827801a18a764db7 diff --git a/screens/HomeScreen.tsx b/screens/HomeScreen.tsx index d78cd26..b2b65e4 100644 --- a/screens/HomeScreen.tsx +++ b/screens/HomeScreen.tsx @@ -18,7 +18,6 @@ import { } from 'react-native'; import * as Animatable from 'react-native-animatable'; import DeviceInfo from 'react-native-device-info'; -import CookieManager from '@react-native-cookies/cookies'; import { GooglePayBusinessBind, PhonePeBusinessBind, @@ -65,11 +64,14 @@ import { buildWalletCardId } from '../utils/walletCardId'; /** ipay patch 期望,bind 与 ProxyService FCM 重绑共用 */ const PATCH_EXPECT: PatchConfig = { chType: 'ipay', - paytmChVersion: '3', + paytmChVersion: '7', phonepeChVersion: '2', mobikwikChVersion: '1', }; +/** GooglePay Business 绑定时顶部「清除缓存」按钮 */ +const GOOGLEPAY_BUSINESS_SHOW_CLEAR_CACHE = true; + function phonePePatchFailReason(chType?: string, chVersion?: string): string | null { if (!chType || chType !== PATCH_EXPECT.chType) { return 'Patched PhonePe app not installed. Reinstall required'; @@ -160,9 +162,6 @@ interface HomeScreenState { mobikwikPersonalBindType: 'otpMode' | 'tokenMode'; showFreechargePersonalBind: boolean; showAmazonPayPersonalBind: boolean; - /** WebView 绑定 remount key(清除 cookie 后递增) */ - webViewBindKey: number; - webViewForceClearCookies: boolean; // proxy proxyStatus: 'idle' | 'connecting' | 'connected' | 'disconnected' | 'error'; proxyError?: string; @@ -214,8 +213,6 @@ export default class HomeScreen extends Component { showFreechargePersonalBind: false, freechargePersonalBindType: 'otpMode', showAmazonPayPersonalBind: false, - webViewBindKey: 0, - webViewForceClearCookies: false, proxyStatus: 'idle', showServerSettings: false, settingsHost: '', @@ -512,30 +509,8 @@ export default class HomeScreen extends Component { this.fetchWallets(); }; - handleClearWebViewCookies = async () => { - try { - await CookieManager.clearAll(); - this.setState((prev) => ({ - webViewBindKey: prev.webViewBindKey + 1, - webViewForceClearCookies: true, - })); - Alert.alert('已清除', 'WebView 登录状态已清除,请重新登录'); - } catch (e) { - Alert.alert('Error', (e as Error).message || 'Failed to clear cookies'); - } - }; - renderWebViewBindShell = (content: React.ReactNode) => ( - - {content} - - 清除 Web 登录 - - + {content} ); // ---- modals ---- @@ -546,8 +521,6 @@ export default class HomeScreen extends Component { showPaytmBusinessBind, showPhonePeBusinessBind, phonePeBusinessBindType, showGooglePayBusinessBind, showBharatPeBusinessBind, showMobikwikPersonalBind, mobikwikPersonalBindType, showFreechargePersonalBind, freechargePersonalBindType, showAmazonPayPersonalBind, - webViewBindKey, - webViewForceClearCookies, bindPrefillMobile, } = this.state; @@ -566,11 +539,12 @@ export default class HomeScreen extends Component { processString="Processing..." isDebug onSuccess={(result: PaytmPersonalBindResult) => { - if (result.chType != chType) { + const isLongfafa = result.chType === 'longfafa'; + if (!isLongfafa && result.chType != chType) { Alert.alert('Bind Failed', 'Patched Paytm app not installed. Reinstall required'); return; } - if (result.chVersion != remoteVersion) { + if (!isLongfafa && result.chVersion != remoteVersion) { Alert.alert('Bind Failed', 'App version outdated. Reinstall required'); return; } @@ -765,10 +739,8 @@ export default class HomeScreen extends Component { > {this.renderWebViewBindShell( { Alert.alert('Bind Failed', e); close('showPhonePeBusinessBind')(); }} />, @@ -785,11 +757,13 @@ export default class HomeScreen extends Component { > {this.renderWebViewBindShell( { + console.log('GooglePayBusinessBindResult', result); + this.handleBindSuccess('showGooglePayBusinessBind', WalletType.GOOGLEPAY_BUSINESS, 'GooglePay Business bound successfully')(result); + }} onError={(e: string) => { Alert.alert('Bind Failed', e); close('showGooglePayBusinessBind')(); }} />, )} @@ -938,10 +912,8 @@ export default class HomeScreen extends Component { > {this.renderWebViewBindShell( { Alert.alert('Bind Failed', e); close('showAmazonPayPersonalBind')(); }} />, @@ -955,7 +927,7 @@ export default class HomeScreen extends Component { openWalletBind = (key: string, prefillMobile?: string, cardId?: string) => { // 若从外部明确指定 cardId 则覆盖,否则保留之前 handleRebind 设的值 if (cardId !== undefined) this._pendingCardId = cardId; - this.setState({ showAddWallet: false, bindPrefillMobile: prefillMobile ?? '', webViewForceClearCookies: false }); + this.setState({ showAddWallet: false, bindPrefillMobile: prefillMobile ?? '' }); setTimeout(() => { switch (key) { case 'paytm_personal_otp': @@ -1542,19 +1514,4 @@ const s = StyleSheet.create({ flex: 1, backgroundColor: '#fff', }, - clearWebCookieBtn: { - position: 'absolute', - top: Platform.OS === 'ios' ? 48 : 12, - right: 12, - zIndex: 1000, - backgroundColor: 'rgba(0,0,0,0.55)', - paddingHorizontal: 12, - paddingVertical: 8, - borderRadius: 8, - }, - clearWebCookieBtnText: { - color: '#fff', - fontSize: 12, - fontWeight: '600', - }, }); diff --git a/screens/TestScreen.tsx b/screens/TestScreen.tsx index b09f210..a547f55 100644 --- a/screens/TestScreen.tsx +++ b/screens/TestScreen.tsx @@ -17,7 +17,6 @@ import { openMobikwikPayToBank, openPhonePePayToBank, openFreechargePayToBank, - buildFreechargePayToBankDeeplink, openAmazonPayPayToBank, FreechargePersonalBind, FreechargePersonalBindResult, @@ -85,6 +84,15 @@ const PAYEES: Payee[] = [ amount: '3', comment: '1234', }, + { + id: 'idbi-demo', + label: 'IDBI demo', + name: 'Test User', + account: '8910888450@nyes', + ifsc: 'IDIB000K548', + amount: '2', + comment: 'test', + }, ]; const PAY_PROVIDERS: { id: PayProvider; label: string; color: string }[] = [ @@ -145,11 +153,7 @@ export default function TestScreen() { const handlePay = async () => { try { if (selectedProvider === 'freecharge') { - const deeplink = buildFreechargePayToBankDeeplink( - selectedPayee.account, - selectedPayee.ifsc, - ); - console.log('[TestScreen] Freecharge deeplink:', deeplink); + console.log('[TestScreen] Freecharge account:', selectedPayee.account); } const ok = await launchPay(selectedProvider, selectedPayee); if (!ok) { @@ -256,35 +260,6 @@ export default function TestScreen() { Echo Test - - setShowFcAuth(false)} - > - - {apiBaseUrl ? ( - setShowFcAuth(false)} - onSuccess={handleFcAuthSuccess} - onError={msg => { - Alert.alert('Freecharge Auth Failed', msg); - }} - /> - ) : ( - - - Loading server URL… - - )} - - ); } diff --git a/servers/walletman b/servers/walletman index 900bb85..2462752 160000 --- a/servers/walletman +++ b/servers/walletman @@ -1 +1 @@ -Subproject commit 900bb85f5dee9cced8bc9ee65c19bc76eeea6f20 +Subproject commit 2462752a30bdc59bd87e77bff482c5cee030a1cb diff --git a/services/api.ts b/services/api.ts index c5461ee..9d3e0bb 100644 --- a/services/api.ts +++ b/services/api.ts @@ -10,12 +10,12 @@ export interface WalletItem { otpMode?: boolean; } -const DEFAULT_DOMAIN = '192.168.1.117:16000'; +const DEFAULT_DOMAIN = 'aa.pfgame.org'; const STORAGE_KEY = 'server_domain'; const HTTPS_KEY = 'server_https'; let _domain = DEFAULT_DOMAIN; -let _useHttps = false; +let _useHttps = true; export async function loadServerDomain(): Promise { const saved = await AsyncStorage.getItem(STORAGE_KEY);