console.log("🔥 当前 App.tsx 已加载"); import * as React from "react"; import { NavigationContainer } from "@react-navigation/native"; import { createNativeStackNavigator } from "@react-navigation/native-stack"; import HomeScreen from "./src/HomeScreen"; import ScanScreen from "./src/ScanScreen"; import ScanScreen2 from "./src/ScanScreen2"; import ScanScreen3 from "./src/ScanScreen3"; import InfoScreen from "./src/InfoScreen"; import DfuScreen from "./src/DfuScreen"; import PrivacyScreen from "./src/PrivacyScreen"; import SplashScreen from "./src/SplashScreen"; // ✅ 新增启动页 import SettingScreen from "./src/SettingScreen"; import './src/i18n' import InfoScreen2 from "./src/InfoScreen2"; import InfoScreen3 from "./src/InfoScreen3"; import SpindownScreen from "./src/SpindownScreen"; import { decode } from "base-64"; // 不要 global.atob // 不要 atob const base64ToBytes = (base64: string): number[] => { const binary = decode(base64); const bytes: number[] = []; for (let i = 0; i < binary.length; i++) { bytes.push(binary.charCodeAt(i)); } return bytes; }; export type RootStackParamList = { Splash: undefined; Home: undefined; Scan: undefined; ScanScreen2: undefined; ScanScreen3: undefined; Info: { peripheral: any }; Info2: { peripheral: any }; Info3: { peripheral: any }; Spindown: { peripheral: any }; Dfu: { deviceId: string; systemId?: string; address?: string | number; name: string; firmware: string; }; Privacy: undefined; Setting: undefined; }; const Stack = createNativeStackNavigator(); export default function App() { //linshi React.useEffect(() => { const test = async () => { try { console.log("🔥 App.tsx fetch test start"); const resp = await fetch("https://www.baidu.com"); console.log("🔥 App.tsx fetch status =", resp.status); const text = await resp.text(); console.log("🔥 App.tsx fetch text length =", text.length); } catch (e) { console.log("❌ App.tsx fetch error =", e); } }; test(); }, []); return ( {/* 启动页(无标题) */} {/* 首页(标题栏无文字) */} {/* 其他页面默认显示标题栏 */} ); }