3156 Commits

Author SHA1 Message Date
Paresh Chouhan
c34ceeffe4 UI : Repository : *Repo Name* is disabled if apk is incompatible. 2016-03-13 20:10:32 +05:30
Peter Serwylo
da8c0e0e16 Merge branch 'gradle-updates' into 'master'
Misc gradle, lint and markdown updates



See merge request !223
2016-03-07 14:00:27 +00:00
Daniel Martí
ea6b0340d9 Merge branch 'fix-554--content-resolver-reference' into 'master'
Ensure `getContentResolver()` is not requested from `null` object.

Should fix #554, however I couldn't reproduce this. At the very least, I fail to see how it is possible with this new change for a `null` to get passed to `AppProvider.Helper.categories`, whereas it could've before.

In the process, I also made the database query run on the background thread, then update the UI on the UI thread.

See merge request !224
2016-03-07 13:52:55 +00:00
Peter Serwylo
0f64f2c181 Clarify threading when loading categories
Previously, it was not explicit that the `onCreate` happened to be invoked
in the UI thread. Now it is, due to passing `new Handler(Looper.getMainLooper())`.
Also, the categories are now loaded in a background task, and then the UI is
updated on the UI thread.
2016-03-07 23:46:06 +11:00
Peter Serwylo
7421d33c3a Expand null check to include isAdded() check
Also, don't call `getActivity()` in the separate thread. Instead, use the
`Activity` which we have already checked and ensured is not null.
2016-03-07 23:45:58 +11:00
Daniel Martí
b8ce62e3ef README: Fix badge link
The old /ci site is gone. Link to the builds page, which at least shows
something related to CI.
2016-03-05 23:39:30 +00:00
Daniel Martí
26d60aa9ae Fix gradlew references in markdown files
Use gradlew consistently. Also, fix its calling after the cd.
2016-03-05 23:33:52 +00:00
Daniel Martí
80a3faa4d5 Explicitly set fullBackupContent to true
An F-Droid backup should contain all the app's data.
2016-03-05 23:27:18 +00:00
Daniel Martí
b534bba440 Bump targetSdkVersion to 23
compileSdkVersion in the build.gradle file was already bumped, but we
forgot about this one.
2016-03-05 23:27:00 +00:00
Daniel Martí
25a9360a58 Fix ScrollViewSize lint warnings 2016-03-05 23:21:15 +00:00
Daniel Martí
28988b9fdd Bump libsuperuser to the latest version 2016-03-05 23:15:47 +00:00
Daniel Martí
ccf858f960 CHANGELOG: Start writing upcoming release 2016-03-05 23:01:10 +00:00
Daniel Martí
3c33e55fd3 Merge branch 'add-repo-url' into 'master'
Enhancement : Repo URL added to apk's on AppDetailsActivity.

Fixes issue #527.
Adds repo URL to apk's present on AppDetails.

Samples  
![sample](/uploads/0d603cf7242f6f45348c78009f811623/sample.png)![sampl2](/uploads/31efab104bd52cecc9f2ea1e923116c6/sampl2.png)

See merge request !222
2016-03-05 21:50:48 +00:00
Paresh Chouhan
683ba8d20f Enhancement|UI : Repository URL added to APK's on AppDetails Activity.
Fixes issue #527.
Repository URL's now shown as Provided By domain.name/repo
2016-03-06 01:23:13 +05:30
Peter Serwylo
018a8231d6 Merge branch 'pmd' into 'master'
Add PMD



See merge request !221
2016-03-04 22:14:22 +00:00
F-Droid Translatebot
37ef67e1b8 Pull translation updates from Weblate
Translators:

ageru              French
Danial Behzadi     Persian
enolp              Asturian
ezjerry liao       Chinese (Taiwan)
Fr Translation     French
Hsiu-Ming Chang    Chinese (Taiwan)
Jonatan            Swedish
relan              Russian
riotism            Chinese (Hong Kong)
2016-03-04 17:04:38 +00:00
Daniel Martí
d3ca6020dc CI: Run pmd too 2016-03-01 17:46:49 +00:00
Daniel Martí
85ba537d95 PMD: Add a few rulesets that we already obey 2016-03-01 17:46:38 +00:00
Daniel Martí
fbeb6d140f PMD: Enable java-android, fix issues 2016-03-01 17:46:38 +00:00
Daniel Martí
78d15dd4a8 Add PMD, for now with no rules
Unlike findbugs, PMD is very easy to configure. Should be very useful as
long as we set a correct ruleSet.
2016-03-01 17:46:38 +00:00
Daniel Martí
580723fa64 CI: No need to install dependencies any more
They all come in mvdan/fdroid-ci. Same as in the other two repos.
2016-03-01 11:21:19 +00:00
Daniel Martí
e698e1557c Merge branch 'target-23' into 'master'
Bump target SDK and support libs to 23

Android 6.0 brought some changes that affect F-Droid client:

1. [Apache HTTP client removal](https://developer.android.com/about/versions/marshmallow/android-6.0-changes.html#behavior-apache-http-client)
2. [PackageInfo.REQUESTED_PERMISSION_REQUIRED removal](https://developer.android.com/sdk/api_diff/23/changes/android.content.pm.PackageInfo.html)

Closes #518.

See merge request !214
2016-03-01 11:20:28 +00:00
relan
e2b81c6b77 Permit deprecated Apache HTTP Client
This is a temporary solution. All code that uses Apache HTTP Client
should be rewritten.
2016-03-01 12:34:20 +03:00
relan
21a78054d5 Bump target SDK to 23
Also update Support Library components to 23.2.0.
2016-03-01 12:34:20 +03:00
relan
77074f83e2 Remove PackageInfo.REQUESTED_PERMISSION_REQUIRED
This flag existed in Android 4.2-5.1 and has always been set. Stop
checking it.
2016-03-01 12:33:21 +03:00
Daniel Martí
90e64badf3 Merge branch 'ci-image' into 'master'
CI: Use our docker image, print out test coverage



See merge request !220
2016-02-29 21:45:27 +00:00
Daniel Martí
26ce365c22 Enable test coverage for Gitlab CI 2016-02-29 20:11:29 +00:00
Daniel Martí
d6de4eb58b CI: Use our docker image 2016-02-29 14:35:16 +00:00
Daniel Martí
4aa44cb150 Bump to 0.99 v0.99 2016-02-28 22:46:53 +00:00
F-Droid Translatebot
91482e05f0 Pull translation updates from Weblate
Translators:

Adrià García-Alzórriz    Catalan
Adrià García-Alzórriz    Spanish
Ajeje Brazorf            Sardinian
Alberto Moshpirit        Spanish
Alex Kalles              Greek
jetamkadlec              Czech
Ldm Public               French
Licaon Kter              Romanian
Mladen Pejaković         Serbian
naofum                   Japanese
Olexandr Nesterenko      Ukrainian
Verdulo                  Esperanto
Verdulo                  Polish
2016-02-28 22:41:02 +00:00
Hans-Christoph Steiner
b22c20ece3 Merge branch 'lint-checkstyle' into 'master'
Lint fixes and checkstyle update



See merge request !219
2016-02-28 22:25:15 +00:00
Daniel Martí
a203545e48 Bump checkstyle to 6.16
Due to fixes and improvements, some new checkstyle changes are due.
2016-02-28 16:44:44 +00:00
Daniel Martí
d061dafcd7 Remove a few extra spaces that checkstyle missed
There's also a change in a SQL string, but it should be safe.
2016-02-28 14:29:51 +00:00
Daniel Martí
3af5f55abd Remove unused repo field
Found by Android Studio.
2016-02-28 14:22:27 +00:00
Daniel Martí
9c86655af0 Make some declaration accesses weaker
As suggested by Android Studio.
2016-02-28 14:19:02 +00:00
Daniel Martí
982bf42a4b Remove unused resources from old search screen
We didn't remove the search results class until after reworking the
feature, which is probably why this was kept around.
2016-02-28 14:04:15 +00:00
Hans-Christoph Steiner
d43c6b326f Merge branch 'cleanup-swap-code' into 'master'
Cleanup swap code when returning to start swap view.

This change cleans up some code around how the `StartSwapView` attaches and detaches listeners/broadcast receivers/etc. There are two things that occured which were undesirable, one causing observable bugs, the other having the potential to.

The first is that when the swap process is stopped (e.g. by hitting the cross in the top left of the action bar) then it would trigger an event to be broadcast. This would hit the `StartSwapView`, and then that view would change the UI widgets to match the state of the swap process (i.e. "Stopping" == Disabled and unchecked switch, "Stopped" == Enabled and unchecked switch). When the UI was updated, it was inadvertantly sending further requests to stop swap, because `Switch` widgets _always_ notify their listeners, even if they are explicitly set via `setChecked()`. Now it temporarily removes listeners while brining the UI in line with what the swap service is doing, then reattaches them afterwards.

The later is due to `BroadcastReceivers` being added each time the `StartSwapView` is shown, and never unregistered. Now they are unregistered when the view is detached. Note that because we are not using the convoluted but well documented `Fragment` API, I'm not 100% certain this is the right time to detach listeners, but it seems suitable.

FYI, here is a logcat of me starting hitting the "Cancel swap" X button on master:

```
            SwapManager  I  Asked to stop swapping, will stop bluetooth, wifi, and move service to BG for GC.
                         D  Moving SwapService to background so that it can be GC'ed if required.
               SwapType  D  Sending broadcast STOPPING from WifiSwap
               WifiSwap  D  Sending message to swap webserver to stop it.
       BonjourBroadcast  D  Unregistering MDNS service...
               WifiSwap  I  we've been asked to stop the webserver: Thread-622 says stop
            SwapManager  D  Remembering that Bluetooth swap is NOT connected and WiFi swap IS connected.
          StartSwapView  D  WiFi service is stopping (setting toggle to unchecked and disabled).
                         D  Received onCheckChanged(false) for WiFi swap, disabling WiFi swap in background thread.
  AvailableAppsFragment  D  Category 'What's New' selected.
         OpenGLRenderer  D  endAllStagingAnimators on 0xb8c007e8 (RippleDrawable) with handle 0xb8cef7e8
        BluetoothFinder  D  Stopping bluetooth discovery.
       BluetoothAdapter  D  235158966: getState() :  mService = null. Returning STATE_OFF
          BonjourFinder  D  Cancelling BonjourFinder, releasing multicast lock, removing jmdns service listeners
                    art  I  WaitForGcToComplete blocked for 7.385ms for cause DisableMovingGc
Manager.CallbackHandler  D  CM callback handler got msg 524290
                         D  CM callback handler got msg 524290
               SwapType  D  Sending broadcast STOPPED from BonjourBroadcast
                         D  Sending broadcast STOPPED from WifiSwap
                         D  Sending broadcast STOPPING from WifiSwap
            SwapManager  D  Moving SwapService to background so that it can be GC'ed if required.
               WifiSwap  D  Sending message to swap webserver to stop it.
           MessageQueue  W  Handler (org.fdroid.fdroid.localrepo.type.WifiSwap$5$1$1) {29eeaaee} sending message to a Handler on a dead thread
                         W  java.lang.IllegalStateException: Handler (org.fdroid.fdroid.localrepo.type.WifiSwap$5$1$1) {29eeaaee} sending message to a Handler on a dead
                             thread
                         W      at android.os.MessageQueue.enqueueMessage(MessageQueue.java:325)
                         W      at android.os.Handler.enqueueMessage(Handler.java:631)
                         W      at android.os.Handler.sendMessageAtTime(Handler.java:600)
                         W      at android.os.Handler.sendMessageDelayed(Handler.java:570)
                         W      at android.os.Handler.sendMessage(Handler.java:507)
                         W      at org.fdroid.fdroid.localrepo.type.WifiSwap.stop(WifiSwap.java:167)
                         W      at org.fdroid.fdroid.localrepo.type.SwapType$3.doInBackground(SwapType.java:103)
                         W      at org.fdroid.fdroid.localrepo.type.SwapType$3.doInBackground(SwapType.java:100)
                         W      at android.os.AsyncTask$2.call(AsyncTask.java:288)
                         W      at java.util.concurrent.FutureTask.run(FutureTask.java:237)
                         W      at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
                         W      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
                         W      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
                         W      at java.lang.Thread.run(Thread.java:818)
       BonjourBroadcast  D  Unregistering MDNS service...
               SwapType  D  Sending broadcast STOPPED from BonjourBroadcast
                         D  Sending broadcast STOPPED from WifiSwap
            SwapManager  D  Remembering that Bluetooth swap is NOT connected and WiFi swap is NOT connected.
          StartSwapView  D  WiFi service has stopped (setting toggle to not-visible).
            SwapManager  D  Remembering that Bluetooth swap is NOT connected and WiFi swap is NOT connected.
          StartSwapView  D  WiFi service is stopping (setting toggle to unchecked and disabled).
            SwapManager  D  Moving SwapService to background so that it can be GC'ed if required.
                         D  Remembering that Bluetooth swap is NOT connected and WiFi swap is NOT connected.
          StartSwapView  D  WiFi service has stopped (setting toggle to not-visible).
```

And also on this branch:

```
            SwapService  I  Asked to stop swapping, will stop bluetooth, wifi, and move service to BG for GC.
                         D  Moving SwapService to background so that it can be GC'ed if required.
               SwapType  D  Sending broadcast STOPPING from WifiSwap
               WifiSwap  D  Sending message to swap webserver to stop it.
       BonjourBroadcast  D  Unregistering MDNS service...
               WifiSwap  I  we've been asked to stop the webserver: Thread-646 says stop
            SwapService  D  Remembering that Bluetooth swap is NOT connected and WiFi swap IS connected.
          StartSwapView  D  WiFi service is stopping (setting toggle to unchecked and disabled).
  AvailableAppsFragment  D  Category 'What's New' selected.
         OpenGLRenderer  D  endAllStagingAnimators on 0xb8b1bb70 (RippleDrawable) with handle 0xb8cec7c0
          BonjourFinder  D  Cancelling BonjourFinder, releasing multicast lock, removing jmdns service listeners
        BluetoothFinder  D  Stopping bluetooth discovery.
       BluetoothAdapter  D  93224770: getState() :  mService = null. Returning STATE_OFF
Manager.CallbackHandler  D  CM callback handler got msg 524290
                         D  CM callback handler got msg 524290
               SwapType  D  Sending broadcast STOPPED from BonjourBroadcast
                         D  Sending broadcast STOPPED from WifiSwap
            SwapService  D  Moving SwapService to background so that it can be GC'ed if required.
                         D  Remembering that Bluetooth swap is NOT connected and WiFi swap is NOT connected.
          StartSwapView  D  WiFi service has stopped (setting toggle to not-visible).
Manager.CallbackHandler  D  CM callback handler got msg 524290
```

One of the most notable things that can be seen is the lack of the following message in the second (fixed) logcat.

> Received onCheckChanged(false) for WiFi swap, disabling WiFi swap in background thread.

See merge request !218
2016-02-28 10:14:29 +00:00
Peter Serwylo
ad63e52e50 Extract BroadcastReceivers to member variables, so they can be unregistered correctly.
Previously, they were registered, then forgotten. This means that each time
the start swap view was run, another receiver was registered. As a result,
they were being invoked multiple times.

It doesn't appear that this had any specific side effects which were terrible,
but they definitely have the potential to going forward.

Note that because we are not using `Fragments` with their convoluted, but at
least well documented API, I'm not 100% certain that I've unregistered the
receivers at the right location.
2016-02-28 13:58:49 +11:00
Peter Serwylo
1323e800b7 Temporarily disable listeners when updating switch state in response to background process.
Previously, something like this would happen:
 * Swap service is cancelled
 * WiFi swap is asked to stop
 * Event is broadcast when done
 * UI listens to this event
 * Upon receiving the event, it updates the UI
 * Updating the UI triggers an event, causing the process to happen again

An alternative solution to this would have been for the UI to stop listening
to listeners before WiFi swap is shut down, but that is then only specific
to the case when the swap view is being destroyed/removed. This could also
happen in other situations however, such as when the swap service times out.
2016-02-28 13:43:07 +11:00
Peter Serwylo
209afd6bf2 Extract switch change listeners to member variables, so that they can be unregistered.
When the view is detached, then the listeners will be unregistered.
This will also help in the future so that they can be temporarily
unregistered when manually changing the state of the switches.
2016-02-28 12:49:50 +11:00
Peter Serwylo
62b080a8d9 Rename logging tag to make logcat debugging clearer. 2016-02-28 12:36:06 +11:00
Hans-Christoph Steiner
94c0c391da Merge branch 'faster-ci' into 'master'
CI: Install SDK only if necessary



See merge request !217
2016-02-27 19:45:25 +00:00
Daniel Martí
affa569a79 CI: Install SDK only if necessary 2016-02-27 18:33:34 +00:00
Daniel Martí
1eedf66d66 Bump to 0.99-alpha2 v0.99-alpha2 2016-02-27 13:02:24 +00:00
Daniel Martí
d7827a3f07 CHANGELOG: prepare for upcoming release 2016-02-27 13:01:56 +00:00
Daniel Martí
4ec9cee143 Merge branch 'smooth-tor' into 'master'
Smooth Tor setup

This is a big reworking of the Tor support to make it really easy to setup, and to make .onion addresses work automatically even when "Use Tor" is off.

I needed to make the NetCipher v1.2.1 release to support this, hence it was originally WIP:.

See merge request !216
2016-02-27 12:42:20 +00:00
Hans-Christoph Steiner
fd03ebd764 annotate swap methods that require android-10
swap only works on >= android-10 anyway

closes #581 https://gitlab.com/fdroid/fdroidclient/issues/581
2016-02-27 11:05:16 +01:00
Hans-Christoph Steiner
26b35723d3 use AsyncTask for SwapType operations to run in background
Thread runs at normal priority by default.  AsyncTasks are integrated into
Android for handling things running in the background while keeping the UI
responsive.

This reverts most of commit 828cc272ee5235f868104b009349cc7e835e144f.
2016-02-27 11:05:16 +01:00
Hans-Christoph Steiner
96fe1f9584 do not show "Swap" as an option on less than android-10
Swap requires lots of APIs that are only all available in android-10, so
hide the menu item on older platforms.

closes #581 https://gitlab.com/fdroid/fdroidclient/issues/581
closes #575 https://gitlab.com/fdroid/fdroidclient/issues/575
2016-02-27 11:04:08 +01:00
Hans-Christoph Steiner
38e4b38602 Re-enable NetCipher to provide decent TLS on all Android versions
Revert "Revert netcipher to fix SNI regression"
This reverts commit 6c8e726aadbe6714d6295882c5be87a7bf81a9f0.

NetCipher is important for making sure that the client running on older
versions of Android is not using extremely crappy default TLS settings.  It
also streamlines the Tor support.

closes #431 https://gitlab.com/fdroid/fdroidclient/issues/431
closes #576 https://gitlab.com/fdroid/fdroidclient/issues/576
2016-02-27 11:04:08 +01:00