From 0d168c904607d2e27d8de4d1f1ac6cc49f6c5396 Mon Sep 17 00:00:00 2001
From: TQCasey <494294315@qq.com>
Date: Wed, 25 Mar 2026 21:19:58 +0800
Subject: [PATCH] fix fix fix
---
App.tsx | 12 +--
android/.idea/deploymentTargetSelector.xml | 4 +-
android/.idea/deviceManager.xml | 13 ++++
android/.idea/gradle.xml | 1 +
android/app/build.gradle | 9 +++
screens/HomeScreen.tsx | 86 +++++++++++-----------
screens/MessageScreen.tsx | 6 +-
screens/TestScreen.tsx | 22 +++---
servers/walletman | 2 +-
types.ts | 4 +-
10 files changed, 91 insertions(+), 68 deletions(-)
create mode 100644 android/.idea/deviceManager.xml
diff --git a/App.tsx b/App.tsx
index 8e44486..4891de6 100644
--- a/App.tsx
+++ b/App.tsx
@@ -51,8 +51,8 @@ export default function App() {
name="Home"
component={HomeScreen}
options={{
- title: '钱包列表',
- tabBarLabel: '钱包列表',
+ title: 'Wallets',
+ tabBarLabel: 'Wallets',
tabBarIcon: ({ color, size }) => ,
}}
/>
@@ -60,8 +60,8 @@ export default function App() {
name="Test"
component={TestScreen}
options={{
- title: '测试',
- tabBarLabel: '测试',
+ title: 'Test',
+ tabBarLabel: 'Test',
tabBarIcon: ({ color, size }) => ,
}}
/>
@@ -69,8 +69,8 @@ export default function App() {
name="Message"
component={MessageScreen}
options={{
- title: 'IM消息',
- tabBarLabel: 'IM消息',
+ title: 'Messages',
+ tabBarLabel: 'Messages',
tabBarIcon: ({ color, size }) => ,
}}
/>
diff --git a/android/.idea/deploymentTargetSelector.xml b/android/.idea/deploymentTargetSelector.xml
index 00a50ef..bd3fece 100644
--- a/android/.idea/deploymentTargetSelector.xml
+++ b/android/.idea/deploymentTargetSelector.xml
@@ -4,10 +4,10 @@
-
+
-
+
diff --git a/android/.idea/deviceManager.xml b/android/.idea/deviceManager.xml
new file mode 100644
index 0000000..91f9558
--- /dev/null
+++ b/android/.idea/deviceManager.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/android/.idea/gradle.xml b/android/.idea/gradle.xml
index 29d0d9e..124abdb 100644
--- a/android/.idea/gradle.xml
+++ b/android/.idea/gradle.xml
@@ -32,6 +32,7 @@
+
diff --git a/android/app/build.gradle b/android/app/build.gradle
index 75a7f15..3eac50c 100644
--- a/android/app/build.gradle
+++ b/android/app/build.gradle
@@ -81,6 +81,15 @@ android {
versionCode 1
versionName "1.0"
}
+
+ splits {
+ abi {
+ enable true
+ reset()
+ include "arm64-v8a"
+ universalApk false
+ }
+ }
signingConfigs {
debug {
storeFile file('debug.keystore')
diff --git a/screens/HomeScreen.tsx b/screens/HomeScreen.tsx
index 8c93083..1b8dbed 100644
--- a/screens/HomeScreen.tsx
+++ b/screens/HomeScreen.tsx
@@ -40,7 +40,7 @@ import {
import Api, { WalletItem, loadServerDomain, saveServerDomain, getServerDomain } from '../services/api';
-// key 与服务端 WalletType 字符串一致(见 types.go)
+// key matches server WalletType string (see types.go)
const WALLET_ICONS: Record = {
'paytm': require('../res/paytm.png'),
'paytm business': require('../res/paytm-business.png'),
@@ -63,7 +63,7 @@ const WALLET_TYPE_COLORS: Record = {
'freecharge': '#ff5722',
};
-// 钱包类型展示信息(walletType 与服务端一致)
+// wallet type display info (walletType matches server)
const WALLET_TYPE_OPTIONS = [
{ key: 'paytm_personal_otp', walletType: 'paytm', label: 'Paytm Personal (OTP)', mode: 'otp' },
{ key: 'paytm_personal_token', walletType: 'paytm', label: 'Paytm Personal (Token)', mode: 'token' },
@@ -201,7 +201,7 @@ export default class HomeScreen extends Component {
onError: (error: string) => this.setState({ proxyStatus: 'error', proxyError: error }),
});
} catch (error) {
- console.error('[Proxy] 初始化失败:', error);
+ console.error('[Proxy] init failed:', error);
}
}
@@ -252,7 +252,7 @@ export default class HomeScreen extends Component {
wallets: s.wallets.map(w => w.id === walletId ? { ...w, upi: vpa } : w),
}));
} catch (e) {
- Alert.alert('设置失败', (e as Error).message);
+ Alert.alert('Set Failed', (e as Error).message);
}
};
@@ -273,11 +273,11 @@ export default class HomeScreen extends Component {
const wt = typeMap[key as string];
if (wt) await Api.instance.register(wt as WalletType, result);
this.setState({ [key]: false } as any);
- Alert.alert('绑定成功', msg);
+ Alert.alert('Bind Success', msg);
this.fetchWallets();
} catch (error) {
this.setState({ [key]: false } as any);
- Alert.alert('绑定失败', (error as Error).message);
+ Alert.alert('Bind Failed', (error as Error).message);
}
};
@@ -293,7 +293,7 @@ export default class HomeScreen extends Component {
if (showPaytmPersonalBind && paytmPersonalBindType === 'tokenMode') return (
- { Alert.alert('绑定失败', e); close('showPaytmPersonalBind')(); }} />
+ { Alert.alert('Bind Failed', e); close('showPaytmPersonalBind')(); }} />
);
if (showPaytmPersonalBind) return (
@@ -301,14 +301,14 @@ export default class HomeScreen extends Component {
{ try { return await Api.instance.requestOTP(wt, p.mobile, {}); } catch (e) { return { success: false, message: (e as Error).message }; } }}
onVerifyOTP={async (wt, p) => { try { return await Api.instance.verifyOTP(wt, p.mobile, p.otp, { sessionId: p.sessionId }); } catch (e) { return { success: false, message: (e as Error).message }; } }}
- onSuccess={(r: PaytmPersonalBindResult) => { Alert.alert('绑定成功', 'Paytm Personal OTP'); this.setState({ showPaytmPersonalBind: false }); this.fetchWallets(); }}
- onError={(e: string) => { Alert.alert('绑定失败', e); close('showPaytmPersonalBind')(); }}
+ onSuccess={(r: PaytmPersonalBindResult) => { Alert.alert('Bind Success', 'Paytm Personal OTP'); this.setState({ showPaytmPersonalBind: false }); this.fetchWallets(); }}
+ onError={(e: string) => { Alert.alert('Bind Failed', e); close('showPaytmPersonalBind')(); }}
/>
);
if (showPhonePePersonalBind && phonePePersonalBindType === 'tokenMode') return (
- { Alert.alert('绑定失败', e); close('showPhonePePersonalBind')(); }} />
+ { Alert.alert('Bind Failed', e); close('showPhonePePersonalBind')(); }} />
);
if (showPhonePePersonalBind) return (
@@ -316,8 +316,8 @@ export default class HomeScreen extends Component {
{ try { return await Api.instance.requestOTP(wt, p.mobile, {}); } catch (e) { return { success: false, message: (e as Error).message }; } }}
onVerifyOTP={async (wt, p) => { try { return await Api.instance.verifyOTP(wt, p.mobile, p.otp, { sessionId: p.sessionId }); } catch (e) { return { success: false, message: (e as Error).message }; } }}
- onSuccess={(r: PhonePePersonalBindResult) => { Alert.alert('绑定成功', 'PhonePe Personal OTP'); this.setState({ showPhonePePersonalBind: false }); this.fetchWallets(); }}
- onError={(e: string) => { Alert.alert('绑定失败', e); close('showPhonePePersonalBind')(); }}
+ onSuccess={(r: PhonePePersonalBindResult) => { Alert.alert('Bind Success', 'PhonePe Personal OTP'); this.setState({ showPhonePePersonalBind: false }); this.fetchWallets(); }}
+ onError={(e: string) => { Alert.alert('Bind Failed', e); close('showPhonePePersonalBind')(); }}
/>
);
@@ -326,16 +326,16 @@ export default class HomeScreen extends Component {
{ try { return await Api.instance.requestOTP(wt, p.mobile, { password: p.password }); } catch (e) { return { success: false, message: (e as Error).message }; } }}
onVerifyOTP={async (wt, p) => { try { return await Api.instance.verifyOTP(wt, p.mobile, p.otp, { sessionId: p.sessionId }); } catch (e) { return { success: false, message: (e as Error).message }; } }}
- onSuccess={this.handleBindSuccess('showPaytmBusinessBind', 'Paytm Business 绑定成功') as any}
- onError={(e: string) => { Alert.alert('绑定失败', e); close('showPaytmBusinessBind')(); }}
+ onSuccess={this.handleBindSuccess('showPaytmBusinessBind', 'Paytm Business bound successfully') as any}
+ onError={(e: string) => { Alert.alert('Bind Failed', e); close('showPaytmBusinessBind')(); }}
/>
);
if (showPhonePeBusinessBind) return (
{ Alert.alert('绑定失败', e); close('showPhonePeBusinessBind')(); }}
+ onSuccess={this.handleBindSuccess('showPhonePeBusinessBind', 'PhonePe Business bound successfully') as any}
+ onError={(e: string) => { Alert.alert('Bind Failed', e); close('showPhonePeBusinessBind')(); }}
onRenderBottomView={({ showOtpInput, loading, formError, phone, otp, onPhoneChange, onOtpChange, onGetOtp, onSubmitOtp }) => (
{!showOtpInput ? (<>
@@ -354,7 +354,7 @@ export default class HomeScreen extends Component {
);
if (showGooglePayBusinessBind) return (
- { Alert.alert('绑定失败', e); close('showGooglePayBusinessBind')(); }} />
+ { Alert.alert('Bind Failed', e); close('showGooglePayBusinessBind')(); }} />
);
if (showBharatPeBusinessBind) return (
@@ -362,8 +362,8 @@ export default class HomeScreen extends Component {
{ try { return await Api.instance.requestOTP(wt, p.mobile); } catch (e) { return { success: false, message: (e as Error).message }; } }}
onVerifyOTP={async (wt, p) => { try { return await Api.instance.verifyOTP(wt, p.mobile, p.otp, { sessionId: p.sessionId }); } catch (e) { return { success: false, message: (e as Error).message }; } }}
- onSuccess={this.handleBindSuccess('showBharatPeBusinessBind', 'BharatPe Business 绑定成功') as any}
- onError={(e: string) => { Alert.alert('绑定失败', e); close('showBharatPeBusinessBind')(); }}
+ onSuccess={this.handleBindSuccess('showBharatPeBusinessBind', 'BharatPe Business bound successfully') as any}
+ onError={(e: string) => { Alert.alert('Bind Failed', e); close('showBharatPeBusinessBind')(); }}
/>
);
@@ -372,8 +372,8 @@ export default class HomeScreen extends Component {
{ try { return await Api.instance.requestOTP(wt, p.mobile, { deviceId: p.deviceId, tuneUserId: p.tuneUserId }); } catch (e) { return { success: false, message: (e as Error).message }; } }}
onVerifyOTP={async (wt, p) => { try { return await Api.instance.verifyOTP(wt, p.mobile, p.otp, { sessionId: p.sessionId, deviceId: p.deviceId, tuneUserId: p.tuneUserId, nid: p.nid }); } catch (e) { return { success: false, message: (e as Error).message }; } }}
- onSuccess={this.handleBindSuccess('showMobikwikPersonalBind', 'Mobikwik 绑定成功') as any}
- onError={(e: string) => { Alert.alert('绑定失败', e); close('showMobikwikPersonalBind')(); }}
+ onSuccess={this.handleBindSuccess('showMobikwikPersonalBind', 'Mobikwik bound successfully') as any}
+ onError={(e: string) => { Alert.alert('Bind Failed', e); close('showMobikwikPersonalBind')(); }}
/>
);
@@ -382,8 +382,8 @@ export default class HomeScreen extends Component {
{ try { return await Api.instance.requestOTP(wt, p.mobile); } catch (e) { return { success: false, message: (e as Error).message }; } }}
onVerifyOTP={async (wt, p) => { try { return await Api.instance.verifyOTP(wt, p.mobile, p.otp, { otpId: p.otpId, deviceId: p.deviceId, csrfId: p.csrfId, appFc: p.appFc }); } catch (e) { return { success: false, message: (e as Error).message }; } }}
- onSuccess={this.handleBindSuccess('showFreechargePersonalBind', 'Freecharge 绑定成功') as any}
- onError={(e: string) => { Alert.alert('绑定失败', e); close('showFreechargePersonalBind')(); }}
+ onSuccess={this.handleBindSuccess('showFreechargePersonalBind', 'Freecharge bound successfully') as any}
+ onError={(e: string) => { Alert.alert('Bind Failed', e); close('showFreechargePersonalBind')(); }}
/>
);
@@ -420,7 +420,7 @@ export default class HomeScreen extends Component {
style={s.addModalBox}
>
- 选择钱包类型
+ Select Wallet Type
this.setState({ showAddWallet: false })}>
✕
@@ -452,7 +452,7 @@ export default class HomeScreen extends Component {
- 服务器设置
+ Server Settings
{presets.map(p => (
this.setState({ settingsHost: p.host, settingsPort: p.port })}
@@ -467,16 +467,16 @@ export default class HomeScreen extends Component {
this.setState({ settingsPort: t })} placeholder="16000" keyboardType="number-pad" />
this.setState({ showServerSettings: false })} style={{ paddingHorizontal: 16, paddingVertical: 8, marginRight: 10 }}>
- 取消
+ Cancel
{
const { settingsHost, settingsPort } = this.state;
const domain = settingsPort ? `${settingsHost}:${settingsPort}` : settingsHost;
await saveServerDomain(domain, settingsPort === '443');
this.setState({ showServerSettings: false });
- Alert.alert('已保存', '重启 App 后生效');
+ Alert.alert('Saved', 'Restart app to take effect');
}} style={s.saveBtn}>
- 保存
+ Save
@@ -522,14 +522,14 @@ export default class HomeScreen extends Component {
useNativeDriver
style={s.vpaModalBox}
>
- 选择 VPA
+ Select VPA
{vpaModalWallet?.phone}
{vpaModalLoading
?
: vpaModalVpas.length === 0
- ? 无 VPA 数据
+ ? No VPA data
: vpaModalVpas.map(vpa => {
const selected = vpa === vpaModalSelected;
return (
@@ -551,14 +551,14 @@ export default class HomeScreen extends Component {
- 取消
+ Cancel
- 确认
+ Confirm
@@ -570,22 +570,22 @@ export default class HomeScreen extends Component {
render() {
const { proxyStatus, proxyError, wallets, loadingWallets } = this.state;
const proxyCfg: Record = {
- idle: { label: '未连接', color: '#95a5a6' },
- connecting: { label: '连接中…', color: '#f39c12' },
- connected: { label: '已连接', color: '#2ecc71' },
- disconnected: { label: '已断开', color: '#e74c3c' },
- error: { label: '连接失败', color: '#e74c3c' },
+ idle: { label: 'Idle', color: '#95a5a6' },
+ connecting: { label: 'Connecting…', color: '#f39c12' },
+ connected: { label: 'Connected', color: '#2ecc71' },
+ disconnected: { label: 'Disconnected', color: '#e74c3c' },
+ error: { label: 'Error', color: '#e74c3c' },
};
const { label, color } = proxyCfg[proxyStatus];
return (
- {/* 顶栏 */}
+ {/* top bar */}
- Proxy {label}{proxyStatus === 'error' && proxyError ? `:${proxyError}` : ''}
+ Proxy {label}{proxyStatus === 'error' && proxyError ? `: ${proxyError}` : ''}
@@ -608,11 +608,11 @@ export default class HomeScreen extends Component {
- {/* 钱包列表 */}
+ {/* wallet list */}
- 已绑定钱包
+ Bound Wallets
- {loadingWallets ? '刷新中…' : '刷新'}
+ {loadingWallets ? 'Refreshing…' : 'Refresh'}
@@ -624,7 +624,7 @@ export default class HomeScreen extends Component {
renderItem={this.renderWalletItem}
ListEmptyComponent={
- {loadingWallets ? '加载中…' : '暂无绑定钱包,点右上角 + Add 添加'}
+ {loadingWallets ? 'Loading…' : 'No wallets. Tap + Add to get started.'}
}
/>
diff --git a/screens/MessageScreen.tsx b/screens/MessageScreen.tsx
index 23aa8c7..c14c7e4 100644
--- a/screens/MessageScreen.tsx
+++ b/screens/MessageScreen.tsx
@@ -9,9 +9,9 @@ interface Message {
}
const MOCK_MESSAGES: Message[] = [
- { id: '1', title: '系统通知', content: '欢迎使用 RNPay,绑定钱包开始使用。', time: '10:00' },
- { id: '2', title: '代理连接', content: '代理服务已成功连接到服务器。', time: '10:05' },
- { id: '3', title: '绑定提醒', content: '您有钱包待绑定,请前往首页操作。', time: '10:10' },
+ { id: '1', title: 'System Notification', content: 'Welcome to RNPay. Bind a wallet to get started.', time: '10:00' },
+ { id: '2', title: 'Proxy Connected', content: 'Proxy service connected to server successfully.', time: '10:05' },
+ { id: '3', title: 'Bind Reminder', content: 'You have wallets pending setup. Go to Home to bind them.', time: '10:10' },
];
export default class MessageScreen extends Component {
diff --git a/screens/TestScreen.tsx b/screens/TestScreen.tsx
index e96822c..e45ac38 100644
--- a/screens/TestScreen.tsx
+++ b/screens/TestScreen.tsx
@@ -9,7 +9,7 @@ export default function TestScreen() {
useEffect(() => {
subRef.current = onProxyMessage((msg) => {
if (msg.type === 'echo') {
- Alert.alert('Echo 回来了', JSON.stringify(msg.data));
+ Alert.alert('Echo Response', JSON.stringify(msg.data));
}
});
return () => {
@@ -20,7 +20,7 @@ export default function TestScreen() {
const handlePaytmPay = () => {
paytmPay('100', 'Gurvir singh', '296001000405', 'ICIC0002960', 'ABCDEF')
.then(result => console.log(result))
- .catch(error => Alert.alert('代付失败', String(error)));
+ .catch(error => Alert.alert('Transfer Failed', String(error)));
};
const handleEcho = () => {
@@ -29,30 +29,30 @@ export default function TestScreen() {
const handlePaytmMagicPackage = () => {
isModifiedAppInstalled('iwpaytmgtk')
- .then(installed => Alert.alert('Paytm 魔改包', installed ? '已安装' : '未安装'))
- .catch(err => Alert.alert('检测失败', String(err)));
+ .then(installed => Alert.alert('Paytm Modified App', installed ? 'Installed' : 'Not Installed'))
+ .catch(err => Alert.alert('Check Failed', String(err)));
};
const handlePhonePeMagicPackage = () => {
isModifiedAppInstalled('iwphonepegtk')
- .then(installed => Alert.alert('PhonePe 魔改包', installed ? '已安装' : '未安装'))
- .catch(err => Alert.alert('检测失败', String(err)));
+ .then(installed => Alert.alert('PhonePe Modified App', installed ? 'Installed' : 'Not Installed'))
+ .catch(err => Alert.alert('Check Failed', String(err)));
};
return (
- 测试工具
+ Test Tools
- Paytm Pay 代付测试
+ Paytm Pay Transfer Test
- Echo 测试
+ Echo Test
- Paytm 魔改包检测是否安装
+ Check Paytm Modified App
- PhonePe 魔改包检测是否安装
+ Check PhonePe Modified App
);
diff --git a/servers/walletman b/servers/walletman
index 82bbbe9..366576c 160000
--- a/servers/walletman
+++ b/servers/walletman
@@ -1 +1 @@
-Subproject commit 82bbbe9a31eff09cc49d2c3228e1bb4e88da3c5c
+Subproject commit 366576ca6e52105fb5e0116c7b24a603e4df6e33
diff --git a/types.ts b/types.ts
index f1afe27..eabd2b1 100644
--- a/types.ts
+++ b/types.ts
@@ -23,11 +23,11 @@ export interface WalletmanAppState {
/* Freecharge Personal */
showFreechargePersonalBind: boolean;
- /* Proxy 状态 */
+ /* Proxy status */
proxyStatus: 'idle' | 'connecting' | 'connected' | 'disconnected' | 'error';
proxyError?: string;
- /* Server 设置 */
+ /* Server settings */
showServerSettings: boolean;
settingsHost: string;
settingsPort: string;