1233 Commits

Author SHA1 Message Date
Hans-Christoph Steiner
94fb0c8a02 prevent crash when clicking on the header in "Repositories" view
Here's the crash dump:

java.lang.NullPointerException
at org.fdroid.fdroid.data.ValueObject.checkCursorPosition(ValueObject.java:13)
at org.fdroid.fdroid.data.Repo.<init>(Repo.java:37)
at org.fdroid.fdroid.views.fragments.RepoListFragment.onListItemClick(RepoListFragment.java:269)
at android.support.v4.app.ListFragment$2.onItemClick(ListFragment.java:58)
at android.widget.AdapterView.performItemClick(AdapterView.java:299)
at android.widget.AbsListView.performItemClick(AbsListView.java:1113)
at android.widget.AbsListView$PerformClick.run(AbsListView.java:2904)
at android.widget.AbsListView$3.run(AbsListView.java:3638)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method)
2014-02-20 08:58:58 +11:00
Peter Serwylo
4d5fd98ae5 Fixed two NPE.
Categories can technically be null, so need to guard for that
when getting them from the ContentProvider. This occurred because
I had an old index from before the change from "category" to
"categories", so it indeed was null.

The other one was from when I added a new repo without a fingerprint.
The fingerprint gets changed to upper case, but if null, causes
a NPE.
2014-02-20 08:55:44 +11:00
Daniel McCarney
3223e20e33 Add support for Network Service Discovery of FDroid repos.
If the device supports API level 16 (Android 4.1) then add a menu item
on the repository management screen to "Find Local Repos". Activating
this menu item will initiate NSD service discovery with the NsdHelper
class looking for 'fdroidrepo' and 'fdroidrepos' service types on the
local network. When one is found, the service is resolved and the name
& IP are populated into a list of discovered repositories. Clicking an
NSD discovered repo will prompt the user to add the repo.
2014-02-19 15:32:44 -05:00
Daniel Martí
8bb0e58e6c Update changelog and todo 2014-02-19 18:23:31 +01:00
Daniel Martí
e6ec5ee242 Add support for filtering apk compatibility by maxSdkVersion
For now it's enforced like minSdkVersion. It is possible to try and install
incompatible apks by enabling "Incompatible Versions" and agreeing to the
warning shown when clicking on such a version.
db-version/40
2014-02-19 18:11:32 +01:00
Daniel Martí
dc1bdc2f3b Make the incompatible reasons textview stand out
In other words, don't disable the view with the others when marking an apk as
incompatible
2014-02-19 18:07:34 +01:00
Hans-Christoph Steiner
a4de616b7a make ApkProvider.Helper take Context rather than ContentResolver
This makes the code a bit neater, and passing the Context around is a
common pattern.

https://dev.guardianproject.info/issues/2926
refs #2926
2014-02-18 19:04:05 -05:00
Hans-Christoph Steiner
ab6166c36d make RepoProvider.Helper take Context rather than ContentResolver
This makes the code a bit neater, and passing the Context around is a
common pattern.

https://dev.guardianproject.info/issues/2926
refs #2926
2014-02-18 19:04:05 -05:00
Hans-Christoph Steiner
a8bf9f7614 point Eclipse to new location for UniversalImageLoader submodule 2014-02-18 19:04:05 -05:00
Hans-Christoph Steiner
09f3e8b004 forgot to include the .project Eclipse file for the test project
Include the reusable Eclipse files (.project and .classpath).
2014-02-18 19:04:05 -05:00
Daniel Martí
334ba0b956 Remove TODO bluetooth item
After discussing it with Hans, the two points that I stated here are not
correct.
2014-02-19 00:22:46 +01:00
Daniel Martí
226003d38d Git automatic indenting fix 2014-02-19 00:19:05 +01:00
Peter Serwylo
5877af55ae Merge branch 'master' into improvements/apk-tests
Conflicts:
	test/src/org/fdroid/fdroid/AppProviderTest.java
2014-02-19 09:38:40 +11:00
Peter Serwylo
a797e43178 Test apk insert more comprehensivly. 2014-02-19 09:32:54 +11:00
Peter Serwylo
4860e06af3 Improved apk tests (test deleting). 2014-02-19 08:12:21 +11:00
Daniel Martí
4b4ee4b6db Update MTM module, now supports gradle 2014-02-18 11:26:15 +01:00
Peter Serwylo
68a719f48a Don't overwrite "ignore updates" settings on update.
For now, the UpdateService ignores these fields when updating from
the index. There is no time that the index should specify what
versions to be ignored.

In the future, this will be done with a join table that stores
info about what to ignore. Another future improvement should also be
to make "App.toContentValues()" smarter. That is, make it only return
values which have been set since the object was created. However this
will add an overhead which may or may not be noticable.
2014-02-18 08:11:02 +11:00
Peter Serwylo
85f3232de0 Started implementing ApkProvider tests.
Refactored a couple of common things from AppProviderTest to either
FDroidProviderTest (baseclass) or TestUtils (static methods) where
relevant.
2014-02-18 02:52:02 +11:00
Daniel Martí
799be52224 Fix regression: Don't count apps which we don't want to update 2014-02-17 16:09:57 +01:00
Daniel Martí
b222887745 Start TODO to be emptied before the upcoming stable release 2014-02-17 10:42:19 +01:00
Daniel Martí
8473627370 Update changelog with my recent changes 2014-02-17 10:34:28 +01:00
Peter Serwylo
43f8ea0814 Added category tests.
This will be useful when somebody wants to move categories from a comma
separated string in the app table, to a separate table all together.
2014-02-16 21:54:50 +11:00
Daniel Martí
41b5797307 Automatic tab fixing 2014-02-16 02:48:22 +01:00
Daniel Martí
feec3b1c51 Make all the gradle libs use the same latest build-tools version
This makes it completely build from source properly on a standard setup
2014-02-15 12:31:15 +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
Daniel Martí
4e26c77327 Don't crash on startup if NFC is not available 2014-02-15 11:23:30 +01:00
Daniel Martí
6b2b759a16 Whoops, forgot to also change the ant setup 2014-02-15 11:18:58 +01:00
Hans-Christoph Steiner
3a1b814603 fix RO translation's formats, based on lint warning
Inconsistent formatting types for argument #1 in format string
searchres_napps ('%s'): Found both 'd' and 's' (in values/strings.xml)

This lint check ensures the following: (1) If there are multiple
translations of the format string, then all translations use the same type
for the same numbered arguments (2) The usage of the format string in Java
consistent with the format string, meaning that the parameter types passed
to String.format matches those in the format string.

<string name="searchres_napps">Sa gasit o aplicatie potrivita cu %s\'</string>
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2014-02-14 23:17:48 -05:00
Hans-Christoph Steiner
739ecfdea3 commit Eclipse project files to make it easier for others to start
Having the pre-configured Eclipse files in git will make it easier for
other people to work with FDroid in Eclipse, and should not affect anything
else. The key files are .classpath and .project.  The .settings/ folder is
for user-specific settings, so its ignored.
2014-02-14 23:07:49 -05:00
Hans-Christoph Steiner
6d111c6e7d document NFC/Bluetooth send methods in CHANGELOG 2014-02-14 22:45:48 -05: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
Daniel Martí
b709f9e17a Update AndroidPinning 2014-02-14 21:26:04 +01:00
Daniel Martí
1e9c6ccf2e Finally give up on UIL and set up the gradle project ourselves 2014-02-14 12:17:07 +01:00
Daniel Martí
fffae79c24 Add MemorizingTrustManager as gradle library too 2014-02-14 10:51:30 +01:00
Daniel Martí
967174b549 Finally get UIL working as a gradle library
The problem were the dashes in the path 'extern/Universal-Image-Loader'
2014-02-14 10:34:36 +01:00
Daniel Martí
c99cf93c8b Test projects can't have --name it seems 2014-02-14 09:18:21 +01:00
Daniel Martí
cf1519f792 Add eclipse files to gitignore 2014-02-14 09:16:18 +01:00
Daniel Martí
51a02fe40f Update libraries 2014-02-14 09:12:52 +01:00
Daniel Martí
97e3bac98e Bump gradle plugin to 0.8 (gradle 1.10) 2014-02-14 09:10:58 +01:00
Ciaran Gultnieks
f60ce3f56c Merge branch 'merge-requests/61' 2014-02-14 06:30:48 +00:00
Hans-Christoph Steiner
cdad2c66ed add instructions for running the embedded Android Test Project 2014-02-13 23:28:31 -05:00
Hans-Christoph Steiner
9871ad0f01 ant-prepare.sh: also set up test suite, should not affect normal ant builds
This adds the command to update the embedded Android Test Project, so that
it can be run using `cd test/; ant clean emma debug install test`

It also changes -p to --path just to make things a little easier to read.
2014-02-13 21:53:52 -05:00
Hans-Christoph Steiner
113ae202b7 include Eclipse project for the embedded Android Test Project
This should make it easier for some people get started with the tests.
2014-02-13 21:51:29 -05:00
Hans-Christoph Steiner
9c9c0a4819 setup main FDroid screen to NFC Beam the FDroid.apk
This pre-configures a file:// URI that points to the installed location of
the FDroid.apk.  When users put two devices together, and touch the screen
on the device with FDroid on it, it will "beam" over the APK, and prompt
the user to install it.
2014-02-12 21:19:19 -05:00
Hans-Christoph Steiner
ceed2c31d7 prevent crash when using back button after screen rotate
To reproduce the crash:
0. click a fdroidrepo:// URI to bring up the "app repo" dialog
1. rotate the device
2. click back to make the keyboard go away
3. click back to make the dialog go away
4. click back on Manage Repos screen
5. boom!
2014-02-12 21:19:19 -05:00
Hans-Christoph Steiner
ba8de64686 split out RepoListFragment from ManageRepo, Fragments need to be public
Otherwise we get errors like this upon rotation:

"android.support.v4.app.Fragment$InstantiationException: Unable to
instantiate fragment org.fdroid.fdroid.RepoListFragment: make sure class
name exists, is public, and has an empty constructor that is public"
2014-02-12 21:19:19 -05:00
Hans-Christoph Steiner
ea7f82ed1a add menu item to enable NFC to RepoDetails view
It is now possible to beam a repo config via NFC but just selecting the
repo in FDroid, then touching two NFC devices together, and clicking on the
FDroid one.  There is no indication that NFC is off, so this commit adds a
menu item that makes it easy to enable the required NFC settings for
sending a repo to another device via NFC.
2014-02-12 21:19:19 -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
Hans-Christoph Steiner
220b3d1441 ensure repo fingerprints are always stored in all upper case
this makes sure that the repo fingerprints are always going to have the
same case, no matter how they were added.  Repo.fingerprint probably should
be converted to a BigInteger so that the comparison can be numeric rather
than String.  Then when the fingerprint needs to be displayed, it can be
formatted appropriately.
2014-02-12 21:19:19 -05:00