diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f6708fa83..a184dd83d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -72,8 +72,8 @@ jobs: - api-level: 21 target: default arch: x86 - - api-level: 33 - target: google_apis # emulator API 33 only exists with Google APIs + - api-level: 35 + target: default arch: x86_64 permissions: diff --git a/app/build.gradle b/app/build.gradle index a629f65eb..2f5f492fb 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -12,14 +12,14 @@ plugins { } android { - compileSdk 34 + compileSdk 36 namespace 'org.schabi.newpipe' defaultConfig { applicationId "org.schabi.newpipe" resValue "string", "app_name", "NewPipe" minSdk 21 - targetSdk 33 + targetSdk 35 if (System.properties.containsKey('versionCodeOverride')) { versionCode System.getProperty('versionCodeOverride') as Integer } else { diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index e0abd977b..e21bb518c 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -9,6 +9,8 @@ + + @@ -96,7 +98,8 @@ - + - + () - requestedPermissions?.forEachIndexed { index, permission -> - if (permissionFlags[index] and REQUESTED_PERMISSION_GRANTED != 0) { - activePermissions += permission - } - } + val requestedPermissions = packageInfo.requestedPermissions?.asSequence().orEmpty() + val permissionFlags = packageInfo.requestedPermissionsFlags?.asSequence().orEmpty() + val activePermissions = (requestedPermissions zip permissionFlags) + .filter { (permission, flag) -> flag and REQUESTED_PERMISSION_GRANTED != 0 } + .mapTo(mutableSetOf()) { (permission, flag) -> permission } return CallerPackageInfo(appName, callingPackage, uid, signature, activePermissions.toSet()) } @@ -189,12 +186,12 @@ internal class PackageValidator(context: Context) { */ @Suppress("deprecation") private fun getSignature(packageInfo: PackageInfo): String? = - if (packageInfo.signatures == null || packageInfo.signatures.size != 1) { + if (packageInfo.signatures == null || packageInfo.signatures!!.size != 1) { // Security best practices dictate that an app should be signed with exactly one (1) // signature. Because of this, if there are multiple signatures, reject it. null } else { - val certificate = packageInfo.signatures[0].toByteArray() + val certificate = packageInfo.signatures!![0].toByteArray() getSignatureSha256(certificate) } diff --git a/app/src/main/res/values-v35/styles.xml b/app/src/main/res/values-v35/styles.xml new file mode 100644 index 000000000..beb16bcdf --- /dev/null +++ b/app/src/main/res/values-v35/styles.xml @@ -0,0 +1,27 @@ + + + + + + + + +