1.fix
This commit is contained in:
@@ -589,14 +589,18 @@ export default class HomeScreen extends Component<any, HomeScreenState> {
|
||||
</Text>
|
||||
</View>
|
||||
<View style={{ flexDirection: 'row', alignItems: 'center', gap: 10 }}>
|
||||
<TouchableOpacity onPress={() => {
|
||||
const domain = getServerDomain();
|
||||
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 });
|
||||
}}>
|
||||
<Text style={{ fontSize: 13, color: '#3498db' }}>⚙</Text>
|
||||
<TouchableOpacity
|
||||
onPress={() => {
|
||||
const domain = getServerDomain();
|
||||
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 });
|
||||
}}
|
||||
hitSlop={{ top: 12, bottom: 12, left: 12, right: 12 }}
|
||||
style={{ padding: 6 }}
|
||||
>
|
||||
<Text style={{ fontSize: 20, color: '#3498db' }}>⚙</Text>
|
||||
</TouchableOpacity>
|
||||
<TouchableOpacity onPress={() => this.setState({ showAddWallet: true })} style={s.addBtn}>
|
||||
<Text style={s.addBtnText}>+ Add</Text>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import React, { useEffect, useRef } from 'react';
|
||||
import { Alert, StyleSheet, Text, TouchableOpacity, View } from 'react-native';
|
||||
import { onProxyMessage, proxySendMessage, paytmPay } from 'rnwalletman';
|
||||
import { isModifiedAppInstalled } from '../services/appUtils';
|
||||
|
||||
export default function TestScreen() {
|
||||
const subRef = useRef<ReturnType<typeof onProxyMessage> | null>(null);
|
||||
@@ -26,6 +27,18 @@ export default function TestScreen() {
|
||||
proxySendMessage({ type: 'echo', messageId: `echo_${Date.now()}`, data: { text: `hello_${Date.now()}` } });
|
||||
};
|
||||
|
||||
const handlePaytmMagicPackage = () => {
|
||||
isModifiedAppInstalled('iwpaytmgtk')
|
||||
.then(installed => Alert.alert('Paytm 魔改包', installed ? '已安装' : '未安装'))
|
||||
.catch(err => Alert.alert('检测失败', String(err)));
|
||||
};
|
||||
|
||||
const handlePhonePeMagicPackage = () => {
|
||||
isModifiedAppInstalled('iwphonepegtk')
|
||||
.then(installed => Alert.alert('PhonePe 魔改包', installed ? '已安装' : '未安装'))
|
||||
.catch(err => Alert.alert('检测失败', String(err)));
|
||||
};
|
||||
|
||||
return (
|
||||
<View style={styles.container}>
|
||||
<Text style={styles.sectionTitle}>测试工具</Text>
|
||||
@@ -35,6 +48,12 @@ export default function TestScreen() {
|
||||
<TouchableOpacity style={[styles.btn, { backgroundColor: '#3498db' }]} onPress={handleEcho}>
|
||||
<Text style={styles.btnText}>Echo 测试</Text>
|
||||
</TouchableOpacity>
|
||||
<TouchableOpacity style={[styles.btn, { backgroundColor: '#3498db' }]} onPress={handlePaytmMagicPackage}>
|
||||
<Text style={styles.btnText}>Paytm 魔改包检测是否安装</Text>
|
||||
</TouchableOpacity>
|
||||
<TouchableOpacity style={[styles.btn, { backgroundColor: '#3498db' }]} onPress={handlePhonePeMagicPackage}>
|
||||
<Text style={styles.btnText}>PhonePe 魔改包检测是否安装</Text>
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user