Skip to content

Commit 349c6e4

Browse files
committed
Ensure dirs + resolv.conf on every app launch via splash screen (#40)
The splash screen is the first screen on every app open — reinstall, update, or normal launch. Running setupDirs + writeResolv here guarantees the files exist before any screen can use proot. Co-Authored-By: Mithun Gowda B <mithungowda.b7411@gmail.com>
1 parent 9790134 commit 349c6e4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

flutter_app/lib/screens/splash_screen.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ class _SplashScreenState extends State<SplashScreen>
4646
try {
4747
setState(() => _status = 'Checking setup status...');
4848

49+
// Ensure directories and resolv.conf exist on every app open.
50+
// Android may clear the files directory during update or reinstall (#40).
51+
try { await NativeBridge.setupDirs(); } catch (_) {}
52+
try { await NativeBridge.writeResolv(); } catch (_) {}
53+
4954
final prefs = PreferencesService();
5055
await prefs.init();
5156

0 commit comments

Comments
 (0)