Daniel Martí 30334c3714 Merge branch 'fix-installer-on-gingerbread' into 'master'
Removed `TargetApi` annotation from class, pushing it to methods, and fix API problems.

Fixes #708.

On gingerbread (in my case, 2.3.4) F-Droid will reliably crash whenever it views `AppDetails` with the following error:

```
                         E  java.lang.NoSuchMethodError: android.content.Context.getDrawable
                         E      at org.fdroid.fdroid.privileged.views.AppSecurityPermissions$MyPermissionGroupInfo.loadGroupIcon(AppSecurityPermissions.java:111)
                         E      at org.fdroid.fdroid.privileged.views.AppSecurityPermissions$PermissionItemView.setPermission(AppSecurityPermissions.java:158)
                         E      at org.fdroid.fdroid.privileged.views.AppSecurityPermissions.getPermissionItemView(AppSecurityPermissions.java:396)
                         E      at org.fdroid.fdroid.privileged.views.AppSecurityPermissions.displayPermissions(AppSecurityPermissions.java:370)
                         E      at org.fdroid.fdroid.privileged.views.AppSecurityPermissions.getPermissionsView(AppSecurityPermissions.java:348)
                         E      at org.fdroid.fdroid.AppDetails$AppDetailsSummaryFragment.buildPermissionInfo(AppDetails.java:1381)
                         E      at org.fdroid.fdroid.AppDetails$AppDetailsSummaryFragment.setupView(AppDetails.java:1348)
                         E      at org.fdroid.fdroid.AppDetails$AppDetailsSummaryFragment.onCreateView(AppDetails.java:1095)
                         E      at android.support.v4.app.Fragment.performCreateView(Fragment.java:2074)
                         E      at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1104)
                         E      at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1286)
                         E      at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:758)
                         E      at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1671)
                         E      at android.support.v4.app.Fragment.performStart(Fragment.java:2096)
                         E      at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1142)
                         E      at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1286)
                         E      at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1268)
                         E      at android.support.v4.app.FragmentManagerImpl.dispatchStart(FragmentManager.java:2148)
                         E      at android.support.v4.app.FragmentController.dispatchStart(FragmentController.java:212)
                         E      at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:625)
                         E      at org.fdroid.fdroid.AppDetails.onStart(AppDetails.java:424)
                         E      at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1129)
                         E      at android.app.Activity.performStart(Activity.java:3791)
                         E      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1620)
                         E      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
                         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:864)
                         E      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:622)
                         E      at dalvik.system.NativeStart.main(Native Method)
```

This is because `AppSecurityPermissions` uses a method that was not added until a later API. This class is used by `AppDetails` without an API verison check around its access. Thus, we call methods on this that are unsupported when on gingerbread.

By removing `TargetApi` from the class, it unearthed a couple of locations where methods were being invoked without first guarding against the build version correctly. These two locations have been fixed and a `TargetApi` attached to the more narrowly defined method which requires it.

See merge request !353
2016-07-17 22:28:39 +00:00
2016-07-04 11:31:41 +01:00
2016-04-23 01:16:14 +01:00
2015-09-25 22:00:24 -07:00
2016-04-05 12:44:01 +02:00
2016-03-29 17:45:11 +01:00
2016-06-21 17:02:10 +01:00
2016-02-15 16:30:40 +00:00
2016-02-15 16:30:40 +00:00
2015-08-24 10:35:55 -07:00
2016-06-03 18:02:16 +02:00

F-Droid Client

build status Translation status

Client for F-Droid, the Free Software repository system for Android.

Building with Gradle

./gradlew assembleRelease

Direct download

You can download the application directly from our site or browse it in the repo.

Contributing

See our Contributing doc for information on how to report issues, translate the app into your language or help with development.

IRC

We are on #fdroid and #fdroid-dev on Freenode. We hold weekly dev meetings on #fdroid-dev on Tuesdays at 20h UTC, which usually last half an hour.

FAQ

  • Why does F-Droid require "Unknown Sources" to install apps by default?

Because a regular Android app cannot act as a package manager on its own. To do so, it would require system privileges (see below), similar to what Google Play does.

  • Can I avoid enabling "Unknown Sources" by installing F-Droid as a privileged system app?

This used to be the case, but no longer is. Now the Privileged Extension is the one that should be placed in the system. It can be bundled with a ROM or installed via a zip, or alternatively F-Droid can install it as a system app using root.

License

This program is Free Software: You can use, study share and improve it at your will. Specifically you can redistribute and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

Some icons are made by Picol, Icomoon or Dave Gandy from Flaticon or by Google and are licensed by Creative Commons BY 3.0.

Other icons are from the Material Design Icon set released under an Attribution 4.0 International license.

Description
No description provided
Readme GPL-3.0 46 MiB
Languages
Java 98.5%
Shell 0.6%
Python 0.6%
AIDL 0.2%
HTML 0.1%