File tree 6 files changed +16
-6
lines changed
src/main/java/de/cketti/safecontentresolver/sample
6 files changed +16
-6
lines changed Original file line number Diff line number Diff line change 15
15
# When configured, Gradle will run in incubating parallel mode.
16
16
# This option should only be used with decoupled projects. More details, visit
17
17
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18
+ android.enableJetifier =false
19
+ android.useAndroidX =true
18
20
org.gradle.parallel =true
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ android {
8
8
applicationId " de.cketti.safecontentresolver.sample"
9
9
10
10
minSdkVersion 14
11
- targetSdkVersion 23
11
+ targetSdkVersion 29
12
12
13
13
versionCode 1
14
14
versionName " 1.0"
@@ -21,6 +21,6 @@ android {
21
21
22
22
dependencies {
23
23
implementation project(' :SafeContentResolver-v14' )
24
- implementation ' com.android.support :appcompat-v7:23.2 .0'
25
- implementation ' com.squareup.okio:okio:1.6.0 '
24
+ implementation ' androidx.appcompat :appcompat:1.1 .0'
25
+ implementation ' com.squareup.okio:okio:1.17.5 '
26
26
}
Original file line number Diff line number Diff line change 4
4
5
5
import android .content .Intent ;
6
6
import android .net .Uri ;
7
- import android . support . v7 .app .AppCompatActivity ;
7
+ import androidx . appcompat .app .AppCompatActivity ;
8
8
import android .os .Bundle ;
9
9
import android .view .View ;
10
10
import android .view .View .OnClickListener ;
Original file line number Diff line number Diff line change 6
6
7
7
import android .app .Application ;
8
8
import android .content .Context ;
9
+ import android .os .Build ;
10
+ import android .os .StrictMode ;
9
11
10
12
import okio .BufferedSink ;
11
13
import okio .Okio ;
@@ -19,9 +21,15 @@ public class SampleApplication extends Application {
19
21
public void onCreate () {
20
22
super .onCreate ();
21
23
24
+ disableFileUriExposedException ();
22
25
createInternalFileIfNecessary ();
23
26
}
24
27
28
+ private void disableFileUriExposedException () {
29
+ // We're lazy and just disable all StrictMode.VmPolicy checks
30
+ StrictMode .setVmPolicy (new StrictMode .VmPolicy .Builder ().build ());
31
+ }
32
+
25
33
private void createInternalFileIfNecessary () {
26
34
File internalFile = getInternalFile (this );
27
35
if (!internalFile .exists ()) {
Original file line number Diff line number Diff line change 10
10
import android .content .res .AssetManager ;
11
11
import android .database .Cursor ;
12
12
import android .net .Uri ;
13
- import android . support .annotation .Nullable ;
13
+ import androidx .annotation .Nullable ;
14
14
15
15
16
16
public class SampleContentProvider extends ContentProvider {
Original file line number Diff line number Diff line change 7
7
8
8
import android .content .Intent ;
9
9
import android .net .Uri ;
10
- import android . support . v7 .app .AppCompatActivity ;
10
+ import androidx . appcompat .app .AppCompatActivity ;
11
11
import android .os .Bundle ;
12
12
import android .widget .TextView ;
13
13
You can’t perform that action at this time.
0 commit comments