2096 Commits

Author SHA1 Message Date
Hans-Christoph Steiner
558dde5f77 run Deflator.end() to get rid of StrictMode errors:
java.lang.Throwable: Explicit termination method 'end' not called
	at dalvik.system.CloseGuard.open(CloseGuard.java:180)
	at java.util.zip.Deflater.<init>(Deflater.java:171)
	at kellinwood.zipio.ZioEntryOutputStream.<init>(ZioEntryOutputStream.java:35)
	at kellinwood.zipio.ZioEntry.getOutputStream(ZioEntry.java:482)
	at kellinwood.security.zipsigner.ZipSigner.signZip(ZipSigner.java:759)
	at kellinwood.security.zipsigner.ZipSigner.signZip(ZipSigner.java:664)
	at org.fdroid.fdroid.localrepo.LocalRepoKeyStore.signZip(LocalRepoKeyStore.java:213)
	at org.fdroid.fdroid.localrepo.LocalRepoManager.writeIndexJar(LocalRepoManager.java:492)
	at org.fdroid.fdroid.views.swap.SwapWorkflowActivity$PrepareSwapRepo.doInBackground(SwapWorkflowActivity.java:759)
	at org.fdroid.fdroid.views.swap.SwapWorkflowActivity$PrepareSwapRepo.doInBackground(SwapWorkflowActivity.java:709)
	at android.os.AsyncTask$2.call(AsyncTask.java:304)
	at java.util.concurrent.FutureTask.run(FutureTask.java:237)
	at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:243)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
	at java.lang.Thread.run(Thread.java:761)
E StrictMode: A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks.
2018-08-17 12:03:31 +02:00
Hans-Christoph Steiner
e450569a69 espresso: do extra memory clean up to keep StrictMode happy
There were some occasional StrictMode errors about multiple instances of
MainActivity.  This cleanup idea comes from Google:

6f3a38f3af
2018-08-17 12:03:31 +02:00
Hans-Christoph Steiner
9d8232472f tests: dismiss dialogs in the emulator with back button before run
The ARM emulator can show ANRs for 'system' on boot, so that dialog needs
to be dismissed before the Espresso tests can happen.

https://android.googlesource.com/platform/frameworks/testing/+/master/uiautomator_test_libraries/src/com/android/uiautomator/common/UiWatchers.java
2018-08-17 12:03:30 +02:00
Hans-Christoph Steiner
990d05dc0f skip Espresso tests on ARM emulators
ARM emulators are too slow to run these tests in a useful way.  The
sad thing is that it would probably work if Android didn't put up the
ANR "Process system isn't responding" on boot each time.  There seems
to be no way to increase the ANR timeout.
2018-08-17 12:03:08 +02:00
Hans-Christoph Steiner
fd7acd6304 disable all animations in emulator for Espresso tests
* https://gist.github.com/xrigau/11284124
* https://gist.github.com/xrigau/ea8d306e0a751fafb1e6
* https://artemzin.com/blog/easiest-way-to-give-set_animation_scale-permission-for-your-ui-tests-on-android/
* https://github.com/finn-no/android_emulator_hacks
* https://gist.github.com/caipivara/9371a79a7222a156ddad
2018-08-17 10:10:00 +02:00
Hans-Christoph Steiner
2f038d81e0 error on NewApi/InlinedApi to catch compat issues with old devices 2018-08-17 10:10:00 +02:00
Hans-Christoph Steiner
897a35aa76 enable lint TrustAllX509TrustManager as error 2018-08-17 10:10:00 +02:00
Hans-Christoph Steiner
896d4a788f enable lint PackageManagerGetSignatures as error 2018-08-17 10:10:00 +02:00
Hans-Christoph Steiner
4a684182ca enable lint "GetInstance" security check as error 2018-08-17 10:10:00 +02:00
Hans-Christoph Steiner
0e6e839ed7 fix lint "WifiManager Potential Leak" 2018-08-17 10:10:00 +02:00
Hans-Christoph Steiner
e75a1a7005 remove test runner that was needed by Jenkins and Eclipse
Even the project's README says it is no longer needed:
https://github.com/jsankey/android-junit-report
2018-08-17 10:10:00 +02:00
Hans-Christoph Steiner
81b32120e9 fix UnusedResources errors left over from basic/full flavor split 2018-08-17 10:10:00 +02:00
Hans-Christoph Steiner
667197eeac remove old unused strings and translations
90acd75b90549d1cdc700672a6bb21cc1895f75a

fdroid/fdroidclient#928
2018-08-17 10:10:00 +02:00
Hans-Christoph Steiner
8fb43b29b2 misc lint fixes
fdroid/fdroidclient!543
2018-08-17 10:10:00 +02:00
Hans-Christoph Steiner
32296910df set @NotNull properly when overriding methods
fdroid/fdroidclient!543
2018-08-17 10:10:00 +02:00
Hans-Christoph Steiner
ae56d5c97c set some vars to final
fdroid/fdroidclient!543
2018-08-17 10:10:00 +02:00
Hans-Christoph Steiner
e5d25ae8d0 use StringBuilder when assembling the repo fingerprint for display
Should speed things up a bit, and fixes a lint issue.
2018-08-17 10:10:00 +02:00
Hans-Christoph Steiner
6f88dcdbf5 fix NewApi lint issue in InstallerService.uninstall
For whatever reason, this didn't seem to cause crashes on old devices. But
better safe than sorry.
2018-08-17 10:10:00 +02:00
Hans-Christoph Steiner
0e368c6d6e only disable lint in the basic flavor for UnusedResources
My hack before was actually always making exit with success, breaking the
CI runs :-/  I loathe gradle and groovy with a passion.
2018-08-17 10:09:59 +02:00
Hans-Christoph Steiner
3d05363c31 enable Espresso tests with some basic UI tasks 2018-08-17 10:09:59 +02:00
Hans-Christoph Steiner
8cae4da748 tests: fix running test suite in Android Studio
Sometimes the test suite just totally bombs out and fails on every single
job with the same Robolectric crash.  Adding this line seems to fix it.

https://github.com/robolectric/robolectric/issues/3846

Here's the error:
java.lang.VerifyError: class org.robolectric.android.fakes.RoboMonitoringInstrumentation overrides final method specifyDexMakerCacheProperty.()V
2018-08-17 10:09:59 +02:00
Hans-Christoph Steiner
e215c26517 tests: ensure all database usages are properly closed
Leaving lots of DB connections open seems to make OpenJDK crash a lot,
giving false fails for the CI tests.
2018-08-17 10:09:59 +02:00
wsdfhjxc
0af7c18750 Set focus on the header section if there's a changelog 2018-08-15 22:23:13 +02:00
wsdfhjxc
66530358b8 Don't use OverscrollLinearLayoutManager in AppDetails2 anymore 2018-08-15 02:56:53 +02:00
Hans-Christoph Steiner
d64a55e013 close the database after completing the test run 2018-08-08 00:00:20 +02:00
Hans-Christoph Steiner
2cf2fe5341 when downgrading, reset the database 2018-08-08 00:00:01 +02:00
Hans-Christoph Steiner
91c84a8588 version code 1003051 2018-08-07 23:33:33 +02:00
Hans-Christoph Steiner
0d1a53863e ./tools/png-pre-compress to strip unneeded stuff 2018-08-07 23:33:33 +02:00
Hans-Christoph Steiner
fc65502ce4 make some LocalHTTPD tests require no Keep-Alive 2018-08-07 23:33:33 +02:00
Hans-Christoph Steiner
e3b26b76f6 make swap webserver never support HTTP Connection Keep-Alive
NanoHTTPD has issues with HTTP Keep-Alive, especially when other requests
are mixed in, like the /request-swap POST or perhaps the F-Droid HEAD to
fetch the ETag before the GET.

This disables gzip encoding and sets a Content Security Policy while I'm at
it.  APKs, PNGs, and JARs are already compressed, so gzip would only ever
cause problems.  And the index page is meant to be viewed by browsers, so
having a CSP will limit potential malicious swap activity.
2018-08-07 23:33:33 +02:00
Hans-Christoph Steiner
47929fa4b3 Merge branch 'master' into 'master'
bump to latest netcipher to fix TLSv1.3

Closes #1040

See merge request fdroid/fdroidclient!728
2018-08-07 18:55:25 +00:00
Hans-Christoph Steiner
b6c69f7548 Weblate 2018-08-07 16:24:00 +00:00
Hans-Christoph Steiner
2194dbd649 bump to latest netcipher to fix TLSv1.3, closes #1040 2018-08-07 17:21:38 +02:00
Hans-Christoph Steiner
738216c205 totally rework LocalHTTPD based on nanohttpd 2.3.1
The webserver was totally broken since nanohttpd had changed so much since
the swap webserver was implemented.  This syncs up with the sample file and
gets rid of our hacks.  The only differences now are the stuff that is
removed since it is totally unused in F-Droid.  This also adds a full test
suite.

this actually closes #248
2018-08-07 13:51:47 +02:00
Hans-Christoph Steiner
f1e5653601 hardcode limited MIME Types for the swap webserver
The MIME Types only need to be set on files that we are actually using to
display in the browser.  All others should not be set so that they cannot
be abused.
2018-08-07 11:28:48 +02:00
Hans-Christoph Steiner
e4c9d1d522 move requestSwap method to static Intent-sending method pattern 2018-08-07 11:28:48 +02:00
Hans-Christoph Steiner
ddb85befa6 index.xml must use "sha256" as hash type, not "SHA-256"
Otherwise the string matching in RepoXMLHandler.endElement() fails, and the
swap repo's index.xml will use "SHA-256" instead of the correct "sha256".
2018-08-07 11:28:48 +02:00
Hans-Christoph Steiner
f56fbf4dcb swap connections fail with strange errors with keep-alive enabled 2018-08-07 11:28:48 +02:00
Hans-Christoph Steiner
57a00938a0 fix broken index.jar signing for swap repos
Broken in the switch to bouncycastle: 5c6c54cadfa8511296b8f7374b113c4e26b7b3a4
2018-08-07 11:28:48 +02:00
Hans-Christoph Steiner
e0d6371147 use constants for index.xml and index.jar throughout the code 2018-08-07 11:28:48 +02:00
Hans-Christoph Steiner
8ad951317a set basic flavor app name to "F-Droid Basic" 2018-07-31 16:20:31 +02:00
Hans-Christoph Steiner
cdf419d1fe set Basic to use auto-download by default
This will give us a nice testing ground for how this will work for the main
build flavor.

fdroid/fdroidclient#932
2018-07-31 16:20:07 +02:00
Hans-Christoph Steiner
49e1e0bf17 add separate, rough icon for F-Droid Basic 2018-07-31 16:09:45 +02:00
Hans-Christoph Steiner
af7b94ff4c add Latest view to basic flavor
This is a quick hack to reuse the Latest view with a slightly simpler
layout.  It makes the "basic" flavor fully functional as an fdroid client.
The goal here is just to have something simpler with as little new code as
possible.  It is essential that the whitelabeling and "Light" aka "basic"
flavor does not increase the maintenance load.

closes fdroid/fdroidclient#48
fdroid/fdroidclient!692
fdroid/fdroidclient!695
2018-07-31 15:06:09 +02:00
Hans-Christoph Steiner
8e0c355534 version code 1003050 2018-07-31 14:40:32 +02:00
Hans-Christoph Steiner
8f393d9f43 hide "Include touchscreen apps" pref on devices with touchscreen
closes fdroid/fdroidclient#1438
2018-07-31 12:19:07 +02:00
Hans-Christoph Steiner
3a501c9eac show PendingInstall and Installing in the Updates tab 2018-07-30 18:03:45 +02:00
Hans-Christoph Steiner
fe37695751 show "Anti-features" in list view when app is filtered
closes fdroid/fdroidclient#1533
2018-07-30 18:03:45 +02:00
Hans-Christoph Steiner
90acd75b90 purge broken, semi-used root filtering preference
RequiresRoot should become an Anti-Feature or <uses-feature> or
something like that. Having it a one-off makes it too brittle

fdroid/fdroidclient#928
2018-07-30 18:03:12 +02:00
Hans-Christoph Steiner
109a927a68 show downloading header on Downloading/PendingInstall status
PendingInstall means that the user considers the install still in process,
like when F-Droid gets killed in the background.  There is unfortunately no
reliable way currently to ensure that removePendingInstall() is called when
the app is finally installed so we can't use it here.

This reverts a small part of 1c50e2891054b629e2af6b2d0b1fc89e0b1cf18b

closes fdroid/fdroidclient#1527
fdroid/fdroidclient#1532
2018-07-30 18:02:03 +02:00