Commit 91b4dae5 authored by axet's avatar axet 🍄

Merge branch 'smsgate-1.9.8'

parents 475c9f0b a55b894e
Pipeline #43411940 (#211) passed with stage
in 27 seconds
......@@ -8,8 +8,8 @@ android {
applicationId "com.github.axet.smsgate"
minSdkVersion 9
targetSdkVersion 26
versionCode 216
versionName "1.9.7"
versionCode 217
versionName "1.9.8"
}
packagingOptions {
exclude 'META-INF/LICENSE'
......@@ -32,14 +32,14 @@ android {
}
applicationVariants.all { variant ->
variant.outputs.each { output ->
output.outputFileName = org.apache.commons.io.FilenameUtils.getExtension(android.defaultConfig.applicationId) + "-" + android.defaultConfig.versionName + "-" + variant.buildType.name + ".apk"
output.outputFileName = org.apache.commons.io.FilenameUtils.getExtension(android.defaultConfig.applicationId) + "-" + (output.getFilter(com.android.build.OutputFile.ABI) ?: "universal") + "-" + android.defaultConfig.versionName + "-" + variant.buildType.name + ".apk"
}
}
}
dependencies {
testImplementation 'junit:junit:4.12'
implementation 'com.github.axet:android-library:1.28.30' // implementation project(':android-library')
implementation 'com.github.axet:android-library:1.30.7' // implementation project(':android-library')
implementation 'com.android.support:design:25.3.1'
implementation 'com.intellij:annotations:12.0'
implementation 'com.beetstra.jutf7:jutf7:1.0.0'
......
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /Users/axet/Library/Android/sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
-dontobfuscate
-dontwarn com.fsck.k9.mail.**
-dontwarn com.google.firebase.**
-dontwarn com.google.android.**
-dontwarn de.innosystec.unrar.**
-keep class com.github.axet.smsgate.services.FirebaseService$Info {*;}
-keep class com.github.axet.smsgate.services.FirebaseService$Message {*;}
......@@ -26,6 +26,7 @@ import android.os.Handler;
import android.os.IBinder;
import android.os.SystemClock;
import android.provider.Telephony;
import android.support.annotation.Keep;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v7.preference.PreferenceManager;
......@@ -375,6 +376,7 @@ public class FirebaseService extends Service implements FirebaseAuth.AuthStateLi
void run(JSONObject json);
}
@Keep
public static class Info extends Message {
private String version;
......@@ -395,6 +397,7 @@ public class FirebaseService extends Service implements FirebaseAuth.AuthStateLi
}
}
@Keep
public static class Message {
private String id;
private Long date;
......
......@@ -24,8 +24,7 @@ public class NotificationListener extends NotificationListenerService {
public static final String REFRESH = NotificationListener.class.getCanonicalName() + ".REFRESH";
public static final String CANCEL = NotificationListener.class.getCanonicalName() + ".CANCEL";
// 21+ Settings.ACTION_NOTIFICATION_LISTENER_SETTINGS
public static final String ACTION_NOTIFICATION_LISTENER_SETTINGS = "android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS";
public static final String ENABLED_NOTIFICATION_LISTENERS = "enabled_notification_listeners"; // Settings.Secure@hide
BroadcastReceiver receiver;
......@@ -35,7 +34,7 @@ public class NotificationListener extends NotificationListenerService {
}
public static void show(Context context) {
context.startActivity(new Intent(ACTION_NOTIFICATION_LISTENER_SETTINGS));
context.startActivity(new Intent(Settings.ACTION_NOTIFICATION_LISTENER_SETTINGS));
}
public static String notificationCode(String pkg, String tag, int id) {
......@@ -44,7 +43,7 @@ public class NotificationListener extends NotificationListenerService {
public static boolean enabled(Context context) {
ContentResolver contentResolver = context.getContentResolver();
String enabledNotificationListeners = Settings.Secure.getString(contentResolver, "enabled_notification_listeners");
String enabledNotificationListeners = Settings.Secure.getString(contentResolver, ENABLED_NOTIFICATION_LISTENERS);
String packageName = context.getPackageName();
return enabledNotificationListeners != null && enabledNotificationListeners.contains(packageName);
}
......@@ -128,9 +127,8 @@ public class NotificationListener extends NotificationListenerService {
StatusBarNotification[] nn = getActiveNotifications();
if (nn == null)
return;
for (StatusBarNotification n : nn) {
for (StatusBarNotification n : nn)
send(NotificationService.UPDATE, n);
}
}
@Override
......
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
mavenLocal()
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.android.tools.build:gradle:3.3.0'
classpath 'com.google.gms:google-services:3.1.0'
}
}
allprojects {
repositories {
jcenter()
mavenLocal()
jcenter()
google()
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment