178 Commits

Author SHA1 Message Date
Daniel Martí
10009dc1fe Bump to 0.76 2014-10-09 00:43:53 +02:00
Daniel Martí
669a7bc1cf Bump to 0.75 2014-10-03 22:36:23 +02:00
Daniel Martí
4f06d0081e Prepare for 0.74 2014-09-11 23:23:31 +02:00
Daniel Martí
6b12a006fb Prepare 0.73
0.72 had proguard issues and 0.71 had HTTPS issues.
2014-09-08 23:09:51 +02:00
Daniel Martí
59f21c8561 Fix gradle build by bumping plugin version
Also add tools:replace since it's now needed as part of the manifest merger
2014-09-08 08:39:07 +02:00
Daniel Martí
cd0617d0f6 Release 0.72 2014-09-05 21:24:17 +02:00
Daniel Martí
916afe1627 Bump to 0.71 2014-08-05 23:57:37 +02:00
Hans-Christoph Steiner
182aea0f98 support 1 and 2 level nested repos in QR Code URLs
This adds support for QR Code URLs nested in dirs 1 or two levels deep.
This supports things like the Amazon S3 URLs.
2014-07-15 12:28:41 -04:00
Hans-Christoph Steiner
13f52e1b50 change title to "F-Droid" for VIEW Intent receiver chooser
When someone clicks on a URL that F-Droid can accept, i.e. a repo URL, then
Android puts up a chooser where the user can select which app to VIEW the
URL with.  That was showing up with the title "Repositories", which is the
title used for that Activity when viewing it.  This keeps the Activity
title the same while changing the title in the chooser.
2014-07-15 12:28:41 -04:00
Hans-Christoph Steiner
83072bc2c4 rename ManageRepo.java to be with all the rest of the Activity files
This moves it to the org.fdroid.fdroid.views package and names it in the
same style as the Activities in that package.
2014-07-15 12:28:40 -04:00
Daniel Martí
4e52611d36 Prepare for 0.70-test 2014-06-26 13:23:50 +02:00
Peter Serwylo
3050e3dbc5 Migrating activities to appcompat-v7
The only remaining activity is the AppDetails acvitity, which will require
a little more than just making it extend ActionBarActivity. Currently,
it extends ListActivity. To support appcompat-v7, it really should have
two fragments - the details one and the list one. Then, when the orientation
is changed, it should load a different layout with the fragments side by side.

Although Google is encouraging people to make old devices run apps
with the action bar (via appcompat-v7), they haven't provided a way
for people to create preference/setting screens with an action bar.

There are plenty of issues in the Android issue tracker relating
to this, but it doesn't yet seem to be on the radar of the Android
devs.

Until there is a native implementation of PreferenceFragment in
the appcompat-v7 support library, this submodule provides is a 3rd
party solution. It is actually a fork of the first repo in github,
though that was a bit of an upload and dump, without accepting MR's.
This fork includes gradle support.
2014-06-04 23:19:37 -04:00
Peter Serwylo
58ff02a3f4 Build with dependency on support-appcompat-v7.
Thanks to the awesome work of mvdan, this was mostly ready to roll.
However, I had to wrestle for a while for two reasons:

 1) I forgot to add the dependency in the build.gradle file (it was
    already present in settings.gradle)
 2) My IDE was unable to read the ANDROID_HOME env variable, and
    despite my internet-search-fu, I couldn't figure out how to
    make IntelliJ specify env variables for a gradle build. It took
    a while to figure out, because it was failing silently in weird
    ways.

After slaving away on a nice method to parse both the ANDROID_HOME
and the local.properties file (looking for sdk.dir), and then emmiting
nice error messages if neither were found or pointed to an invalid
location, I discovered it had already be done:

android.plugin.sdkDirectory ends up here:

https://android.googlesource.com/platform/tools/build/+/master/gradle/src/main/groovy/com/android/build/gradle/internal/Sdk.groovy#161

Which does exactly all that and more. So now sdkLoc is initialized to
the value of android.plugin.sdkDirectory.
2014-06-03 08:11:59 +09:30
Daniel Martí
728d1467b9 Prepare for 0.69-test 2014-06-01 18:38:04 +02:00
Hans-Christoph Steiner
146046a1ff add description of app to manifest for p2p users
The local repo generation code will take the description from the manifest
and include it in the repo meta data.  So FDroid itself should also include
this description.  Indeed every app should... perhaps this should also be
an `fdroid lint` item.
2014-05-20 18:44:47 -04:00
Hans-Christoph Steiner
30ecc1c9f6 use MulticastLock for better Bonjour/mDNS performance
Multicast transmission is subject to heavy power management on Android,
because it apparently can be a battery drain.  mDNS/Bonjour is based
entirely on multicast, so in order to have good Bonjour performance, there
needs to be good multicast performance.  MulticastLock provides that.

fixes #3381 https://dev.guardianproject.info/issues/3381
2014-05-20 18:44:47 -04:00
Daniel Martí
b3107eb6b2 Fix gradle support while keeping ant support
Most of this was done by pserwylo on his branch feature/gradle. The only thing
left is merging the fixes into nanohttpd.
2014-05-18 12:55:30 +02:00
Daniel Martí
4f51970250 Prepare for 0.68-test 2014-05-12 19:17:35 +02:00
Dominik Schürmann
1491f7318f Merge branch 'master' into super-fdroid 2014-05-12 13:01:53 +02:00
Daniel Martí
e82690f324 Do not make the Local Repo activity a launcher icon 2014-05-11 10:45:34 +02:00
Dominik Schürmann
919f9c63b8 Merge master into super-fdroid 2014-05-11 00:38:53 +02:00
Daniel Martí
6a4b323d06 Prepare for 0.67-test 2014-05-08 13:23:20 +02:00
Hans-Christoph Steiner
08346b9b18 add Activity to choose which installed apps are in the local repo
This gets the data about which apps are installed from the ContentProvider
that pserwylo recently added for data about "Installed Apps" and presents
a list view for the user to select from by touching each line.  Then if the
user chooses "Update Repo", it will regenerate the local repo based on the
current selection.  It will always include FDroid in the local repo.

fixes #3232 https://dev.guardianproject.info/issues/3232
refs #3204 https://dev.guardianproject.info/issues/3204
2014-05-06 19:51:15 -04:00
Hans-Christoph Steiner
94dc2d019f add wizard for sending FDroid to another device via WiFi/QR
This is a little helper to direct people to get a new device to download
FDroid from another device that already has it.  It first prompts them to
join the same wifi network, and offers a QR Code to associate to the same
wifi.  The next step is a QR Code for getting the URL to the local repo.
The index.html on that local repo includes a download link for FDroid and
a repo link to the local repo.

refs #3204 https://dev.guardianproject.info/issues/3204
2014-05-06 19:51:15 -04:00
Hans-Christoph Steiner
5050605f72 Activity/Service for running a local repo via http://
This is a skeleton for the upcoming local repo (aka swap aka Kerplapp).
Right now, it just provides an Activity for controlling a Service which
manages a local webserver (nanohttpd).  Next, it will be wired up to the
local repo created via a dedicated Activity for managing the list of apps
included in the local repo.

refs #3204 https://dev.guardianproject.info/issues/3204
2014-05-06 19:28:27 -04:00
Hans-Christoph Steiner
2c2d8c868c monitor Wifi changes with BroadcastReceiver/Service
The local repo will need to both have current wifi settings in order to
send the correct IP address, SSID, etc.  Also, this could be used to handle
interrupted downloads and updates, but that is not included in this commit.

refs #3204 https://dev.guardianproject.info/issues/3204
2014-05-06 11:55:52 -04:00
Daniel Martí
c288fd5534 Prepare for 0.66 release 2014-05-01 19:25:07 +02:00
Daniel Martí
7a16bf4ce5 Fix broadcast receiving of package updates
* It is PACKAGE_REPLACED, not PACKAGE_CHANGED:
  http://developer.android.com/reference/android/content/Intent.html#ACTION_PACKAGE_CHANGED

* REMOVED and then ADDED are fired as well as REPLACED when upgrading an
  application:
  http://stackoverflow.com/questions/5217237/package-removed-then-package-added-are-fired-along-with-package-replaced-inten
2014-04-29 18:18:38 +02:00
Daniel Martí
55acd955b9 Prepare for 0.65 release 2014-04-29 11:55:29 +02:00
Dominik Schürmann
8f08289822 AndroidManifest: Add superuser permission, cleanup 2014-04-26 13:43:51 +02:00
Dominik Schürmann
7451f00534 Refactoring old code using an abstract class 2014-04-26 02:01:26 +02:00
Daniel Martí
1f154adf42 Merge branch 'master' into super-fdroid
Conflicts:
	AndroidManifest.xml
	lint.xml
	src/org/fdroid/fdroid/AppDetails.java
2014-04-25 20:20:43 +02:00
Hans-Christoph Steiner
52e0f373af stay in FDroid after adding a new repo via Intent
If a new repo comes in via Intent, like from clicking a link, scanning a QR
Code, etc., then stay in FDroid once the add dialog is complete.
Previously, it would sometimes stay in FDroid and sometimes go back to the
sending Activity, depending on the sending Activity.  It was confusing and
annoying behavior.
2014-04-22 10:29:09 -04:00
Daniel Martí
4b3b392c01 Prepare for 0.64-test 2014-04-20 14:32:05 +02:00
Peter Serwylo
4e24050760 Adding our own cache of currently installed apks in the database.
Previously the data was not stored anywhere, and each time we wanted
to know about all installed apps, we built a ridiculously long SQL
query. The query had essentially one "OR" clause for each installed
app. To make matters worse, it also required one parameter for each
of these, so we could bind the installed app name to a "?" in the query.
SQL has a limit of (usually) 999 parameters which can be provided to
a query, which meant it would fall over if the user had more than
1000 apps installed.

This change introduces a new table called "fdroid_installedApps".
It is initialized on first run, by iterating over the installed apps
as given by the PackageManager. It is subsequenty kept up to date
by a set of BroadcastReceivers, which listen for apps being
uninstalled/installed/upgraded.

It also includes tests to verify that queries of installed apps,
when there are more than 1000 apps installed, don't break.

Finally, tests are also now able to to insert into providers other
than the one under test. This is due to the fact that the providers
often join onto tables managed by other providers.
2014-04-20 16:50:22 +09:30
Hans-Christoph Steiner
407e7662e9 support QR scanners that do not respect custom URI schemes
Some QR Code scanners don't respect custom schemes like fdroidrepo://, so
this is a workaround, since the local repo URI is all uppercase in the QR
Code for sending the local repo to another device.  This way, the QR Code
can still be all uppercase and use HTTP:// and Android will still route it
to FDroid, but via the Just Once/Always chooser (fdroidrepo:// goes
directly to FDroid with no prompt, when it works)
2014-04-07 21:07:01 -04:00
Daniel Martí
b731ab57b3 Release 0.63 2014-04-07 15:46:33 +02:00
Daniel Martí
44312bdb6c Bump version to 0.62 2014-04-01 14:40:27 +02:00
Daniel Martí
955087d523 Relese 0.61-test 2014-03-19 13:39:20 +01:00
Daniel Martí
d647bfb097 Release 0.60-test 2014-02-28 00:37:34 +01:00
Daniel Martí
66563d30d9 First attempt at supporting RTL
Following the Android 4.2 changes, which explain how to add native support for
RTL, I've replaced Right for End and Left for Start. Enabling RTL to see the
results.
2014-02-21 00:11:58 +01:00
Daniel Martí
901545d404 Don't recreate main activity when returning to it
Huge improvements! Amongst them:
* Pressing Up is just as fast as pressing Back
* Like Back, it keeps the scroll position and everything
* Now FDroid behaves like the other activities that an user may navigate up to
2014-02-15 11:49:29 +01:00
Hans-Christoph Steiner
c0cd0d33bf send the FDroid.apk via bluetooth on devices that support it
This is another easy method to send FDroid to a device that doesn't have it
yet.  Unfortunately, stock Android blocks the receiving of APKs, but many
ROMs and even some Samsung devices do not have this block.

You can find the lengthy backstory on this work here:
https://dev.guardianproject.info/issues/2084
2014-02-14 22:45:48 -05:00
Hans-Christoph Steiner
0c06b67f3d do not require WiFi in a device, any internet access will work
Setting android.permission.ACCESS_WIFI_STATE automatically sets up
uses-feature to require wifi.  Therefore, we have to manually say that
wifi is not actually required.
2014-02-14 22:45:48 -05:00
Hans-Christoph Steiner
4489037619 NFC beam the repo in RepoDetailsActivity
This is the framework for easily swapping repos.  The idea is that a user
can send the URL with the fingerprint for trusted bootstrapping of the repo
on a new user's device.  This will be essential for p2p repos provided
by Bazaar/Kerplapp.

The required NFC APIs were introduced in android-14. So android-14 and below
skip the NFC stuff.
2014-02-12 21:19:19 -05:00
Peter Serwylo
da8e41249b Removed DB, implemented AppProvider.
Yay!

As expected, a lot of the stuff in DB class is due to UpdateService
requiring it to process the downloaded indexes and insert data into
the database. Thus, this change is about removing that stuff from
the DB class and migrating to ContentProviders.

This required a bit of a change to the way that UpdateService decides
what to do with the data from indexes, but I hope it will make
understanding and changing UpdateService easier in the long term.
For example, it used to read the app details from database, then
if a repo wasn't updated (due to unchanged index) then it would take
the app details for that repo from the list of apps, and re-update
the database (or something like that).

Now, it has been refactored into the following methods:
 * updateOrInsertApps(appsToUpdate);
 * updateOrInsertApks(apksToUpdate);
 * removeApksFromRepos(disabledRepos);
 * removeApksNoLongerInRepo(appsToUpdate, updatedRepos);
 * removeAppsWithoutApks();
 * and probably some others...
Which hopefully are self-explanitory.

The recent change to implement single repo updates was re-implemented
with in light of the methods above. The interface to UpdateService for
scheduling a single repo update is the same as it was before, but
the implementation is completely different. Still works though.

Using batch content provider operations for repo updates,
but they suffer from the problem of not all being under the same
transaction, so if an insert/update stuffs up half way through, we
are left with only half of the update being complete. In the future,
if there is some way to implement notifications from the content provider's
applyBatch method, then we can do it all in the one transaction, and
still have notifications. Currently we break it into several calls
to applyBatch (and hence several transactions) to inform the user
of the progress.

Also adding the beginnings of some tests for AppProvider. In the future, I'll
work on adding better coverage, including instrumentation to test UI features.

==========================
Below is a list of many of the minor changes that also happened along the way
==========================

Make "Can update" tab stay up to date using content observer, rather
than manually deciding when to refresh the tab label as before.

The installed app list is now cached in Utils, because it is invoked
quite a few times, especially when rendering the app lists. The cache is
invalidated when PackageReceiver is notified of new apps.

The content providers don't notify changes if we are in batch mode.
I've left the notification at the end of the batch updates as the
responsibility of the UpdateService. However, it would be nice if this
was somehow handled by the content, as they are really the ones who
should worry about it.

Made curVersion, curVercode and curApk work with providers.
This was done by removing curApk (otherwise we'd need to query the db each
time we fetched one app to get a reference to that apk (resulting in hundreds
of queries). Instead, UpdateService now calculates curVercode and curVersion
and saves them to the database. We then use these where possible. If we really
need curApk (because we want info other than its version and code) we still have
the option of ApkProvider.Helper.find(app.id, app.curVercode). I considered
putting this inside the app value object, e.g. in getCurApk() but thought
better of it as it will likely result in people invoking it all the time,
without realising it causes a DB query.

incompatibleReasons required a minor UI tweak, removing the "min sdk"
ui element from the Apk list. It is replaced by the "Requires: %s" view
(which only appears when the app is incompatible). In the process, and in
response to some feedback from mvdan, I left the min sdk in there, but
only made it show when in "expert mode", just like the architecture.

In order to make the "installed apps" query work under test conditions,
needed to change the way the InstalledApkCache be replaceable with a
mock object.

Pause UIL loading on fast scroll of list, as the list was very choppy for
some reason.

Re-added "Last repo scan" info to the Manage Repo list view.

Fixed up some misc TODO's, removed some unused/empty functions.
2014-02-08 11:29:59 +11:00
Peter Serwylo
b3773a1561 Refactoring Apk references into content provider.
Removed DB.Apk in favour of stand-alone Apk class.

Conflicts:
	src/org/fdroid/fdroid/DB.java
2014-02-01 21:40:15 +11:00
Daniel Martí
2a8c570a00 Release 0.59-test 2014-01-29 23:45:42 +01:00
Hans-Christoph Steiner
7c67db22f3 reformat repo URIs to allow wifi, fingerprint, etc. in query string
Instead of ramming the fingerprint in the user field of the URI, use the
query string.  Having the fingerprint in the user field was confusing some
browsers because it was trying to log in.  The query string is the standard
place for such meta data, and has lots of room for expansion including
things like wifi network names. This will be useful later to determine if
both devices are currently on the same wifi network, and if they are local
repos, they should try syncing.
2014-01-28 20:31:46 -05:00
Hans-Christoph Steiner
126d96e4ba prevent soft keyboard from popping up on RepoDetails
Its quite annoying to have the URI EditText in focus and the soft keyboard
pop up when viewing the RepoDetails since the vast majority of the time,
the user will be viewing the info there, not editing the URL.

This commit just moves the focus to the frame, and prevents the soft
keyboard from showing up by default.  The user can still click on the URI
EditText to edit it and the soft keyboard will pop up.
2014-01-28 20:31:46 -05:00