Commit 317e9e7b authored by axet's avatar axet 🍄

Merge branch 'smsgate-1.8.16'

parents f4a7222c 301e9ac9
Pipeline #15739582 passed with stage
in 20 seconds
...@@ -8,8 +8,8 @@ android { ...@@ -8,8 +8,8 @@ android {
applicationId "com.github.axet.smsgate" applicationId "com.github.axet.smsgate"
minSdkVersion 9 minSdkVersion 9
targetSdkVersion 23 targetSdkVersion 23
versionCode 199 versionCode 200
versionName "1.8.15" versionName "1.8.16"
} }
packagingOptions { packagingOptions {
exclude 'META-INF/LICENSE' exclude 'META-INF/LICENSE'
...@@ -40,7 +40,7 @@ android { ...@@ -40,7 +40,7 @@ android {
dependencies { dependencies {
compile fileTree(dir: 'libs', include: ['*.jar']) compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12' testCompile 'junit:junit:4.12'
compile 'com.github.axet:android-library:1.17.10' // compile project(':android-library') compile 'com.github.axet:android-library:1.17.13' // compile project(':android-library')
compile 'com.android.support:design:25.3.1' compile 'com.android.support:design:25.3.1'
compile 'com.intellij:annotations:12.0' compile 'com.intellij:annotations:12.0'
compile 'com.beetstra.jutf7:jutf7:1.0.0' compile 'com.beetstra.jutf7:jutf7:1.0.0'
......
...@@ -18,6 +18,7 @@ import android.os.Build; ...@@ -18,6 +18,7 @@ import android.os.Build;
import android.os.Handler; import android.os.Handler;
import android.support.v7.preference.PreferenceManager; import android.support.v7.preference.PreferenceManager;
import android.util.Log; import android.util.Log;
import android.widget.Toast;
import com.fsck.k9.mail.Address; import com.fsck.k9.mail.Address;
import com.fsck.k9.mail.Message; import com.fsck.k9.mail.Message;
...@@ -75,7 +76,7 @@ public class MainApplication extends App { ...@@ -75,7 +76,7 @@ public class MainApplication extends App {
public static final String APPS_INDEX = "APPS_"; public static final String APPS_INDEX = "APPS_";
public static final String APPS_COUNT = "APPS_COUNT"; public static final String APPS_COUNT = "APPS_COUNT";
public static final String BIN_PING = SuperUser.path("ping"); public static final String BIN_PING = SuperUser.which("ping");
public static final String APP_FROM = "from"; public static final String APP_FROM = "from";
public static final String APP_SUBJ = "subject"; public static final String APP_SUBJ = "subject";
...@@ -227,10 +228,10 @@ public class MainApplication extends App { ...@@ -227,10 +228,10 @@ public class MainApplication extends App {
return; return;
} }
} }
try { SuperUser.Result r = SuperUser.reboot();
SuperUser.reboot(); if (!r.ok()) {
} catch (RuntimeException e) { Log.d(TAG, "Unable reboot: " + r.message(), r.e);
Log.d(TAG, "Unable reboot", e); Toast.makeText(context, r.message(), Toast.LENGTH_SHORT).show();
} }
} }
......
...@@ -1243,21 +1243,24 @@ public class FirebaseService extends Service implements FirebaseAuth.AuthStateLi ...@@ -1243,21 +1243,24 @@ public class FirebaseService extends Service implements FirebaseAuth.AuthStateLi
} }
public SMSMessage messageFromMapSms(Map<String, String> msgMap) { public SMSMessage messageFromMapSms(Map<String, String> msgMap) {
final String address = msgMap.get(SmsConsts.ADDRESS);
if (TextUtils.isEmpty(address)) return null;
SMSMessage sms = new SMSMessage(); SMSMessage sms = new SMSMessage();
PersonRecord record = mPersonLookup.lookupPerson(address);
sms.id = msgMap.get(SmsConsts.ID); sms.id = msgMap.get(SmsConsts.ID);
sms.message = msgMap.get(SmsConsts.BODY); sms.message = msgMap.get(SmsConsts.BODY);
final int messageType = toInt(msgMap.get(SmsConsts.TYPE)); final int messageType = toInt(msgMap.get(SmsConsts.TYPE));
sms.thread = msgMap.get(SmsConsts.THREAD_ID); sms.thread = msgMap.get(SmsConsts.THREAD_ID);
sms.threadPhone = record.getNumber();
sms.threadName = record.getName(); final String address = msgMap.get(SmsConsts.ADDRESS);
if (TextUtils.isEmpty(address)) {
sms.threadPhone = "--";
sms.threadName = "--";
} else {
PersonRecord record = mPersonLookup.lookupPerson(address);
sms.threadPhone = record.getNumber();
sms.threadName = record.getName();
}
if (sms.thread == null || sms.thread.isEmpty()) if (sms.thread == null || sms.thread.isEmpty())
sms.thread = sms.threadPhone; sms.thread = sms.threadPhone;
......
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