Open grote opened 2 months ago
[The docs](https://developer.android.com/reference/android/app/Application#onCreate()) are saying about Application#onCreate()
:
Called when the application is starting, before any activity, service, or receiver objects (excluding content providers) have been created.
Implementations should be as quick as possible (for example using lazy initialization of state) since the time spent in this function directly impacts the performance of starting the first activity, service, or receiver in a process.
However, it seems that this isn't always true when services are launched. Maybe a platform bug :shrug:
When the Android system is trying to back up the app to one of its backup transports (e.g. Google Backup or Seedvault), Orbot crashes and with it the entire backup, essentially DoSing system backup.
The
SharedPreferences
seem to be a static field in a helper class that is not initialized when theOrbotService
gets started for some reason. See https://github.com/guardianproject/orbot/blob/939ce1d58db6810f51f833cb33dd51235f1eed69/orbotservice/src/main/java/org/torproject/android/service/util/Prefs.java#L50The prefs are only initialized here: https://github.com/guardianproject/orbot/blob/939ce1d58db6810f51f833cb33dd51235f1eed69/app/src/main/java/org/torproject/android/OrbotApp.kt#L26
which maybe isn't called when invoked from a backup agent?
When backup is set up, should be reproducible when running