The solution is really to get rid of the Fragment and do everything in the
Activity, especially since this nullguard will probably leave things in a
not good state. But that's better than a crash, I think.
W java.lang.NullPointerException
W at org.fdroid.fdroid.views.fragments.AvailableAppsFragment$CategoryObserver.onChange(AvailableAppsFragment.java:88)
W at org.fdroid.fdroid.views.fragments.AvailableAppsFragment$CategoryObserver.onChange(AvailableAppsFragment.java:103)
W at android.database.ContentObserver.dispatchChange(ContentObserver.java:163)
W at android.database.ContentObserver$Transport.onChange(ContentObserver.java:195)
W at android.database.IContentObserver$Stub.onTransact(IContentObserver.java:60)
W at android.os.Binder.execTransact(Binder.java:404)
W at dalvik.system.NativeStart.run(Native Method)
The repo.fingerprint logic is based on null meaning that the fingerprint
has not been set. This ensures that a "" does not sneak in somehow as a
valid fingerprint.
For Strings that are meant to be displayed to humans, using the default
Locale makes sense. But this String is meant to be parsed by code, so it
should force the Locale to make sure the digits are always rendered in the
same format.
As per !140, some languages require different translations for an app being
installed and the tab name for installed apps. Namely, one is plural while the
other isn't. Separate the two.
The Bonjour stuff takes a while to start, and isn't strictly neccesary
in order to swap over WiFi. Rather, it is more of a convenience. Also,
it was causing the UI to appear to lag quite a lot. This way, the WiFi
swap gets setup almost instantly, and is available to swap - therefore
the UI seems much more responsive.
While we're at it, use `Thread`s rather than `AsyncTask`s because
they are more concise. Not 100% sure, but I think `AsyncTask`s
need to wait for the UI event loop to get to them in order kick off.
Trying to pin down why the UI takes one or two seconds to catch up
after performing the "Enable WiFi" toggle. This is best done via
logging rather than using the debugger.
Also changed to Utils.DebugLog instead of Log.d, and removed some
comments and fixed a typo in one comment.
qrUriString was supposed to be used. Moreover, it does look like execute()
must be called with an upper case string. Caught since qrUriString is an
unused variable.
You must, must, must close the BT sockets else you run out of them.
This code tries to handle all the places where BT sockets may not get closed.
It also tries to tweak user experience/UI integration pieces in a few areas,
and handle some NPEs that can occur when BT fails.
- don't try to start BT in the background. you can only start/stop a BT server once, else new connections don't work
- be more mindful of reading/writing bytes from the input/output streams... make sure bytes are available, because you will block forever if you do not do that
- use the device class tag to filter devices in discovery instead of the fdroid name tag
- this now successfully connects but there is an error in the certificate fingerprint verification still
Proxying are basically always for internet access, and swap repos are by
definition only on the local network. This adds a pretty strict check for
whether a given download URL is for a swap repo, and if so, the proxy
settings are ignored.
fixes https://dev.guardianproject.info/issues/3421
This required rebuilding the zipsigner.jar, since there was once issue to
be fixed in kellingwood.security.zipsigner.ZipSigner.
Here are the stacktraces:
StrictMode E A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks.
E java.lang.Throwable: Explicit termination method 'close' not called
E at dalvik.system.CloseGuard.open(CloseGuard.java:184)
E at java.io.FileOutputStream.<init>(FileOutputStream.java:90)
E at java.io.FileOutputStream.<init>(FileOutputStream.java:73)
E at java.io.FileWriter.<init>(FileWriter.java:42)
E at org.fdroid.fdroid.localrepo.LocalRepoManager.writeIndexJar(LocalRepoManager.java:488)
E at org.fdroid.fdroid.views.swap.SwapWorkflowActivity$PrepareSwapRepo.doInBackground(SwapWorkflowActivity.java:698)
E at org.fdroid.fdroid.views.swap.SwapWorkflowActivity$PrepareSwapRepo.doInBackground(SwapWorkflowActivity.java:645)
E at android.os.AsyncTask$2.call(AsyncTask.java:288)
E at java.util.concurrent.FutureTask.run(FutureTask.java:237)
E at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
E at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
E at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
E at java.lang.Thread.run(Thread.java:841)
E A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks.
E java.lang.Throwable: Explicit termination method 'close' not called
E at dalvik.system.CloseGuard.open(CloseGuard.java:184)
E at java.io.RandomAccessFile.<init>(RandomAccessFile.java:128)
E at kellinwood.zipio.ZipInput.<init>(ZipInput.java:57)
E at kellinwood.zipio.ZipInput.read(ZipInput.java:75)
E at kellinwood.security.zipsigner.ZipSigner.signZip(ZipSigner.java:646)
E at org.fdroid.fdroid.localrepo.LocalRepoKeyStore.signZip(LocalRepoKeyStore.java:218)
E at org.fdroid.fdroid.localrepo.LocalRepoManager.writeIndexJar(LocalRepoManager.java:515)
E at org.fdroid.fdroid.views.swap.SwapWorkflowActivity$PrepareSwapRepo.doInBackground(SwapWorkflowActivity.java:698)
E at org.fdroid.fdroid.views.swap.SwapWorkflowActivity$PrepareSwapRepo.doInBackground(SwapWorkflowActivity.java:645)
E at android.os.AsyncTask$2.call(AsyncTask.java:288)
E at java.util.concurrent.FutureTask.run(FutureTask.java:237)
E at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
E at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
E at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
E at java.lang.Thread.run(Thread.java:841)
E A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks.
E java.lang.Throwable: Explicit termination method 'end' not called
E at dalvik.system.CloseGuard.open(CloseGuard.java:184)
E at java.util.zip.Inflater.<init>(Inflater.java:82)
E at kellinwood.zipio.ZioEntry.getInputStream(ZioEntry.java:475)
E at kellinwood.zipio.ZioEntry.getInputStream(ZioEntry.java:445)
E at kellinwood.security.zipsigner.ZipSigner.addDigestsToManifest(ZipSigner.java:418)
E at kellinwood.security.zipsigner.ZipSigner.signZip(ZipSigner.java:713)
E at kellinwood.security.zipsigner.ZipSigner.signZip(ZipSigner.java:647)
E at org.fdroid.fdroid.localrepo.LocalRepoKeyStore.signZip(LocalRepoKeyStore.java:218)
E at org.fdroid.fdroid.localrepo.LocalRepoManager.writeIndexJar(LocalRepoManager.java:515)
E at org.fdroid.fdroid.views.swap.SwapWorkflowActivity$PrepareSwapRepo.doInBackground(SwapWorkflowActivity.java:698)
E at org.fdroid.fdroid.views.swap.SwapWorkflowActivity$PrepareSwapRepo.doInBackground(SwapWorkflowActivity.java:645)
E at android.os.AsyncTask$2.call(AsyncTask.java:288)
E at java.util.concurrent.FutureTask.run(FutureTask.java:237)
E at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
E at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
E at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
E at java.lang.Thread.run(Thread.java:841)
StrictMode E A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks.
E java.lang.Throwable: Explicit termination method 'close' not called
E at dalvik.system.CloseGuard.open(CloseGuard.java:184)
E at java.io.FileOutputStream.<init>(FileOutputStream.java:90)
E at java.io.FileOutputStream.<init>(FileOutputStream.java:73)
E at java.io.FileWriter.<init>(FileWriter.java:42)
E at org.fdroid.fdroid.localrepo.LocalRepoManager.writeIndexJar(LocalRepoManager.java:488)
E at org.fdroid.fdroid.views.swap.SwapWorkflowActivity$PrepareSwapRepo.doInBackground(SwapWorkflowActivity.java:698)
E at org.fdroid.fdroid.views.swap.SwapWorkflowActivity$PrepareSwapRepo.doInBackground(SwapWorkflowActivity.java:645)
E at android.os.AsyncTask$2.call(AsyncTask.java:288)
E at java.util.concurrent.FutureTask.run(FutureTask.java:237)
E at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
E at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
E at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
E at java.lang.Thread.run(Thread.java:841)
E A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks.
E java.lang.Throwable: Explicit termination method 'close' not called
E at dalvik.system.CloseGuard.open(CloseGuard.java:184)
E at java.io.RandomAccessFile.<init>(RandomAccessFile.java:128)
E at kellinwood.zipio.ZipInput.<init>(ZipInput.java:57)
E at kellinwood.zipio.ZipInput.read(ZipInput.java:75)
E at kellinwood.security.zipsigner.ZipSigner.signZip(ZipSigner.java:646)
E at org.fdroid.fdroid.localrepo.LocalRepoKeyStore.signZip(LocalRepoKeyStore.java:218)
E at org.fdroid.fdroid.localrepo.LocalRepoManager.writeIndexJar(LocalRepoManager.java:515)
E at org.fdroid.fdroid.views.swap.SwapWorkflowActivity$PrepareSwapRepo.doInBackground(SwapWorkflowActivity.java:698)
E at org.fdroid.fdroid.views.swap.SwapWorkflowActivity$PrepareSwapRepo.doInBackground(SwapWorkflowActivity.java:645)
E at android.os.AsyncTask$2.call(AsyncTask.java:288)
E at java.util.concurrent.FutureTask.run(FutureTask.java:237)
E at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
E at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
E at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
E at java.lang.Thread.run(Thread.java:841)
E A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks.
E java.lang.Throwable: Explicit termination method 'end' not called
E at dalvik.system.CloseGuard.open(CloseGuard.java:184)
E at java.util.zip.Inflater.<init>(Inflater.java:82)
E at kellinwood.zipio.ZioEntry.getInputStream(ZioEntry.java:475)
E at kellinwood.zipio.ZioEntry.getInputStream(ZioEntry.java:445)
E at kellinwood.security.zipsigner.ZipSigner.addDigestsToManifest(ZipSigner.java:418)
E at kellinwood.security.zipsigner.ZipSigner.signZip(ZipSigner.java:713)
E at kellinwood.security.zipsigner.ZipSigner.signZip(ZipSigner.java:647)
E at org.fdroid.fdroid.localrepo.LocalRepoKeyStore.signZip(LocalRepoKeyStore.java:218)
E at org.fdroid.fdroid.localrepo.LocalRepoManager.writeIndexJar(LocalRepoManager.java:515)
E at org.fdroid.fdroid.views.swap.SwapWorkflowActivity$PrepareSwapRepo.doInBackground(SwapWorkflowActivity.java:698)
E at org.fdroid.fdroid.views.swap.SwapWorkflowActivity$PrepareSwapRepo.doInBackground(SwapWorkflowActivity.java:645)
E at android.os.AsyncTask$2.call(AsyncTask.java:288)
E at java.util.concurrent.FutureTask.run(FutureTask.java:237)
E at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
E at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
E at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
E at java.lang.Thread.run(Thread.java:841)