4463 Commits

Author SHA1 Message Date
Hans-Christoph Steiner
e02c0cb555 Merge branch 'new-ui/getInstalledApk' into 'master'
AppDetails2: bring back getInstalledApk() from AppDetails

Closes #985

See merge request !500
2017-05-01 19:33:30 +00:00
Hans-Christoph Steiner
39e382b810 Merge branch 'weblate' into 'master'
weblate import for 0.103-alpha4

See merge request !499
2017-05-01 19:30:24 +00:00
Hans-Christoph Steiner
53417955c9 weblate import for 0.103-alpha4 2017-05-01 19:30:22 +00:00
Chirayu Desai
ef6c03c45d AppDetails2: bring back getInstalledApk() from AppDetails
* Addition: Try to get apk details via InstalledAppProvider too.
 * In certain cases, such as the "UnifiedNlp (no GAPPS)" app on a device
   with actualy GAPPS / GMS installed, apk can be null which leads
   to a crash
 * Ask InstalledAppProvider for the app's details too, like it
   was done in the old UX AppDetails.
 * Also seen when uninstalling app with a signing key different,
   fixes #985
2017-05-02 00:47:08 +05:30
Peter Serwylo
11c42f6a2f Merge branch 'pre-0.103-alpha4-rename' into 'master'
nail down language pref handling for localized index metadata

See merge request !496
2017-04-30 12:20:18 +00:00
Hans-Christoph Steiner
0a59c5c6e5 fully write up locale choosing for the 'localized' block
This is how locales are handled when parsing the index from the server.
2017-04-28 10:41:30 +02:00
Hans-Christoph Steiner
d946678568 remove redundant "About" header in Settings view 2017-04-28 10:41:30 +02:00
Hans-Christoph Steiner
4d785bd6bd use better variable name for the set of available locales 2017-04-28 10:41:30 +02:00
Hans-Christoph Steiner
03168ff99e separate index locale preference handling on >= android-24
In android-24 and newer, the user can specify multiple languages in a
priority list. Therefore, the locale chooser logic here does not need
to work so hard to find a language match.  For example, if the user
wanted to see country-specific variants, they would add them to the
preference list.

With older versions of Android, the pref is only a single locale. So
chances are that someone who specified de_AT would rather see de or
de_DE than en_US.  Same goes for es_AR, ar_EG, etc.  This could annoy
Chinese speakers, since someone who sets zh_TW could potentially see
zh_CN, which are written pretty differently.
2017-04-28 10:41:30 +02:00
Hans-Christoph Steiner
dc57fd712b rename index-v1 'localized' key names to match fdroidserver
This makes the key names standardized across fdroidclient,
fdroidserver, and index-v1.json.

fdroidserver!261
2017-04-28 10:41:30 +02:00
Hans-Christoph Steiner
bdc9a14c2a use android-24+ LocaleList when choosing localized index data
When choosing localized data from the index, this includes the new
LocaleList feature that represents the user's preferred locale ranking

https://developer.android.com/reference/android/os/LocaleList.html
2017-04-28 10:41:30 +02:00
Hans-Christoph Steiner
add570ab4b hide Languages pref on >= android-24
Android 24 and later provides tons of languages, and a way to rank
multiple languages instead of choosing one.  The Languages pref is a
big hack and can be problematic, so its better to disable it when its
not needed.  This will make it so it is no longer possible to set
F-Droid to a language that the system does not support.

#943
2017-04-28 10:41:30 +02:00
Hans-Christoph Steiner
50982060ac support index locales that do not include country (e.g. 'en') 2017-04-28 10:41:30 +02:00
Hans-Christoph Steiner
2586e87524 clear Languages pref when using System Default
Keeps things clean if System Default clears out the pref entirely.
2017-04-28 10:41:30 +02:00
Hans-Christoph Steiner
5febedebd6 fix mispelled Languages.getLanguages() 2017-04-28 10:41:30 +02:00
Hans-Christoph Steiner
561a18ad2b Merge branch 'fix-962--notify-of-downloaded' into 'master'
Show downloaded + not installed apps in "Updates"

Closes #962

See merge request !488
2017-04-28 08:38:12 +00:00
Hans-Christoph Steiner
7199e829f3 Merge branch 'fix-974--repo-priorities-and-suggested-vercode' into 'master'
Don't suggest lower versions, despite repository priorities.

Closes #974

See merge request !497
2017-04-28 08:34:10 +00:00
Peter Serwylo
6c08e054f5 Calc suggested versioncode properly, regardless of repo priorities.
There was a bug where the repo with the highest priority would be
responsible for specifying the suggested version code. When doing so, it
would only select from the list of apks available in that repo. This
improves the calculation so that when any given repos app gets a
suggested version code assigned, it selects from _all_ available apks,
not just those from the repository in question.

Fixes #974.
2017-04-28 11:50:08 +10:00
Peter Serwylo
294e1d2821 Simulate armeabi as the architecture during multi-repo test
This allows us to test "installing" Adaway, which has a native code
dependency that the default Robolectric setup doesn't support (defaults
to armeabi-v7a).
2017-04-28 11:50:05 +10:00
Peter Serwylo
b1a1c68ad7 Improved tests to catch incorrect suggested versions with multi repos.
This is the bug outlined in #974. This commit just adds a test which
catches the problem, but does not fix it yet.
2017-04-28 10:17:27 +10:00
Peter Serwylo
69816b5b82 Only and if there are any there. 2017-04-28 09:12:53 +10:00
Peter Serwylo
25edfffcbe Remove version check, allow version downgrades to appear in Updates tab correctly.
The version check guarded against downgrades, and would not notify the
user if it found a downgrade in the apk cache. However this was from
before we could ask `AppUpdateStatusManager#isPendingInstall(hash)`. Now
we don't need to care whether it is an upgrade or a downgrade, because
there is a more authoritative source as to whether this apk is
interesting to us or not.
2017-04-28 09:12:33 +10:00
Peter Serwylo
0d1e00b6cf Don't accidentally return Apk instances from the wrong repo
There may be multiple apk files with the same hash. Although it is not a
security issue to install one or the other (they are exactly the same
binary), they may have different metadata to display in the client.
Thus, it may result in weirdness if one has a different
name/description/summary etc).

This change takes each of the matching Apk objects from the database,
then asks them where they expect to be downloaded. It matches this
against the File that we are looking at and only returns if they match.
2017-04-28 08:34:00 +10:00
Hans-Christoph Steiner
f8c9d7ec8e Merge branch '0.103-alpha3--ui-fixes' into 'master'
0.103-alpha3  UI fixes

Closes #981, #967, and #965

See merge request !490
2017-04-26 10:34:02 +00:00
Peter Serwylo
06088e2b35 Send acra report about crash we are getting, but don't crash F-Droid 2017-04-26 19:39:26 +10:00
Hans-Christoph Steiner
8e168b46a7 Merge branch '0.103-fixes--pre-21-crashes' into 'master'
Don't use attr for color value in drawables.

Closes #979

See merge request !493
2017-04-26 07:20:10 +00:00
Peter Serwylo
1b6dc02513 Merge branch 'privext-installconfirm' into 'master'
Set app theme for Privileged Extension's Install Confirm Activity

See merge request !491
2017-04-26 06:07:42 +00:00
Peter Serwylo
74795d2f7a Don't use attr for color value in drawables.
According to the following this is not supported:

 * http://stackoverflow.com/a/13471695/2391921

This uses the approach in that SO answer, by extracting the attribute to
instead point at a drawable, and have one drawable for each theme.

Fixes #979.
2017-04-26 10:06:00 +10:00
Peter Serwylo
7375e09d19 Fail softly, notifying user of failure rather than crashing, 2017-04-26 08:38:41 +10:00
Peter Serwylo
e6c6c28f5f Formatting + PMD fix in response to CR
PMD does not like manually throwing NPEs, even if they have more verbose
information than the default NPE. As such, use an
`IllegalArgumentException` instead.
2017-04-26 08:38:03 +10:00
Peter Serwylo
4b70d81e5c Make install/uninstall/run/upgrade buttons not overlap last updated text
Instead of showing them below the icon, it now puts the icon + name +
author + last updated into a single layout which can grow if the app
name or author wraps to a second line. The buttons are now below this
additional layout.
2017-04-26 08:28:25 +10:00
Peter Serwylo
2a6dcb63bb Check for null in App#iconUrl.
Although I'm unsure of exactly why this is `null`, it seems sensible
that there is a possibility of null icons (e.g. for .zip files or other
media). As such, this just adds a guard condition to ensure that the
`iconUrl` is not null.

Fixes #981.
2017-04-26 08:28:25 +10:00
Peter Serwylo
6a0b16fc7d Increase verbosity around crash site for better ACRA reports.
Received the following crash report, where the user said it crashed
while trying to install the priviledged extension:

```
java.lang.NullPointerException: Attempt to read from field 'android.content.pm.Signature[] android.content.pm.PackageInfo.signatures' on a null object reference
at org.fdroid.fdroid.installer.ApkSignatureVerifier.getApkSignature(ApkSignatureVerifier.java:70)
at org.fdroid.fdroid.installer.ApkSignatureVerifier.hasFDroidSignature(ApkSignatureVerifier.java:54)
at org.fdroid.fdroid.installer.ExtensionInstaller.installPackageInternal(ExtensionInstaller.java:53)
at org.fdroid.fdroid.installer.Installer.installPackage(Installer.java:265)
at org.fdroid.fdroid.installer.InstallerService.onHandleIntent(InstallerService.java:77)
at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
at android.os.Handler.dispatchMessage(Handler.java:111)
at android.os.Looper.loop(Looper.java:194)
at android.os.HandlerThread.run(HandlerThread.java:61)
```

Not sure how to address it yet, so adding more specific excetpion for
if it happens in the future.
2017-04-26 08:28:24 +10:00
Peter Serwylo
1eb224fc5e Don't show run button for apps which cannot be launched.
The feedback from ACRA was:

> tried to run an app that doesn't have a launcher (termux api)
2017-04-26 08:28:24 +10:00
Peter Serwylo
4cc6e5bc89 Sort categories alphabetically by name.
This pulls all the categories out of the database at once for sorting,
rather than sorting in SQLite. This is to prevent having to store the
localized category names in the database (and hence having to update
them when the locale is changed).

Fixes #967.
2017-04-26 08:28:24 +10:00
Peter Serwylo
e2c82d2943 Accessibility tweaks in app details.
* Correctly read out "Cancel download"
 * Allow users to hear download progress correctly.
2017-04-26 08:28:24 +10:00
Peter Serwylo
bae5bdb1f4 Force apps in "Installed" list to sort by name.
Previously they were left to be sorted however SQLite parsed the query.
This turned out to result in them beign sorted by repos first, then
names. For example, all of the GP apps would be at the bottom of the
list.

Fixes #965.
2017-04-26 08:28:24 +10:00
Peter Serwylo
96a9681fd1 Merge branch 'colorfix' into 'master'
lighten app card background in category view for #907

See merge request !492
2017-04-25 22:18:25 +00:00
Stephen Michel
2272e441c6 lighten app card background in category view for #907 2017-04-25 15:05:19 -04:00
Chirayu Desai
86ba3bb6c6 Set app theme for Privileged Extension's Install Confirm Activity
* This applies the dark theme correctly.
2017-04-25 19:05:43 +05:30
Peter Serwylo
671589d1d6 Merge branch 'master' into 'master'
Pressing back button brings back where it sould

See merge request !489
2017-04-25 00:29:02 +00:00
Peter Serwylo
ccdd8a168c Don't prompt user to install, if apk is in cache from a previous install
Use SharedPreferences to keep track of whether we are in the middle of
an install for a particular apk or not. If sothen the presence of an
.apk file in the cache means we need to tell the user (in the updates
tab) that a file is ready to install.
2017-04-25 10:20:56 +10:00
Peter Serwylo
79d526ead1 Correctly notify user of downloaded but not installed apks
Previously this only worked for apps which were being upgraded to the
latest available version. Now it works for apks being upgraded from an
old version to a newer-but-not-newest version. Perhaps more importantly,
it also now works for newly installed apps.

This has a problem where if a user installs, then uninstalls an app,
they are still notified about installing it. This is because the apk
is in the cache and the code doesn't know whether it is there from
the initial install, or because it has been redownloaded by the user
to install some time after uninstalling.
2017-04-25 10:18:16 +10:00
Maestus
07bc33d391 Pressing back button in toolbar (in AppDetails) brings back where it sould 2017-04-23 23:16:19 +02:00
Peter Serwylo
c4fd369feb Merge branch 'dark-mode-fixes' into 'master'
More dark more fixes

See merge request !487
2017-04-20 22:44:31 +00:00
Chirayu Desai
9f50bef04f More dark more fixes
Fixes some leftover items missed in the previous major update.
* Donate view in AppDetails
* What's new view in AppDetails
* The search view
2017-04-21 01:39:39 +05:30
Hans-Christoph Steiner
cb241a23ef Merge branch 'explicit-pending-intents' into 'master'
Ensure PendingIntents use explicit Intents

See merge request !485
2017-04-20 16:55:46 +00:00
Peter Serwylo
b0803432d8 Ensure PendingIntents use explicit Intents.
The only pending intents that were not explicit were the four from
the NotificationHelper class. These now explicitly specify the
NotificationBroadcastReceiver as their destination, which is not
exported. That then forwards the intents onto relevant methods of
AppUpdateStatusManager.
2017-04-20 17:03:37 +10:00
Hans-Christoph Steiner
9703589950 update meeting time in README 2017-04-19 10:48:13 +02:00
Hans-Christoph Steiner
471083b8f4 Bump to 0.103-alpha3 v0.103-alpha3 2017-04-19 00:19:10 +02:00