4295 Commits

Author SHA1 Message Date
Hans-Christoph Steiner
5971533b09 changelog for 0.102.3
closes #898
2017-04-01 17:30:41 +02:00
Hans-Christoph Steiner
bcb2894d4c update CHANGELOG for 0.102.x 2017-04-01 16:28:45 +02:00
Hans-Christoph Steiner
21fd522e95 only set installer to privext on versions where its required
To limit the possible oddness of having the installer package being
something different than F-Droid, only set it to priv ext on android-24
and newer, since its required there.
2017-03-31 20:07:56 +02:00
Hans-Christoph Steiner
a9a37747cb Merge branch 'uninstall' into 'master'
Set installer package name to privext if using that

See merge request !454
2017-03-31 18:00:41 +00:00
Hans-Christoph Steiner
e2ab447315 Merge branch 'privext-updates' into 'master'
InstallerFactory: Check for privext before checking if apk to be installed is privext

Closes #911

See merge request !459
2017-03-31 17:45:11 +00:00
Hans-Christoph Steiner
c69f443506 Merge branch 'add-new-index-format' into 'master'
Add new index format to support localization and graphics

See merge request !422
2017-03-31 17:44:07 +00:00
Peter Serwylo
c3424f9ff3 Update AppDetailsAdapterTest for apps that don't have screenshots.
While here, also added a couple of new test cases to better ensure the
adapter plays nicely with its items when receiving an app with specific
states.
2017-03-31 12:12:19 +02:00
Peter Serwylo
e34f289246 Setup and teardown preferences singleton for new tests.
Depending on the order the tests are run, this may have resulted in an
exception due to the singleton being setup multiple times.
2017-03-31 12:12:16 +02:00
Peter Serwylo
fb6f61c226 Instructions for getting tests to run in AS again. 2017-03-31 12:12:12 +02:00
Hans-Christoph Steiner
b08dfdcb80 move "What's New" placeholder to where its used
There is still quite a bit to figure out in the data format of the
per-package "What's New" entries, and its breaking the tests, so move
the placeholder code to the one spot where the placeholder whatsNew
entry is used.
2017-03-31 12:11:56 +02:00
Hans-Christoph Steiner
d90c773161 do not show screenshots view in AppDetails if none are available
App.getAllScreenshots() works nicely here, but its probably a temporary
measure until we figure out how to handle the various kinds of
screenshots (TV, Wear, etc).
2017-03-31 09:09:31 +11:00
Hans-Christoph Steiner
28bcbc548a use central method to setup Jackson in locked down setup
This is based on @pserwlyo's work.  The App and Apk classes currently
need just the public instance variables auto-filled by Jackson, so
everything else is considered opt-in, via @JsonProperty declarations.
This is currently only used for setLocalized(), setUsesPermission(),
and setUsesPermissionSdk23().

# Conflicts:
#	app/src/test/java/org/fdroid/fdroid/updater/IndexV1UpdaterTest.java
2017-03-31 09:09:31 +11:00
Hans-Christoph Steiner
2a2e475bdc index-v1 future proof test for uses-permission
The parser should accept additional elements to each
uses-permission entry, in case more XML attributes is added to
<uses-permission>.  <uses-permission> has had two attributes
since the beginning.

Other changes to this JSON data structure are bad index-v1
format, and will cause crashes:

* Removing an element e.g. null from a uses-permission entry
  would be invalid index-v1 JSON, since that structure mirrors
  the uses-permission AndroidManifest.xml element, which has a
  long standing fixed definition of name/maxSdkVersion.  That
  should crash so that fdroidserver authors know they are
  generating invalid index-v1.

* setting versionCode to anything but an int is invalid index-v1
  JSON, and should crash.  versionCode has been defined as an
  32-bit signed integer value since the beginning of Android.

* <uses-permission android:name=""> has been defined as a string
  since the beginning of Android.

https://developer.android.com/guide/topics/manifest/uses-permission-element.html
2017-03-31 09:09:31 +11:00
Hans-Christoph Steiner
9d026bbdbc use string name for JacksonInject to make it easy to read
java
2017-03-31 09:09:31 +11:00
Hans-Christoph Steiner
f86b65e12a rename Apk.repo to match App.repoId and Repo.id
Somehow, the Apk class has its Repo ID variable confusingly named just
"repo", which throughout the code is used to represent an instance of
Repo.
2017-03-31 09:09:31 +11:00
Hans-Christoph Steiner
6f58c2a13d make Jackson inject repoId rather than looping later to add it
repoId is used in Repo, App, and Apk instances to point to the Repo data
in the database.  It does not come from the index files, but rather the
client database.
2017-03-31 09:09:31 +11:00
Hans-Christoph Steiner
38d21cd178 check timestamp with index-v1
An important security protection is erroring when the index-v1.jar is
older than what is currently in the database.  If the current or older
jar is allowed to be parsed, then a malicious server or
Man-In-The-Middle could replay old version of the index-v1.jar to
prevent the clients from learning about updates that fix security issues
2017-03-31 09:09:31 +11:00
Peter Serwylo
8cfe1d3584 Correctly populate FeatureImage with app.featureGraphic.
Fall back to extracting the colour from the apps icon if that
is all that is available.
2017-03-31 09:09:31 +11:00
Peter Serwylo
5aa44a4d74 Handle icon 404s without crashing. Resume settings without crashing on API > 17.
The image loading code for the app cards was presuming that the icon
returned did indeed exist. In this case, it crashed due to trying to
decode a `null` image.

I noticed that when returning to the settings fragment (e.g. by closing
then reopening F-Droid while viewing), it will attempt to re-remove the
priviledged preference. This causes a crash, so we check to see that we
still have the preference before deciding to remove it.
2017-03-31 09:09:31 +11:00
Peter Serwylo
517321356d the database does not support null Description
index-v1 does not send empty values.  The description was historically
set to "No description available" on the server side, and in
index.xml.  The database then inherited this behavior, and does not
support no description.  In the long run, it would be good to sync up
the database with the index-v1 metadata, but perhasp then we'd have to
add a million null guards, which wouldn't be worth it.
2017-03-31 09:09:31 +11:00
Hans-Christoph Steiner
40643855c4 do not let Jackson set instance vars that never come from index
Tell the Jackson JSON parser to ignore App/Apk fields that should never
come from the index, but instead are set locally to keep track of the
current state of things on the device.

There are two forms of tests to enforce that the proper things get
ignored.  It is not possible to do this with decorators alone, so I
chose to use @JsonIgnore and leave the variables we want filled in
undecorated.  Also, all of the instance variables in Apk/App/Repo
should come directly from the index metadata so that they are pure
data classes.  Currently some state info is stored in them, those are
decorated with @JsonIgnore.

The tests then include lists of accepted and ignored properties, and
anything that is not in those lists will cause the tests to fail.  So
if someone is adding a new instance variable, they will get a fail
until the tests are updated.  One set of tests actually writes blank
instances out as JSON since that's the easiest test to write, and
Jackson treats @JsonIgnore the same in both directions.  Then there is
another test that reads a JSON file with added, unsupported values to
make sure that they are properly ignored.
2017-03-31 09:09:31 +11:00
Hans-Christoph Steiner
281dd435e7 ignore unknown fields in index-v1 JSON data
Having Jackson set to ignore unknown fields in the incoming JSON data,
instead of throwing an Exception, means that we can add any fields to the
JSON without having to rev the index version, and older clients will still
parse it fine.  This is basically the same as in index.xml.
2017-03-31 09:09:31 +11:00
Hans-Christoph Steiner
9d97546c4f support localized text and graphics in index-v1 metadata
This sets the App instance variables using the localized index-v1 fields.
It trys to fill as many fields as possible, falling back to locales of the
same language, then finally English.

This is based on the Jackson JSON parser's ability to map a JSON key to a
method, e.g. @JsonProperty("localized")
db-version/67
2017-03-31 09:09:31 +11:00
Hans-Christoph Steiner
d769dcfc60 support new index-v1 format using Jackson parser
This adds support for parsing the new index-v1.json data as defined in
fdroidserver!221.  This new index metadata format is required to
support localization, graphics, screenshots, etc.

refs #15
2017-03-31 09:09:31 +11:00
Hans-Christoph Steiner
7e0ae10e84 uses-permission fields as Apk instance vars
This adds support for the index fields: uses-permission and
uses-permission-sdk-23.  For most index fields, Jackson handles directly
mapping the incoming data to the instance vars based on the matching
field/var names.  For uses-permission*, methods are declared for
handling those properties in the incoming index.

These fields will be ignored when using the v0 index.xml format.
2017-03-31 09:09:31 +11:00
Chirayu Desai
0bce5cebe6 InstallerFactory: Check for privext before checking if apk to be installed is privext
* Move the privileged extension installed check above
  the check whether the apk to be installed is privext.
* This lets privext updates work when it is already installed.
2017-03-29 15:11:28 +05:30
Chirayu Desai
2be79c35e7 Set installer package name to privext if using that
* The new PackageInstaller APIs, being used by the privext on Android
  7.0 and above aren't happy with uninstall being done by an app
  other than the original installer.
* Set it to the privileged extension if that is enabled and being used,
  to make uninstalling work
2017-03-27 19:28:11 +05:30
Peter Serwylo
befdc4a850 Merge branch 'new-ui--minor-ui-tweaks' into 'master'
Minor ui tweaks

Closes #896, #894, and #839

See merge request !453
2017-03-26 07:32:16 +00:00
Peter Serwylo
61d7ba9f29 Start auto downloads once preference is enabled.
Fixes issue #896.
2017-03-26 10:50:26 +11:00
Peter Serwylo
8ed62d22e1 Correctly listen for "Install complete" for previously downloaded apks.
This ensures that if the user has downloaded an update (manually or via
auto updates), then the UI will respond correctly once it is installed.
2017-03-26 10:50:26 +11:00
Peter Serwylo
b9c429d22d Add "App X successfully installed" to updates tab.
This notification is kind of weird, because the only ways it can be
dismissed is by:
 * Swiping a notification away from the notification drawer.
 * Closing and reopening F-Droid.

However I think the UX is still pretty nice:
 * Tells the user that it worked.
 * Allows them to navigate to it if desired.
2017-03-26 10:50:26 +11:00
Peter Serwylo
b179aaecff Remove final dependency on AppDetails (the old one).
In a future MR I will remove this class completely, but this just
ensures that touching a notification will not send the user to the old
AppDetails (instead sending them to AppDetails2).
2017-03-26 10:50:26 +11:00
Peter Serwylo
bf8a61765d Fix padding on bottom navigation.
Default padding specified is 12dp which is not very generous.
This reduces it to 2dp for seemingly good effect. Yet to see what it
looks like with longer translations of other languages, but time will
tell.
2017-03-26 10:50:25 +11:00
Peter Serwylo
bb7fca7382 Remember search input after hitting "Back" from app details.
Move logic which parses intent and forceably sets the text of our search
input to onCreate(), not onResume(). onCreate() is invoked each time a
new intent is sent to open up this activity. That is, each time a new
category is opened or a new search request is received. onResume() is
called much more often than this, including when the user is directed to
a new activity and then returns to the search screen after hitting back.
In this case we don't want to remove the search query the user had and
replace it with the data in the original intent.
2017-03-26 10:49:56 +11:00
Peter Serwylo
ba503812e4 Don't listen for the same broadcast events twice.
Caused crashes when we incorrectly provided info to the recyler view
about which items had been added/removed.
2017-03-26 10:49:56 +11:00
Peter Serwylo
d4584083af Refactor button styles for clearer distinction between large/small.
Small ones are used in the "Updates" screen, whereas large are used
elsewhere (e.g. in the app details, but also the "Start swap" screen).
2017-03-26 10:49:56 +11:00
Peter Serwylo
15be01ada9 Ignore UI dumps from Android Studio/DDMS.
These are useful for debugging things like padding/margin issues, but
they get dumped to the source dir by default.
2017-03-26 10:49:55 +11:00
Peter Serwylo
b177dc2cda Update "Nearby" splash screen to new UI.
Be sure to not hardcode "F-Droid" to ensure it is easier to rebadge
F-Droid if creating a whitelabel version.

Fixes #894.
2017-03-23 22:19:22 +11:00
Peter Serwylo
53bed0f2e1 Change language to clarify auto download preference
The previous language hinted at the fact we auto download and install
updates like Google Play. This is not the case (unless you have
priv-ext). To clarify, now we "Automatically _fetch_ updates", ready to
install when the user initiates the install.

Fixes #839.
2017-03-23 22:19:22 +11:00
Mikael
836d16393d Merge branch 'app_details_749_more_work' into 'master'
App details 749 more work

See merge request !451
2017-03-23 10:28:48 +00:00
mvp76
a32a534957 Fix test after adapter change 2017-03-23 11:12:59 +01:00
Peter Serwylo
31fdcba945 Remove xmlns from inner element 2017-03-23 09:42:46 +01:00
Peter Serwylo
80e0f84816 Use correct locale when uppercasing text.
Locale.getDefault() returns the default for the current JVM (or whatever
runtime Android calls it these days). By asking the configuration, we
will get the Locale that the user has selected from within the F-Droid
preferences.
2017-03-23 09:42:36 +01:00
mvp76
c059b83f2b Fix merge conflict 2017-03-23 09:37:33 +01:00
mvp76
622a1245dc Move "what's new" from its own section to the header section
Also, add some styling and placeholder text (randomly set or not set)
2017-03-23 09:32:58 +01:00
mvp76
2d27ba4086 Display anti-features
Issue #878.
2017-03-23 09:32:58 +01:00
mvp76
0689a39735 Add last updated under the title and author
Also, added styles for the title and the last updated text.
2017-03-23 09:32:58 +01:00
mvp76
d457a5ca0a Drop the "Summary" from the main header, and instead just go straight to the description 2017-03-23 09:29:50 +01:00
mvp76
03a8151875 Added OverscrollLinearLayoutManager to fix scrolling in AppDetails2 2017-03-23 09:29:50 +01:00
Peter Serwylo
343e91280a Merge branch 'new-ui--main-screens--v3' into 'master'
Updates tab + misc UI improvements.

Closes #840, #876, #838, and #892

See merge request !444
2017-03-22 00:20:44 +00:00