Приложение запрашивает разрешение на чтение состояния телефона без объявления в файле манифеста
По этому вопросу уже есть вопрос. Но это не помогло. Ответ был более десяти лет назад. Поэтому, пожалуйста, не помечайте этот вопрос как повторяющийся.
Я не могу понять, как мое приложение запрашивает это разрешение.
Вот мой AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.emptysheet.pdfreader_autoscroll">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<application
android:name=".PdfReaderApp"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:requestLegacyExternalStorage="true"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/themeForApp">
<activity
android:name=".homeScreen.MainActivity"
android:theme="@style/themeForApp"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".pdfScreen.PdfActivity" android:theme="@style/pdfViewTheme">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="file" />
<data android:scheme="content"/>
<data android:mimeType="application/pdf" />
</intent-filter>
</activity>
<activity android:name=".settingScreen.SettingActivity"
android:screenOrientation="portrait"/>
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-5096717122607652~4262160240"/>
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.provider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/provider_paths"/>
</provider>
</application>
</manifest>
Мои приложения build.gradle
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'
apply plugin: 'kotlin-kapt'
apply plugin: 'dagger.hilt.android.plugin'
android {
compileSdkVersion 29
buildToolsVersion "29.0.3"
buildFeatures{
viewBinding = true
dataBinding = true
}
defaultConfig {
applicationId "com.emptysheet.pdfreader_autoscroll"
minSdkVersion 16
targetSdkVersion 29
versionCode 7
versionName "1.7"
multiDexEnabled true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
// To inline the bytecode built with JVM target 1.8 into
// bytecode that is being built with JVM target 1.6. (e.g. navArgs)
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.core:core-ktx:1.3.0'
implementation "androidx.fragment:fragment-ktx:1.2.5"
implementation "androidx.activity:activity:1.1.0"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0"
implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.2.0"
implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.2.0"
implementation "androidx.lifecycle:lifecycle-viewmodel-savedstate:2.2.0"
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.google.android.material:material:1.1.0'
implementation 'androidx.preference:preference:1.1.1'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.navigation:navigation-fragment:2.2.2'
implementation 'androidx.navigation:navigation-ui:2.2.2'
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
implementation 'androidx.navigation:navigation-fragment-ktx:2.2.2'
implementation 'androidx.navigation:navigation-ui-ktx:2.2.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation project(path: ':android-pdf-viewer')
//firebase for crashlytics
implementation 'com.google.firebase:firebase-analytics-ktx:17.4.3'
implementation 'com.google.firebase:firebase-crashlytics:17.1.0'
// for ads
implementation 'com.google.android.gms:play-services-ads:19.2.0'
// multidex
//room
implementation 'androidx.room:room-ktx:2.2.5'
kapt "androidx.room:room-compiler:2.2.5"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.7"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.0"
//debug database
debugImplementation 'com.amitshekhar.android:debug-db:1.0.6'
implementation 'de.psdev.licensesdialog:licensesdialog:2.1.0'
//support for APK less than 21
implementation 'androidx.multidex:multidex:2.0.1'
// in app billing
//implementation 'com.android.billingclient:billing-ktx:3.0.0'
// Hilt
implementation "com.google.dagger:hilt-android:2.28-alpha"
kapt "com.google.dagger:hilt-android-compiler:2.28-alpha"
implementation 'androidx.hilt:hilt-lifecycle-viewmodel:1.0.0-alpha01'
kapt 'androidx.hilt:hilt-compiler:1.0.0-alpha01'
}
Я также использую внешнюю библиотеку, и вот AndroidManifest.xml
файл для него.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.github.barteksc.pdfviewer">
</manifest>
Здесь build.gradle
для внешней библиотеки.
apply plugin: 'com.android.library'
ext {
bintrayRepo = 'maven'
bintrayName = 'android-pdf-viewer'
publishedGroupId = 'com.github.barteksc'
libraryName = 'AndroidPdfViewer'
artifact = 'android-pdf-viewer'
libraryDescription = 'Android view for displaying PDFs rendered with PdfiumAndroid'
siteUrl = 'https://github.com/barteksc/AndroidPdfViewer'
gitUrl = 'https://github.com/barteksc/AndroidPdfViewer.git'
libraryVersion = '3.2.0-beta.1'
developerId = 'barteksc'
developerName = 'Bartosz Schiller'
developerEmail = 'barteksch@boo.pl'
licenseName = 'The Apache Software License, Version 2.0'
licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
allLicenses = ["Apache-2.0"]
}
android {
compileSdkVersion 29
defaultConfig {
minSdkVersion 16
targetSdkVersion 29
versionCode 1
versionName "3.2.0-beta.1"
}
}
dependencies {
implementation 'androidx.core:core:1.3.0'
api 'com.github.barteksc:pdfium-android:1.9.0'
}
apply from: 'bintray.gradle'