Skip to content

Commit

Permalink
Fixed Torch Android SDK Change
Browse files Browse the repository at this point in the history
updated sdk version if statement
  • Loading branch information
asaf400 committed Jun 26, 2022
1 parent 1f15550 commit 80c9776
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
6 changes: 5 additions & 1 deletion GravityBox/build.gradle
@@ -1,5 +1,9 @@
apply plugin: 'com.android.application'
android {
signingConfigs {
release {
}
}
compileSdkVersion 31
defaultConfig {
applicationId 'com.ceco.r.gravitybox'
Expand Down Expand Up @@ -30,7 +34,7 @@ android {

dependencies {
compileOnly 'de.robv.android.xposed:api:82'
implementation 'com.google.android.material:material:1.2.1'
implementation 'com.google.android.material:material:1.6.1'
implementation 'androidx.palette:palette:1.0.0'
api 'com.theartofdev.edmodo:android-image-cropper:2.8.+'
}
5 changes: 3 additions & 2 deletions GravityBox/src/main/AndroidManifest.xml
Expand Up @@ -17,8 +17,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.ceco.r.gravitybox"
android:versionCode="1105"
android:versionName="11.0.5" >
android:versionCode="1201"
android:versionName="12.0.1" >

<uses-permission android:name="android.permission.READ_SYNC_SETTINGS" />
<uses-permission android:name="android.permission.WRITE_SYNC_SETTINGS" />
Expand All @@ -35,6 +35,7 @@
<uses-permission android:name="android.permission.REQUEST_DELETE_PACKAGES"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" />

<permission
android:name="gravitybox.permission.UNLOCK"
Expand Down
Expand Up @@ -63,7 +63,7 @@ public static void log(String tag, Throwable t) {

@Override
public void initZygote(StartupParam startupParam) {
if (Build.VERSION.SDK_INT != 30) {
if (Build.VERSION.SDK_INT != 31) {
XposedBridge.log("!!! GravityBox you are running is not designed for "
+ "Android SDK " + Build.VERSION.SDK_INT + " !!!");
return;
Expand Down Expand Up @@ -123,7 +123,7 @@ public void initZygote(StartupParam startupParam) {

@Override
public void handleLoadPackage(LoadPackageParam lpparam) {
if (Build.VERSION.SDK_INT != 30) {
if (Build.VERSION.SDK_INT != 31) {
return;
}

Expand Down
Expand Up @@ -102,7 +102,7 @@ public void onCreate() {

Intent intent = new Intent(this, TorchService.class);
intent.setAction(ACTION_TOGGLE_TORCH);
PendingIntent stopIntent = PendingIntent.getService(this, 0, intent, 0);
PendingIntent stopIntent = PendingIntent.getService(this, 0, intent, PendingIntent.FLAG_MUTABLE);

Notification.Builder builder = new Notification.Builder(
this, GravityBoxApplication.NOTIF_CHANNEL_SERVICES);
Expand Down Expand Up @@ -229,7 +229,7 @@ private void setupTimeout() {
if (torchTimeout > 0) {
Intent intent = new Intent(this, TorchService.class);
intent.setAction(ACTION_TORCH_TIMEOUT);
mPendingIntent = PendingIntent.getService(this, 1, intent, PendingIntent.FLAG_ONE_SHOT);
mPendingIntent = PendingIntent.getService(this, 1, intent, PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_MUTABLE);
long triggerAtMillis = System.currentTimeMillis() + torchTimeout;
mAlarmManager.setExact(AlarmManager.RTC_WAKEUP, triggerAtMillis, mPendingIntent);
}
Expand Down

0 comments on commit 80c9776

Please sign in to comment.