Skip to content

Commit

Permalink
Add Android 12 support.
Browse files Browse the repository at this point in the history
  • Loading branch information
ComBatVision committed May 16, 2022
1 parent c752969 commit 7c11727
Show file tree
Hide file tree
Showing 22 changed files with 54 additions and 191 deletions.
12 changes: 5 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
*.iml
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
.DS_Store
/build
/captures
*.log
local.properties
.*/
build/
captures/
22 changes: 0 additions & 22 deletions .idea/compiler.xml

This file was deleted.

25 changes: 0 additions & 25 deletions .idea/gradle.xml

This file was deleted.

62 changes: 0 additions & 62 deletions .idea/misc.xml

This file was deleted.

10 changes: 0 additions & 10 deletions .idea/modules.xml

This file was deleted.

12 changes: 0 additions & 12 deletions .idea/runConfigurations.xml

This file was deleted.

13 changes: 6 additions & 7 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 28
buildToolsVersion '28.0.3'
compileSdkVersion 32

defaultConfig {
applicationId "com.permissioneverywhere.demo"
minSdkVersion 15
targetSdkVersion 28
versionCode 1
versionName "1.0"
targetSdkVersion 32
versionCode 2
versionName "1.1"
}
buildTypes {
release {
Expand All @@ -21,7 +20,7 @@ android {

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
testImplementation 'junit:junit:4.12'
implementation 'com.android.support:appcompat-v7:28.0.0'
testImplementation 'junit:junit:4.13.2'
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.github.kaknazaveshtakipishi:PermissionEverywhere:1.0.2'
}
6 changes: 4 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.permissioneverywhere.demo">

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<activity android:name=".MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand All @@ -18,5 +21,4 @@
</activity>
<service android:name=".TestService"/>
</application>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
</manifest>
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package com.permissioneverywhere.demo;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

import androidx.appcompat.app.AppCompatActivity;

public class MainActivity extends AppCompatActivity {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,13 @@

import android.Manifest;
import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.Handler;
import android.os.IBinder;
import android.os.Looper;
import android.support.annotation.Nullable;
import android.support.v4.os.ResultReceiver;
import android.widget.Toast;

import androidx.annotation.Nullable;

import com.permissioneverywhere.PermissionEverywhere;
import com.permissioneverywhere.PermissionResponse;
import com.permissioneverywhere.PermissionResultCallback;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
}
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

buildscript {
repositories {
jcenter()
mavenCentral()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.android.tools.build:gradle:7.2.0'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand All @@ -16,7 +16,7 @@ buildscript {
allprojects {
repositories {
maven { url "https://jitpack.io" }
jcenter()
mavenCentral()
google()
}
}
Expand Down
4 changes: 3 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,6 @@
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
# org.gradle.parallel=true
android.enableJetifier=true
android.useAndroidX=true
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-all.zip
11 changes: 4 additions & 7 deletions library/build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
apply plugin: 'com.android.library'

android {
compileSdkVersion 28
buildToolsVersion "28.0.3"
compileSdkVersion 32

defaultConfig {
minSdkVersion 14
targetSdkVersion 28
versionCode 1
versionName "1.0"
targetSdkVersion 32
}
buildTypes {
release {
Expand All @@ -20,6 +17,6 @@ android {

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
testImplementation 'junit:junit:4.12'
implementation 'com.android.support:appcompat-v7:28.0.0'
testImplementation 'junit:junit:4.13.2'
implementation 'androidx.appcompat:appcompat:1.4.1'
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
import android.media.RingtoneManager;
import android.net.Uri;
import android.os.Build;
import android.support.v4.app.NotificationCompat;
import android.support.v4.os.ResultReceiver;
import android.os.ResultReceiver;

import androidx.core.app.NotificationCompat;

class NotificationHelper {
public static final int REQUEST_CODE_PUSH = 77;
Expand All @@ -35,7 +36,7 @@ public static void sendNotification(Context context,
}

PendingIntent pendingIntent = PendingIntent.getActivity(context, REQUEST_CODE_PUSH, intent,
PendingIntent.FLAG_ONE_SHOT);
PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_IMMUTABLE);

NotificationManager notificationManager =
(NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
import android.app.Activity;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.support.v4.app.ActivityCompat;
import android.support.v4.content.ContextCompat;
import android.support.v4.os.ResultReceiver;
import android.os.ResultReceiver;

import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;

/**
* Created by Farruxx on 30.04.2016.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package com.permissioneverywhere;

import android.content.Context;
import android.support.annotation.DrawableRes;

import androidx.annotation.DrawableRes;

/**
* Created by Farruxx on 30.04.2016.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.support.v4.os.ResultReceiver;
import android.os.ResultReceiver;

/**
* Created by Farruxx on 30.04.2016.
*/
public class PermissionRequest {
Context context;
String[] permissions;
int requestCode;
String notificationTitle;
String notificationText;
int icon;
final Context context;
final String[] permissions;
final int requestCode;
final String notificationTitle;
final String notificationText;
final int icon;

PermissionResponse response;

Expand Down
Loading

0 comments on commit 7c11727

Please sign in to comment.