Skip to content

Commit

Permalink
Bug/3 android permissions (#10)
Browse files Browse the repository at this point in the history
* Add kotlin to the project

* Add FileProvider code

* Add options for Android atLeast 29(OS10)

* Change cache to scope storage

* Fix CropImage path

* Fix path for external storage
  • Loading branch information
Canato authored Dec 13, 2020
1 parent acb465d commit 98bbdd7
Show file tree
Hide file tree
Showing 14 changed files with 2,101 additions and 1,877 deletions.
4 changes: 3 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
buildscript {
ext.kotlin_version = '1.4.20'
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

Expand All @@ -19,7 +21,7 @@ allprojects {

ext {
compileSdkVersion = 30
targetSdkVersion = 28
targetSdkVersion = 30
buildToolsVersion = '29.0.3'

// AndroidX
Expand Down
6 changes: 6 additions & 0 deletions cropper/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply from: file('publish.gradle')

android {
Expand All @@ -22,5 +23,10 @@ android {
dependencies {
api "androidx.appcompat:appcompat:$androidXAppCompatVersion"
implementation "androidx.exifinterface:exifinterface:$androidXExifVersion"
implementation "androidx.core:core-ktx:+"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
repositories {
mavenCentral()
}

15 changes: 14 additions & 1 deletion cropper/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,2 +1,15 @@
<manifest package="com.canhub.cropper">
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.canhub.cropper">
<application>
<provider
android:name=".CropFileProvider"
android:authorities="${applicationId}.cropper.fileprovider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/library_file_paths" />
</provider>
</application>
</manifest>
Loading

0 comments on commit 98bbdd7

Please sign in to comment.