celzero / rethink-app

DNS over HTTPS / DNS over Tor / DNSCrypt client, WireGuard proxifier, firewall, and connection tracker for Android.
https://rethinkfirewall.com/
Apache License 2.0
3.01k stars 154 forks source link

Blocklist file not found #245

Closed ignoramous closed 3 years ago

ignoramous commented 3 years ago

As part of changes to downloads in v053b, it looks like we may have broken something drastically.

03-17 09:32:49.637 I/GoLog   (15229): Error At read file : build.go -> read_file_u16()
03-17 09:32:49.637 I/GoLog   (15229): open /data/data/com.celzero.bravedns/files/1607700204580/td.txt: no such file or directory
03-17 09:32:49.638 D/AndroidRuntime(15229): Shutting down VM                    
03-17 09:32:49.638 E/AndroidRuntime(15229): FATAL EXCEPTION: main               
03-17 09:32:49.638 E/AndroidRuntime(15229): Process: com.celzero.bravedns, PID: 15229
03-17 09:32:49.638 E/AndroidRuntime(15229): java.lang.RuntimeException: Unable to destroy activity {com.celzero.bravedns/com.celzero.bravedns.ui.DNSConfigureWebViewActivity}: go.Universe$proxyerror: open /data/data/com.celzero.bravedns/files/1607700204580/td.txt: no such file or directory
03-17 09:32:49.638 E/AndroidRuntime(15229): >---at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:4943)
03-17 09:32:49.638 E/AndroidRuntime(15229): >---at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:4972)
03-17 09:32:49.638 E/AndroidRuntime(15229): >---at android.app.servertransaction.DestroyActivityItem.execute(DestroyActivityItem.java:44)
03-17 09:32:49.638 E/AndroidRuntime(15229): >---at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:176)
03-17 09:32:49.638 E/AndroidRuntime(15229): >---at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)
03-17 09:32:49.638 E/AndroidRuntime(15229): >---at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2017)
03-17 09:32:49.638 E/AndroidRuntime(15229): >---at android.os.Handler.dispatchMessage(Handler.java:107)
03-17 09:32:49.638 E/AndroidRuntime(15229): >---at android.os.Looper.loop(Looper.java:214)
03-17 09:32:49.638 E/AndroidRuntime(15229): >---at android.app.ActivityThread.main(ActivityThread.java:7398)
03-17 09:32:49.638 E/AndroidRuntime(15229): >---at java.lang.reflect.Method.invoke(Native Method)
03-17 09:32:49.638 E/AndroidRuntime(15229): >---at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
03-17 09:32:49.638 E/AndroidRuntime(15229): >---at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:940)
03-17 09:32:49.638 E/AndroidRuntime(15229): Caused by: go.Universe$proxyerror: open /data/data/com.celzero.bravedns/files/1607700204580/td.txt: no such file or directory
03-17 09:32:49.638 E/AndroidRuntime(15229): >---at dnsx.Dnsx.newBraveDNSLocal(Native Method)
03-17 09:32:49.638 E/AndroidRuntime(15229): >---at com.celzero.bravedns.data.AppMode.getBraveDNS(AppMode.kt:207)
03-17 09:32:49.638 E/AndroidRuntime(15229): >---at com.celzero.bravedns.ui.DNSConfigureWebViewActivity.updateLocalStamp(DNSConfigureWebViewActivity.kt:179)
03-17 09:32:49.638 E/AndroidRuntime(15229): >---at com.celzero.bravedns.ui.DNSConfigureWebViewActivity.onDestroy(DNSConfigureWebViewActivity.kt:131)
03-17 09:32:49.638 E/AndroidRuntime(15229): >---at android.app.Activity.performDestroy(Activity.java:8067)
03-17 09:32:49.638 E/AndroidRuntime(15229): >---at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1342)
03-17 09:32:49.638 E/AndroidRuntime(15229): >---at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:4928)
03-17 09:32:49.638 E/AndroidRuntime(15229): >---... 11 more  
ignoramous commented 3 years ago

See also #252

hussainmohd-a commented 3 years ago

Fixed the blocklist issue of both the local and remote in v053d. Closing the issue and will open a new issue for further improvements. see #256

ignoramous commented 3 years ago

How was it fixed? What was the root cause? Commit?

hussainmohd-a commented 3 years ago

Local blocklist fix: Logic of handling the local blocklist download is modified as part of v053c release. Now the app uses work manager to monitor the status of the download instead of broadcast listeners. 454107af44cca0f8f4eacda3b30bec3f5d3932e8, #220

Remote blocklist fix: The download of filetag.json is initiated when the user clicks on Configure button. As per previous code, if the user exits the webview activity before the file is downloaded, the value for the download time(remote) in persistence state is updated without downloading the file. With the current implementation, unless the file is downloaded(STATUS SUCCESSFUL received from broadcast receiver), the download time will not be updated. In case of download failure, the download will be initiated next time. persistanceState.tempRemoteBlockListDownloadTime & persistentState.remoteBlockListDownloadTime.