diff --git a/.gitignore b/.gitignore index 1578c81..c43bfc5 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,4 @@ android/.gradle/8.0.1/checksums/sha1-checksums.bin android/.idea/caches ios/build ios/Pods +android/app/release diff --git a/App.tsx b/App.tsx index d7a83c2..3c87ab8 100644 --- a/App.tsx +++ b/App.tsx @@ -1,5 +1,5 @@ import React, { Component } from "react"; -import { Alert, AppState, AppStateStatus, Modal, Switch, Text, TextInput, TouchableOpacity, View } from "react-native"; +import { Alert, AppState, AppStateStatus, Modal, Text, TextInput, TouchableOpacity, View } from "react-native"; import DeviceInfo from 'react-native-device-info'; import { PhonePeBusinessBind, @@ -65,7 +65,6 @@ export default class App extends Component { showServerSettings: false, settingsHost: '', settingsPort: '', - settingsHttps: true, }; this.deviceId = DeviceInfo.getUniqueIdSync(); @@ -640,24 +639,41 @@ export default class App extends Component { const colonIdx = domain.lastIndexOf(':'); const host = colonIdx > 0 ? domain.substring(0, colonIdx) : domain; const port = colonIdx > 0 ? domain.substring(colonIdx + 1) : ''; - this.setState({ showServerSettings: true, settingsHost: host, settingsPort: port, settingsHttps: getUseHttps() }); + this.setState({ showServerSettings: true, settingsHost: host, settingsPort: port }); }; saveDomain = async () => { - const { settingsHost, settingsPort, settingsHttps } = this.state; + const { settingsHost, settingsPort } = this.state; const domain = settingsPort ? `${settingsHost}:${settingsPort}` : settingsHost; - await saveServerDomain(domain, settingsHttps); + const useHttps = settingsPort === '443'; + await saveServerDomain(domain, useHttps); this.setState({ showServerSettings: false }); Alert.alert('已保存', '重启 App 后生效'); }; renderServerSettingsModal() { - const { showServerSettings, settingsHost, settingsPort, settingsHttps } = this.state; + const { showServerSettings, settingsHost, settingsPort } = this.state; + const presets = [ + { label: 'aa.pfgame.org', host: 'aa.pfgame.org', port: '443' }, + { label: 'game.ainavx.com:16000', host: 'game.ainavx.com', port: '16000' }, + { label: '192.168.1.117:16000', host: '192.168.1.117', port: '16000' }, + ]; return ( - 服务器设置 + 服务器设置 + + {presets.map(p => ( + this.setState({ settingsHost: p.host, settingsPort: p.port })} + style={{ paddingHorizontal: 10, paddingVertical: 5, borderRadius: 6, backgroundColor: settingsHost === p.host && settingsPort === p.port ? '#3498db' : '#f0f0f0' }} + > + {p.label} + + ))} + Host { /> Port this.setState({ settingsPort: t })} placeholder="16000" keyboardType="number-pad" /> - - 使用 HTTPS / WSS - this.setState({ settingsHttps: v })} /> - this.setState({ showServerSettings: false })} style={{ paddingHorizontal: 16, paddingVertical: 8, marginRight: 10 }}> 取消 diff --git a/android/keys/rnpay_release.jks b/android/keys/rnpay_release.jks new file mode 100644 index 0000000..995836f Binary files /dev/null and b/android/keys/rnpay_release.jks differ diff --git a/servers/walletman b/servers/walletman index cfd46bb..8b3e2b2 160000 --- a/servers/walletman +++ b/servers/walletman @@ -1 +1 @@ -Subproject commit cfd46bb59ce1bf39ecb4de9aca79a0919c8212d5 +Subproject commit 8b3e2b27852c1216fcce99d864e20db81caf8758 diff --git a/types.ts b/types.ts index 300b922..f1afe27 100644 --- a/types.ts +++ b/types.ts @@ -31,5 +31,4 @@ export interface WalletmanAppState { showServerSettings: boolean; settingsHost: string; settingsPort: string; - settingsHttps: boolean; }