305 Commits

Author SHA1 Message Date
Daniel Martí
c43505befb Fix tests by making a method explicitly protected
This was making proguard complain and refuse to continue. This fix should not
alter how F-Droid works, it's just to make the tests function with proguard
enabled.
2015-09-02 16:10:06 -07:00
Hans-Christoph Steiner
303de3d972 temporarily disable broken HTTPS support in swap
Right now, turning on HTTPS really just prevents things from working.  It
is not fully required, since swapping is only local connections, so not
easily susceptible to mass eavesdropping, though it would be nice.  I'm
leaving the rest of the plumbing for this here intact for when we come back
to getting swap always using HTTPS.

closes #378 https://gitlab.com/fdroid/fdroidclient/issues/378
2015-08-27 11:05:36 +02:00
Hans-Christoph Steiner
04e318c9ca force swap X.509 cert generation to use English/Gregorian times
When using locales that use different calendars, like Farsi, Arabic,
Hebrew, etc. there was a crash in spongycastle's X.509 generation because
it was trying to parse a Farsi date string as English.

fixes #334 https://gitlab.com/fdroid/fdroidclient/issues/334

Here's the original stacktrace:
    java.lang.IllegalArgumentException: invalid date string: Unparseable date: "ñõðøòñðóñõõóGMT+00:00" (at offset 0)
            at org.spongycastle.asn1.ASN1UTCTime.<init>(ASN1UTCTime.java:115)
            at org.spongycastle.asn1.DERUTCTime.<init>(DERUTCTime.java:23)
            at org.spongycastle.asn1.x509.Time.<init>(Time.java:67)
            at org.spongycastle.cert.X509v3CertificateBuilder.<init>(X509v3CertificateBuilder.java:40)
            at org.fdroid.fdroid.localrepo.LocalRepoKeyStore.generateSelfSignedCertChain(LocalRepoKeyStore.java:301)
            at org.fdroid.fdroid.localrepo.LocalRepoKeyStore.generateSelfSignedCertChain(LocalRepoKeyStore.java:281)
            at org.fdroid.fdroid.localrepo.LocalRepoKeyStore.<init>(LocalRepoKeyStore.java:136)
            at org.fdroid.fdroid.localrepo.LocalRepoKeyStore.get(LocalRepoKeyStore.java:73)
            at org.fdroid.fdroid.net.WifiStateChangeService$WaitForWifiAsyncTask.doInBackground(WifiStateChangeService.java:124)
            at org.fdroid.fdroid.net.WifiStateChangeService$WaitForWifiAsyncTask.doInBackground(WifiStateChangeService.java:62)
2015-08-27 11:05:35 +02:00
Hans-Christoph Steiner
9e939131b7 Utils.calcFingerprint() should always return null if given null
#334 https://gitlab.com/fdroid/fdroidclient/issues/334
2015-08-27 11:05:35 +02:00
Daniel Martí
bfcd88ebb2 Use activity context in AppDetails, fixes #388 2015-08-25 21:21:35 -07:00
Daniel Martí
ef56f8db88 Revert "Add timeout for Http request" merge
See !117 and #387

This reverts commit e895d1f0d3d6b333eeaa3e82e58392b58d647c33, reversing
changes made to 8d5c7abe89f98d4c8248e0b50eb8857f2a31f049.
2015-08-24 11:02:54 -07:00
Nico Alt
4331fa4047 Revert "Prompt for beta updates"
This reverts commit 92f8678b3d2da18ad93bac6af0ae83984cf74714.
2015-08-22 10:04:42 +02:00
Daniel Martí
478ff88a82 Don't crash if we couldn't generate a certificate
Another crash workaround for #334. Even though this null check should be left
there, since getCertificate() may return null for whatever reason.
2015-08-20 21:14:38 -07:00
Daniel Martí
1f41bbdc0d Replace printStackTrace with proper Log.e calls 2015-08-20 19:28:30 -07:00
Daniel Martí
8669fddd70 Properly log exceptions 2015-08-20 19:21:50 -07:00
Daniel Martí
ce8c928337 Move some Log.i to debug logs
These don't look like they will be useful to users at all.
2015-08-20 19:09:27 -07:00
Daniel Martí
c9cdc1a5dc Remove all Log.d calls from release builds 2015-08-20 18:59:14 -07:00
Daniel Martí
d04f26b6e4 Raise some log message priorities 2015-08-20 18:59:13 -07:00
Daniel Martí
96014a7365 Simplify debugging logging via Utils 2015-08-20 18:37:25 -07:00
Daniel Martí
2d14e3c1c4 Temporarily work-around for repo update crashes
On certain locales, F-Droid would crash at startup due to #334.

This isn't a proper fix, but rather a workaround that logs what happened and
links to the issue, instead of making F-Droid crash entirely.
2015-08-20 17:49:57 -07:00
Daniel Martí
05285d23b7 Replace fdroid.org with f-droid.org 2015-08-20 10:06:01 -07:00
Daniel Martí
e4527da122 Prepare for sdk level 23 2015-08-20 09:56:57 -07:00
Daniel Martí
3f5b5ffc93 Avoid package receiver NPE crashes. Fixes #380. 2015-08-19 11:19:59 -07:00
Daniel Martí
780f77dab9 Don't show menu item to enable NFC if not available
Follow-up to #379
2015-08-18 14:16:50 -07:00
Daniel Martí
fd7f942595 Avoid NPE crash on devices without NFC. Fixes #379. 2015-08-18 13:14:13 -07:00
Daniel Martí
d9ed0ffb0d Merge branch 'installer-patches' 2015-08-15 14:01:03 -07:00
Daniel Martí
0e3172b277 Use mkdir -p instead of mkdir to not error if already existing
See #364
2015-08-12 13:41:13 -07:00
Daniel Martí
98117b19c0 Make sure that our system folder is 755
See #364
2015-08-12 13:41:02 -07:00
Daniel Martí
e434f39839 Android Studio fixes 2015-08-12 13:33:43 -07:00
Daniel Martí
e895d1f0d3 Merge branch 'master' into 'master'
Add timeout for Http request

The timeout of HttpURLConnection is 0, which means the request would never return if either connection or read timeouts, and the code would never catch these exceptions.

This patch set explicit timeout value (10s for connection timeout and 40s for read timeout), so the code would catch and handle timeout exceptions as you would expect.

Best,

See merge request !117
2015-08-11 00:20:17 +00:00
Daniel Martí
14cd500121 Remove unnecessary uses of getString(int) 2015-08-10 17:11:51 -07:00
Daniel Martí
eab27d402b Update install/uninstall internal error codes to 5.1 2015-08-10 17:11:51 -07:00
Daniel Martí
816bd4b2e6 Start reporting proper install/uninstall error messages 2015-08-10 17:11:50 -07:00
Daniel Martí
79b1396e4a Disable uninstall button if the app cannot be uninstalled
Fixes #329
2015-08-10 17:11:50 -07:00
Daniel Martí
ba54e8b798 SystemInstaller: don't try to remove system apps without updates 2015-08-10 17:11:50 -07:00
Daniel Martí
4e0808449d InstallIntoSystem: Apks are fine being 644, no need for 655
See #364
2015-08-10 17:08:01 -07:00
Daniel Martí
052f411433 InstallIntoSystem: add missing trailing '/'
See #364
2015-08-10 16:54:50 -07:00
Daniel Martí
ddb94cc831 Cleanup "Downloading..." icon if download fails 2015-08-10 14:56:33 -07:00
Miku Nyan
a4fe44437a fix #361 2015-08-10 21:44:20 +03:00
Daniel Martí
d6dcf6bf7b Don't prompt users to install into system until it's stable
Right now there are multiple issues - #294, #346, #347, #348 - so telling
people to go through the process at startup should not happen yet.
2015-08-09 12:12:41 -07:00
Daniel Martí
56ff9d1353 Re-add lightWithDarkActionBar enum item (fixes #340)
Added it in the same position as it was originally.
2015-08-09 12:12:28 -07:00
Daniel Martí
9cafe80763 Merge branch 'betaUpdates' into 'master'
Prompt for beta updates

Ready to get merged. 👍

~~This MR is ready to get merged, the last thing that needs to be fixed is [this](72ed814a73 (note_1726274)).~~

This closes #313.

See merge request !112
2015-08-09 18:33:09 +00:00
Peter Serwylo
2b8a882933 Merge branch 'integration/mr-102-and-107' into 'master'
Integration branch containing both MR 102 and 107

Given both MR !102 and !107 both stood on eachothers feet to some extent, this branch contains all commits from both in an integration branch. If both @Nutomic and @eighthave are happy that it faithfully kept their changes during the minor merge conflict resolutions, then we can merge this instead of those two branches. 

* !102 changed download progress from events + listeners to broadcasts + receivers.
* !107 made use of download progress events + listeners to show a downloading UI that was embedded in the activity, rather than shown as a modal dialog.

The conflicts which arose while I merged these branches together were in `AppDetails`. I made it so that, to the best of my ability, it uses broadcast receivers instead of progress listeners when updating the progress bar. Other than that, the only other conflict was both trying to store a reference to the main button from the UI. The only changes were in naming (mainButton vs btMain) and also in the place where the local variable was assigned (onCreate() vs setupViews() which is called during onCreate() anyway).

After merging, I did some minor cleanups. This is because in the process of checking that my conflict resolution compiled, I thought it best to remove a bunch of warnings from `AppDetails` and others. Turns out that by doing so, I found a bug due to the integration (to do with the `AppDetails` querying the downloader for status in `onResume()` rather than waiting for a broadcast event) so I'm glad I did so.

Let me know what you think, and then after the next stable, we can go ahead and merge this if people are happy.

p.s. I have no idea why GitLab is showing @eighthave's commit at the top of the list of commits, after my integration related commits.

See merge request !114
2015-08-09 06:09:54 +00:00
xinxin
e3140573ac Add timeout for Http request 2015-08-08 19:04:16 -07:00
Daniel Martí
f1901d75ac Remove leftover lightWithDarkActionBar enum item 2015-08-03 17:52:31 -07:00
Daniel Martí
bdb71d828f Have the light theme as the default throughout
It was changed in preferences.xml, but not in the manifest and in the default
case in the Java code.
2015-08-03 17:45:32 -07:00
Peter Serwylo
cbd8c977e2 Use annotations to remove lint warnings.
Also removed undocumented java doc.
2015-08-03 22:59:47 +10:00
Peter Serwylo
215dcc0dd9 Don't use Notification class, but rather NotificationCompat. 2015-08-03 22:59:46 +10:00
Peter Serwylo
f3a9581d89 Fix warnings in app details (remove progress thingo).
AppCompat no longer supports progress indicators in the action bar. So
this is not your everyday "Deprecated, but sure, keep using it" job.
Rather, it is "deprecated, and no, we wont even let you use it."

Also removed unused argument and extended AppCompatActivity.
2015-08-03 22:59:46 +10:00
Peter Serwylo
a0bf49d1ea Reinstate code to allow resumed activity to query download status (rather than wait for broadcasts). 2015-08-03 22:59:46 +10:00
Peter Serwylo
b2bde89834 Merge remote-tracking branch 'Nutomic/no-download-dialog' into integration2/mr-102-and-107 2015-08-03 22:59:38 +10:00
Hans-Christoph Steiner
b8261fcecf EXTRA_REPO_ERRORS in Intents should be a CharSequence[], not an ArrayList
This was including the instance of the ArrayList in the Intent, rather than
the expected CharSequence[].
2015-08-03 11:58:34 +02:00
Hans-Christoph Steiner
60f02c0181 in Downloader, instance vars that are set in constructor should be final 2015-08-01 21:02:39 +02:00
Hans-Christoph Steiner
5582e906c8 disable Install/Run/Uninstall button when the install process is running
To make things less confusing, this disables the main button on AppDetails
when something is running.  During install, it also changes the text of the
button to "Installing..."
2015-08-01 21:02:39 +02:00
Hans-Christoph Steiner
7d48ad736c replace Downloader's ProgressListener with local broadcasts
This removes lots of boiler plate, makes it much easier to get the info
where it is needed, and puts the code in line with rest of FDroid. The
ProgressListener pattern was forcing a lot of passing the listener
instances around through classes that never used the listener even.
2015-08-01 21:02:38 +02:00