Previously, anything added via the Add New Repository dialog would just
overwrite any existing repo config that was there. This has become a
bigger issue with the QR Code scanning since it could become an attack
vector. This is the first step towards making this Add Repo dialog give
more info to the user about the state of things, and what the user might
replace by clicking OK.
This patch makes F-Droid register with Android that it accepts the URI
schemes of fdroidrepo (HTTP) and fdroidrepos(HTTPS). When F-Droid receives
one of these URIs, it launches the ManageRepo Activity and then launches
the New Repository dialog.
refs #2454
This allows us to add new ones without making a mess in the client.
Prior to this change it would add empty lines, and also if the only
antifeature was an unrecognised one, would enable the antifeature view
box but with nothing in it. It should now ignore them completely.
finish() may be called from reset() which sets app to null. This issues
hits for example when clicking on wiki-link of an app which doesn't
currenty exist in client index, throws:
E/AndroidRuntime(17630): java.lang.RuntimeException: Unable to start activity ComponentInfo{org.fdroid.fdroid/org.fdroid.fdroid.AppDetails}: java.lang.NullPointerException
E/AndroidRuntime(17630): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1651)
E/AndroidRuntime(17630): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667)
E/AndroidRuntime(17630): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
E/AndroidRuntime(17630): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)
E/AndroidRuntime(17630): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(17630): at android.os.Looper.loop(Looper.java:130)
E/AndroidRuntime(17630): at android.app.ActivityThread.main(ActivityThread.java:3691)
E/AndroidRuntime(17630): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(17630): at java.lang.reflect.Method.invoke(Method.java:507)
E/AndroidRuntime(17630): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:907)
E/AndroidRuntime(17630): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:665)
E/AndroidRuntime(17630): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime(17630): Caused by: java.lang.NullPointerException
E/AndroidRuntime(17630): at org.fdroid.fdroid.AppDetails.finish(AppDetails.java:1012)
E/AndroidRuntime(17630): at org.fdroid.fdroid.AppDetails.reset(AppDetails.java:353)
E/AndroidRuntime(17630): at org.fdroid.fdroid.AppDetails.onCreate(AppDetails.java:243)
E/AndroidRuntime(17630): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
E/AndroidRuntime(17630): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1615)
Rather large rewrite, basically doing:
* Always show incompatible apps
* Don't fetch incompatible apks if the new setting is off
* Start using result codes when returning from PreferencesActivity