1552 Commits

Author SHA1 Message Date
Peter Serwylo
bcb47c9490 Update the "next" button label correctly during swap workflow.
Instead of always showing "swap", sometimes it shouldn't be shown
at all (i.e. on the first and last screen) and on the NFC screen,
it says "skip".

There is a translated string called "skip_button_label" available
in the AndroidPreferenceFragment library, but I don't want to rely
on that. Prefer to have our awesome translators be in charge of
that label.
2014-10-22 18:01:24 +10:30
Peter Serwylo
6d006e70b3 Always attempt to push swap repo via NFC.
Previously, swap would only enable this if the user hadn't previously
said "Don't show NFC message again". However, we really want people
to be able to swap regardless of whether the actual UI message is shown
or not.

Refactored NfcBeamManager to NfcHelper, to allow extra utility methods
to live there. Specifically, the process of sending a URI over NFC.

Removed some superfluous debugging calls to Log.i().
2014-10-22 18:01:24 +10:30
Peter Serwylo
6b27568ac4 Correct theme applied to swappable apps list.
Took a while to figure out, but the problem was that the support
libraries ListFragment would only ever use getActivity() when
creating widgets. What we really needed was the ability to use
an alternative context, namely a ContextThemeWrapper. If this is
passed to the constructor of a widget, it is themed appropriately.

To make it work, we now create our own list view in onCreateView()
(which is really a copy of the code from the android list_content.xml
file anyway). There are also some workarounds for a bug in the
support library with regards to using your own view.
2014-10-22 18:01:24 +10:30
Peter Serwylo
3eee4f115a Make "Open QR scanner" button work for swap connect screen.
I did the same as some previous code which copied code from the zxing
library and put it in the com.google.zxing namespace (but left the license
in tact - is this okay for Apache 2.0 stuff?). The reason was that they
encourage copying the relevant two files into your project and modifying
as neccesary. In this case, it wasn't about modifying for functionalities
sake, but rather for android support libraries sake. The upstream version
doesn't support android.support.v4.app.Fragments, only android.app.Fragments.

Hooking up the intent integrator from zxing almost removes the need for
the refactoring which made FDroid.java responsible for handling "new repo"
intents. However, there is still the one case of the user not using
the QR code, but rather a web browser to connect to a swap. That is, they
will click a link on the other phones web browser, which directs them to
initiate the swap. Thus, we still need FDroid.java to be able to distinguish
between a "swap" new repo request, and a regular "add repo" new repo request.

In the process, I also commented out the "It's not working" button.
2014-10-22 18:01:24 +10:30
Peter Serwylo
b841c4b4c9 Remove public/private/hotspot icons (Fixes issue #9)
These have been temoprarily moved to an unused layout. The reason
it wasn't removed completely was because the layout still adheres
to the spec from carrie (and I couldn't be bothered looking through
the git history to find it later on when it is time to re-implement
it :)

I've also commented out the "Learn more about wifi" and "use
bluetooth instead" buttons for now.
2014-10-22 18:01:24 +10:30
Peter Serwylo
80205e94fb Implemented client connection for swap.
Listen for a new intent, show a screen to the user mentioning
they are about to start a swap. Make FDroid receive repo intents,
then dispatch to relevant Activity.

Previously manage repo always got the intents. Now FDroid does, and
chooses whether to give to ManageRepos or Client connect.
Not sure if it is required to do it this way or not, but it seems to
work.

I had a bit of an issue getting the "Welcome to F-Droid" string to
fit on one line, because it was breaking on the hyphen. That is still
not resolved in this commit.

Still need to:
 * Show error messages instead of the "connect" description
 * Jar signing seems not to work when connecting to other repo.

In order to handle returning to F-Droid after connecting (or saying no)
I tagged the intent with a "handled" extra value. That way, I can ignore
trying to connect to a repo if we've already handled that event.

Finally, I also fixed an issue regarding downloading of signed
index.jar files with an uppercase fingerprint.
The fingerprint from the jar differed from that in the swap url,
in that one was upper case and the other was lower case.
This uses an .equalsIgnoreCase check instead. It also adds an
extra guard in case the repo doesn't have a fingerprint. Although
it may not even use the signed repo updater if both the pubkey
and fingerprint are null, it is nice to have the extra assurance.

Fixes issue #19.

I also left some more TODO's around. I should put them in issues,
but I'm in a bit of a hurry.
2014-10-22 18:01:24 +10:30
Peter Serwylo
2a22a8b6cb Move "Start local repo" to the SwapActivity, rather than WifiQrFragment.
By starting the repo in the activity, both the NFC and wifi fragments
have access to it. In the future, it will make it easier to move some
of the static stuff from FDroidApp (to do with "selected apps") into
the SwapActivity, as it will not really be needed anywhere else.
2014-10-22 18:01:24 +10:30
Peter Serwylo
e84e9c15e2 Support "back" button navigation during swap process. Start service at end of swap.
The back button will take you back through each step of the swap
process now, and remove the swap Activity completely if you press
back from the first screen. Also, when the WiFi QR code is shown,
the local repo manager actually starts the relevant service.
2014-10-22 18:01:24 +10:30
Peter Serwylo
87b82a6751 Bring the swap website (hosted on the phone) in line with new designs.
The website now also has icons which it needs to worry about copying
across to the webroot, so I refactored the "symlink webroot to other
folders - such as /fdroid and /fdroid/repo".
2014-10-22 18:01:24 +10:30
Peter Serwylo
6d807793c2 Moved code from LocalRepo to the Swap UI to reuse it.
Along with a bunch of networking stuff, a lot of UI to do with selecting
apps to swap was also moved. The background on the list is transparent,
which allows blue to shine through. Also, the text on the list items is
white, which will not work with a white background.

I've temporarily dropped support for searching this list too, until
I get some feedback from carrie et al.

NOTE: This stuff was written before hans fixed apcompat problems with
LocalRepoActivity, but then rebased over it later. As such, it doesn't
contain his fixes. Will need to do that before a stable release. i.e.
Still has a bit of a dependency on API 11 which needs to be resolved.
2014-10-22 18:01:24 +10:30
Peter Serwylo
ae9cb5b89b Beginnings of an implementation for Swap.
The Fragments and an Activity which tie all of the swap views together
has begun. The first bit of implementation is to get the current
wifi network displayed, which worked out alright.

This commit contains a lot of theme related stuff, particularly
involving taking assets from carries mockups and making them suitable
to use as drawables. The process for doing this is a story for another
day, but I'll document it and put it on the wiki in the future. carrie
showed me a script that a mate of hers used on another project, and
I've adapted it a little to make it work nicely here (note - it isn't
in this commit).

The button is blue, and always shown with associated text in the
ActionBar. This required a custom drawable which was set as the
background in the styles.xml.
2014-10-22 18:01:24 +10:30
Daniel Martí
b14bffa1c5 Replace a few tabs by space indents 2014-10-16 17:18:08 +02:00
Daniel Martí
2fd8982485 Fix some formatting across the java code
A good reference is:
https://google-styleguide.googlecode.com/svn/trunk/javaguide.html

Unfortunately, since there is no checkstyle file for it, we can't check for it
programmatically.
2014-10-16 17:15:47 +02:00
Daniel Martí
93c9abb887 Use interface types where possible 2014-10-16 16:55:07 +02:00
Daniel Martí
10009dc1fe Bump to 0.76 0.76 2014-10-09 00:43:53 +02:00
Peter Serwylo
4ba45ba66f Merge branch 'stable-fixes' into 'master'
fix crasher bug in 0.75

    fix divide-by-zero crash when a repo has less than 25 apps in it

    This was introduced in e4401ed22c0f65db5d4f1a1f0e1222b061e471af

See merge request !39
2014-10-07 21:27:40 +00:00
Hans-Christoph Steiner
0a10e44778 don't check incoming repo URI is on same wifi if device does not have wifi
Fixes this crash:
              dalvikvm  W  threadid=1: thread exiting with uncaught exception (group=0xb68df4f0)
        AndroidRuntime  E  FATAL EXCEPTION: main
                        E  java.lang.RuntimeException: Unable to resume activity {org.fdroid.fdroid/org.fdroid.fdroid.views.ManageReposActivity}: java.lang.NullPointerException
                        E      at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2120)
                        E      at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2135)
                        E      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1668)
                        E      at android.app.ActivityThread.access$1500(ActivityThread.java:117)
                        E      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
                        E      at android.os.Handler.dispatchMessage(Handler.java:99)
                        E      at android.os.Looper.loop(Looper.java:130)
                        E      at android.app.ActivityThread.main(ActivityThread.java:3683)
                        E      at java.lang.reflect.Method.invokeNative(Native Method)
                        E      at java.lang.reflect.Method.invoke(Method.java:507)
                        E      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
                        E      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
                        E      at dalvik.system.NativeStart.main(Native Method)
                        E  Caused by: java.lang.NullPointerException
                        E      at org.fdroid.fdroid.views.ManageReposActivity.checkIfNewRepoOnSameWifi(ManageReposActivity.java:466)
                        E      at org.fdroid.fdroid.views.ManageReposActivity.addRepoFromIntent(ManageReposActivity.java:455)
                        E      at org.fdroid.fdroid.views.ManageReposActivity.onResume(ManageReposActivity.java:144)
                        E      at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1150)
                        E      at android.app.Activity.performResume(Activity.java:3832)
                        E      at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2110)
                        E      ... 12 more
2014-10-07 17:03:06 -04:00
Hans-Christoph Steiner
47d6bb095b fix divide-by-zero crash when a repo has less than 25 apps in it
This was introduced in e4401ed22c0f65db5d4f1a1f0e1222b061e471af
2014-10-07 16:47:28 -04:00
Peter Serwylo
cf03ad3edb Merge branch 'master' into 'master'
README: more on installation and troubleshooting

android SDK commands to compare locally installed targets with git fetched libraries and additional code snippets to install missing targets.

See merge request !38
2014-10-04 05:56:34 +00:00
Daniel Martí
669a7bc1cf Bump to 0.75 0.75 2014-10-03 22:36:23 +02:00
Daniel Martí
acd61b7a68 Completely disable proguard 2014-10-03 22:31:01 +02:00
Anatoly Pugachev
8f1d4d3b6f troubleshooting, more on android targets and installation 2014-10-01 22:11:54 +04:00
Peter Serwylo
b655b54890 Merge branch 'master' into 'master'
updated README

minor README edit for a newbies (as like me)

See merge request !37
2014-09-30 13:34:42 +00:00
Anatoly Pugachev
09fc1c5545 added sdk CLI for a target platform and SDK URL 2014-09-30 16:08:43 +04:00
Daniel Martí
fdb710dfd1 Merge branch 'master' into 'master'
do not run proguard in `ant debug` builds, it breaks the tests

The whole Android ant build system was built around the assumption that proguard is only run on the release builds.  Running proguard on the debug builds breaks the test instrumentation, which does something like insert the emma methods into each class.  In theory, this could be fixed, but I think its a bad idea to heavily customize the ant build system since its basically deprecated in favor of gradle.

Here's the proguard warning message:
`[proguard] Warning: can't find referenced class com.vladium.emma.rt.RT`

Instead, there is probably a way to test the release build. For example, in the Jenkins build, I added `ant clean release`, then it installs the APK, and runs the "monkey tester" on it.

See merge request !36
2014-09-23 08:00:53 +00:00
Peter Serwylo
e4401ed22c Don't show progress for every app being processed from index.xml.
Rather, only show 25 progress events. I went with "25 events" rather
than "every X apps" because then it will be nice for both large repos
(e.g. F-Droid will update every ~50 apps) and small repos (something
with 20 apps will update for every one, but not add much overhead).

On my testing with an API 11 emulator here, it went from ~32s to
process ~1100 apps to ~20s. When no progress events are sent, then it
also takes ~20s, so this essentially is a 50% improvement for this part
of the update process.
2014-09-18 14:01:20 +10:00
Hans-Christoph Steiner
c330362cf0 do not run proguard in ant debug builds, it breaks the tests
The whole ant build system was built around the assumption that proguard is
only run on the release builds.  Running proguard on the debug builds
breaks the test instrumentation, which does something like insert the emma
methods into each class.  In theory, this could be fixed, but I think its a
bad idea to heavily customize the ant build system since its basically
deprecated in favor of gradle.

Here's the proguard warning message:
 [proguard] Warning: can't find referenced class com.vladium.emma.rt.RT
2014-09-16 18:58:01 -04:00
Daniel Martí
481cd91646 Fix installer warning logs logic 2014-09-15 10:59:54 +02:00
Daniel Martí
4f06d0081e Prepare for 0.74 0.74 2014-09-11 23:23:31 +02:00
Peter Serwylo
69fd955360 Merge branch 'master' into 'master'
Save updated repo data at the end of the update

This fixes #84.

See merge request !34
2014-09-11 03:51:24 +00:00
Ron Rieve
692a25abcb Save new repo data at end of update
Saves the new data for the repo at the end of the update process to enable the user to re-trigger the update in case the update exited prematurely.
Fixes #84.
2014-09-11 05:27:06 +02:00
Peter Serwylo
c7145a63cb Prevent android.support.v7.SearchView from being excluded by proguard.
There is a bug where the android.support.widget.SearchView gets
removed by proguard which causes breakage. This prevents that
from occuring by a bit of a brute force approach. While it would
be possible to keep only the class in question, this may leave
us open to other bugs in the future. Better to be safe than sorry.

http://stackoverflow.com/questions/22136032/action-bar-search-view-android-null-error
2014-09-11 10:55:24 +09:30
Hans-Christoph Steiner
008752ae74 fix stupid crasher bug introduced in 4f7f87be0a0487aad19c78a2a44faa1c2f008361 2014-09-10 18:02:46 -04:00
Daniel Martí
6b12a006fb Prepare 0.73
0.72 had proguard issues and 0.71 had HTTPS issues.
0.73
2014-09-08 23:09:51 +02:00
Daniel Martí
ea6482b94b Merge branch 'master' of https://gitlab.com/rrieve/fdroidclient 2014-09-08 08:44:29 +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í
9959becc09 Run proguard on debug builds to avoid future debug vs release issues 2014-09-08 08:25:47 +02:00
Ron Rieve
04f7b4a5a9 Toast if there are no updates
When the user updates the repo and all packages are recent, the update dialog exited so fast, that some users might have thought that the repo didn't update. To notify them that no new updates were found, the user now gets a toast.
2014-09-08 00:43:52 +02:00
Daniel Martí
36ee32d82c Remove all string-array translations missing items 2014-09-07 20:41:11 +02:00
Daniel Martí
db21ad2d3c Merge branch 'master' of https://gitlab.com/rrieve/fdroidclient 2014-09-07 19:00:35 +02:00
Ron Rieve
3a3a480429 Ask proguard to keep SystemInstaller observers
Proguard removed the method org.fdroid.fdroid.installer.SystemInstaller$PackageInstallObserver$packageInstalled,
resulting in an AbstractMethodError crash.
Fixes issue [79](https://gitlab.com/fdroid/fdroidclient/issues/79).
2014-09-07 18:49:03 +02:00
Daniel Martí
71e11027d0 Merge branch 'feature/proguard-keep-spongycastle' of https://gitlab.com/pserwylo/fdroidclient 2014-09-07 17:25:07 +02:00
Peter Serwylo
785dd036d1 Include all spongycastle classes when running proguard.
This increases the size of the .apk by ~800kb, which is clearly
undesirable. However, the nature of the Java security suite
implementations are that they use a lot of reflection to instantiate
classes. The end result is that proguard excludes classes which
may be required, depending on the security algorithms required
by certain certificates.

Fixes issue #88
2014-09-08 00:36:02 +09:30
Daniel Martí
cd0617d0f6 Release 0.72 0.72 2014-09-05 21:24:17 +02:00
Daniel Martí
f60f2c160a Run fix-ellipsis.sh 2014-09-05 21:20:20 +02:00
Daniel Martí
78ed3cee96 Fix values dir name 2014-09-05 21:19:54 +02:00
F-Droid Translatebot
9384466c29 Translation updates 2014-09-05 19:31:27 +01:00
Daniel Martí
c2350cbb73 Prepare changelog for 0.72 2014-09-05 16:35:12 +02:00
Peter Serwylo
d8653d8345 Merge branch 'master' into 'master'
revert to plain CA-based HTTPS verification

This is to address #80 so we can get a stable release out.  Then we should revisit #80 and actually get the pinning and TOFU working properly.

See merge request !30
2014-09-05 11:59:14 +00:00
Hans-Christoph Steiner
0429b3f7dd remove HTTPS pinning and TOFU until the bugs get worked out
This reverts to only using standard HTTPS verification based on Certificate
Authorities.  This means that self-signed certificates will not work at all
since that is what MemorizingTrustManager was providing.  It seems to me
that this was originally working because MemorizingTrustManager was not
correctly validating.  I couldn't figure out why PinningTrustManager alone
was not working. But we need to get good stable release out!

I'm leaving all the plumbing in place because this stuff should be included
once its all fixed and working properly.  You can see where it was added
here: 254327f9a7700c8196e61f53801f1f12ac825806

refs #80 https://gitlab.com/fdroid/fdroidclient/issues/80
2014-09-05 00:00:37 -04:00