Merge branch 'target-23' into 'master'

Bump target SDK and support libs to 23

Android 6.0 brought some changes that affect F-Droid client:

1. [Apache HTTP client removal](https://developer.android.com/about/versions/marshmallow/android-6.0-changes.html#behavior-apache-http-client)
2. [PackageInfo.REQUESTED_PERMISSION_REQUIRED removal](https://developer.android.com/sdk/api_diff/23/changes/android.content.pm.PackageInfo.html)

Closes #518.

See merge request !214
This commit is contained in:
Daniel Martí 2016-03-01 11:20:28 +00:00
commit e698e1557c
5 changed files with 15 additions and 20 deletions

View File

@ -13,7 +13,7 @@ before_script:
tar -xzf android-sdk.tgz &&
export ANDROID_HOME=$PWD/android-sdk-linux &&
export PATH="$ANDROID_HOME/tools:$PATH" &&
echo y | android -s update sdk --no-ui -a -t platform-tools,tools,build-tools-23.0.2,android-22,extra-android-m2repository &&
echo y | android -s update sdk --no-ui -a -t platform-tools,tools,build-tools-23.0.2,android-23,extra-android-m2repository &&
export PATH="$ANDROID_HOME/platform-tools:$PATH" &&
export PATH="$ANDROID_HOME/build-tools/23.0.2:$PATH" &&
echo y | android -s update sdk --no-ui -a -t android-10

View File

@ -9,9 +9,9 @@ repositories {
dependencies {
compile project(':privileged-api-lib')
compile 'com.android.support:support-v4:22.2.1'
compile 'com.android.support:appcompat-v7:22.2.1'
compile 'com.android.support:support-annotations:22.2.1'
compile 'com.android.support:support-v4:23.2.0'
compile 'com.android.support:appcompat-v7:23.2.0'
compile 'com.android.support:support-annotations:23.2.0'
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
compile 'com.google.zxing:core:3.2.1'
@ -64,9 +64,9 @@ if (!hasProperty('sourceDeps')) {
// source code don't need to be here.
dependencyVerification {
verify = [
'com.android.support:support-v4:c62f0d025dafa86f423f48df9185b0d89496adbc5f6a9be5a7c394d84cf91423',
'com.android.support:appcompat-v7:4b5ccba8c4557ef04f99aa0a80f8aa7d50f05f926a709010a54afd5c878d3618',
'com.android.support:support-annotations:104f353b53d5dd8d64b2f77eece4b37f6b961de9732eb6b706395e91033ec70a',
'com.android.support:support-v4:992666398b80724a2f95ea3d7bf7c3d94fb810dcba7ae1aa6e38c0d6120d2603',
'com.android.support:appcompat-v7:14ab04eb2e3f302a082b79c308f6283d21909d1feb831a4e117cdacdad70adb7',
'com.android.support:support-annotations:7f21659b084da073b77b6f7fe7ab250c4f23346238d4efdbbbb937e017ae4693',
'com.nostra13.universalimageloader:universal-image-loader:dbd5197ffec3a8317533190870a7c00ff3750dd6a31241448c6a5522d51b65b4',
'com.google.zxing:core:b4d82452e7a6bf6ec2698904b332431717ed8f9a850224f295aec89de80f2259',
'eu.chainfire:libsuperuser:952c5fc82f9c31d31d2b6a7054ee267dac1685fb037a254888c73c48de661eaf',
@ -118,8 +118,9 @@ if (!hasProperty('sourceDeps')) {
}
android {
compileSdkVersion 22
compileSdkVersion 23
buildToolsVersion '23.0.2'
useLibrary 'org.apache.http.legacy'
sourceSets {
main {

View File

@ -429,17 +429,11 @@ public class AppSecurityPermissions {
final int base = pInfo.protectionLevel & PermissionInfo.PROTECTION_MASK_BASE;
final boolean isNormal = base == PermissionInfo.PROTECTION_NORMAL;
final boolean isDangerous = base == PermissionInfo.PROTECTION_DANGEROUS;
final boolean isRequired =
(newReqFlags & PackageInfo.REQUESTED_PERMISSION_REQUIRED) != 0;
final boolean wasGranted =
(existingReqFlags & PackageInfo.REQUESTED_PERMISSION_GRANTED) != 0;
final boolean isGranted =
(newReqFlags & PackageInfo.REQUESTED_PERMISSION_GRANTED) != 0;
// Dangerous and normal permissions are always shown to the user if the permission
// is required, or it was previously granted
if ((isNormal || isDangerous) && (isRequired || wasGranted || isGranted ||
Build.VERSION.SDK_INT < 16)) {
// Dangerous and normal permissions are always shown to the user
if (isNormal || isDangerous) {
return true;
}

View File

@ -10,12 +10,12 @@ dependencies {
}
android {
compileSdkVersion 22
compileSdkVersion 23
buildToolsVersion '23.0.2'
defaultConfig {
minSdkVersion 8
targetSdkVersion 22
targetSdkVersion 23
versionCode 1050
versionName "0.1"
}

View File

@ -1,12 +1,12 @@
apply plugin: 'com.android.library'
android {
compileSdkVersion 22
compileSdkVersion 23
buildToolsVersion '23.0.2'
defaultConfig {
minSdkVersion 8
targetSdkVersion 22
targetSdkVersion 23
versionCode 1
versionName "1.0"
}