716 Commits

Author SHA1 Message Date
Daniel Martí
a1fb4636d2 Simplify view_all_description logic
* Use a positive if condition
* Invert bool in one place
2015-09-18 18:35:27 -07:00
Hans-Christoph Steiner
c8b64281c2 sync up logcat tags with the class names 2015-09-16 13:00:32 +02:00
Hans-Christoph Steiner
d37b473e10 temporary workaround to NPE crash on first install
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)
2015-09-16 13:00:32 +02:00
Hans-Christoph Steiner
69b210a4b8 fix swap to follow repo.fingerprint logic: null means unset
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.
2015-09-16 13:00:32 +02:00
Hans-Christoph Steiner
03d074a0e8 always use Locale.ENGLISH for formatting Strings for the machine
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.
2015-09-16 12:48:33 +02:00
Hans-Christoph Steiner
003f5331fa revert to previous, proven index.xml writing
It was added in c831cf77ccf9ecfa792d0ffdc84f272053fa945a and changed in
42d31eb0e6e5d5c9e7fe9c35435a56258ad90578
2015-09-16 12:48:33 +02:00
Daniel Martí
cdfe1566fa Give more context on some strings, split installed
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.
2015-09-14 15:00:14 -07:00
Nico Alt
ab2c1d49b6 Prompt for unstable updates globally 2015-09-14 18:58:52 +02:00
Daniel Martí
42ab9a757c Utils: remove unused code 2015-09-13 11:33:07 -07:00
Daniel Martí
dd8a3440d6 Rework about dialog
* Don't have website link twice
* Add source code link
* Don't have trailing spaces in strings
2015-09-12 23:26:14 -07:00
Daniel Martí
6c81216bc2 Add Utils.getVersionName(Context) 2015-09-12 22:38:52 -07:00
Daniel Martí
f8bb714d25 Fix string resource name typo 2015-09-12 21:35:07 -07:00
Daniel Martí
852d88de84 Toast strings are full sentences. #415 2015-09-12 18:38:20 -07:00
Peter Serwylo
198cc7357c Update UI in response to WiFi enabling, not Bonjour discovery enabling.
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.
2015-09-13 08:26:33 +10:00
Peter Serwylo
90ede44790 Check for null netmask variable to prevent NPE.
Not sure if this is the correct course of action to prevent the problem,
but it prevents the crash documented in Issue #413.
2015-09-13 08:26:33 +10:00
Peter Serwylo
828cc272ee Only start Bluetooth in UI thread, WiFi needs background.
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.
2015-09-13 08:26:33 +10:00
Peter Serwylo
4bb2a0e0d0 Added massive amounts of logging to pin down problem.
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.
2015-09-13 08:26:28 +10:00
Daniel Martí
de44771755 Exception logging improvements
* On error logs, always print the stack trace
* Log full stack traces instead of just exception names or messages
* Never use printStackTrace
2015-09-11 17:43:59 -07:00
Daniel Martí
c0a13ad65f Some Java 1.7 string switch goodness 2015-09-11 17:30:58 -07:00
Daniel Martí
a2c8c4678e Remove duplicate debug log
D/AvailableAppsFragment(18359): Selected category: Reading
D/AvailableAppsFragment(18359): Category 'Reading' selected.
D/AvailableAppsFragment(18359): Selected category: What's New
D/AvailableAppsFragment(18359): Category 'What's New' selected.
2015-09-11 17:17:37 -07:00
Daniel Martí
be87a31b84 Apply some PMD fixes 2015-09-11 17:00:24 -07:00
Daniel Martí
90822e9258 Utils: don't capitalize method names 2015-09-11 16:43:03 -07:00
Daniel Martí
132eeda4a0 Fix small variable mistake in RepoDetailsActivity
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.
2015-09-11 15:48:55 -07:00
Daniel Martí
b4e23c2cbc Make most fields in AsyncDownloader final 2015-09-11 15:48:21 -07:00
Daniel Martí
0c9c93e493 Fix some javadoc warnings 2015-09-11 15:47:38 -07:00
Daniel Martí
9cbefca4bb Code cleanup via AS 2015-09-11 15:34:05 -07:00
Daniel Martí
0f8c310c8d Optimize imports via AS 2015-09-11 15:32:22 -07:00
Daniel Martí
110a004d59 AppDetalis: Avoid division by zero crash 2015-09-11 15:26:56 -07:00
Toby Kurien
6d6d9bc7cd Follow download progress in AppDetails
Added a new thread to update the AppDetails screen with the progress of the
download once per second.
2015-09-11 15:14:22 -07:00
Daniel Martí
860bc8ae97 Apply some checkstyle fixes 2015-09-11 14:45:19 -07:00
Daniel Martí
1dfe3d962f Hasher cleanup and simplification 2015-09-11 13:07:53 -07:00
Daniel Martí
27f212f3ec Use Writer, always close FileWriter exactly once 2015-09-11 13:07:53 -07:00
Daniel Martí
d415ceae15 Block formatting fixes 2015-09-10 19:04:18 -07:00
Daniel Martí
cba2e67a70 Cleanup after bluetooth-swap merge 2015-09-10 19:00:09 -07:00
Daniel Martí
42d31eb0e6 Fix build after bluetooth-swap merge 2015-09-10 18:56:47 -07:00
Daniel Martí
2159b3d49b Merge branch 'bluetooth-swap' of https://gitlab.com/n8fr8/fdroidclient 2015-09-10 18:52:52 -07:00
Daniel Martí
cc8b9bb41d Fix formatting error in WifiStateChangeService
It's %d, not %i.
2015-09-10 18:29:48 -07:00
n8fr8
6dec9fb928 remove unnecessary whitespace 2015-09-10 21:26:28 -04:00
n8fr8
884c8219fd put exception back into Log per this comment: https://gitlab.com/fdroid/fdroidclient/merge_requests/137 2015-09-10 21:26:28 -04:00
n8fr8
988f5dbfdc use TextUtils.isEmpty() - a better solution! 2015-09-10 21:26:28 -04:00
n8fr8
b6939dcce4 for #404 a few more tweaks to make sure things are getting closed! 2015-09-10 21:26:28 -04:00
n8fr8
b3f8ac0a5b related to #404 improvement to patterns to support close and discoverable
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.
2015-09-10 21:26:28 -04:00
n8fr8
0a96d17dd1 now handling empty repo fingerprint during check
- also support icondownloading over bluetooth
- also check for null repoUrl variable
2015-09-10 21:26:28 -04:00
n8fr8
c831cf77cc Many changes to swap workflow to get Bluetooth to work
- 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
2015-09-10 21:26:28 -04:00
Hans-Christoph Steiner
a69488b32f HttpDownloader bypasses proxy when accessing a swap repo
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
2015-09-10 18:42:36 +02:00
Hans-Christoph Steiner
1654443b00 StrictMode only works in android-9 and above 2015-09-10 18:42:36 +02:00
Hans-Christoph Steiner
8d20135779 swap: close resources reported by StrictMode
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)
2015-09-10 18:42:35 +02:00
Daniel Martí
5bb5e3a96b Fix conflict between swap and privileged merges
Also avoid possible NPE in the package name comparison.
2015-09-09 21:35:38 -07:00
Daniel Martí
ed5de47197 Merge branch 'enhanced-priv-install' of https://gitlab.com/dschuermann/fdroidclient 2015-09-09 21:21:06 -07:00
Peter Serwylo
9848816df4 Fix bug introduced when resolving conflicts during rebase.
ApkDownloader now requires an `App` to be passed in.
2015-09-10 08:49:46 +10:00