Commit b636691c authored by axet's avatar axet 🍄

Merge branch 'smsgate-1.9.9'

parents 91b4dae5 6de82dda
Pipeline #48806895 passed with stage
in 31 seconds
......@@ -8,8 +8,8 @@ android {
applicationId "com.github.axet.smsgate"
minSdkVersion 9
targetSdkVersion 26
versionCode 217
versionName "1.9.8"
versionCode 218
versionName "1.9.9"
}
packagingOptions {
exclude 'META-INF/LICENSE'
......@@ -39,7 +39,7 @@ android {
dependencies {
testImplementation 'junit:junit:4.12'
implementation 'com.github.axet:android-library:1.30.7' // implementation project(':android-library')
implementation 'com.github.axet:android-library:1.30.15' // 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'
......
......@@ -24,6 +24,7 @@ public class ScheduleTime {
public static final int REPEAT_MONTH_6 = 6;
public static final int REPEAT_MONTH_12 = 7;
public static final int REPEAT_WEEK = 8;
public static final int REPEAT_6HOURS = 9;
Context context;
......@@ -54,6 +55,7 @@ public class ScheduleTime {
ArrayAdapter a = new ArrayAdapter(context, android.R.layout.simple_spinner_dropdown_item);
a.add(new SpinnerItem(REPEAT_DELETE, context.getString(R.string.repeat_delete)));
a.add(new SpinnerItem(REPEAT_ONCE, context.getString(R.string.repeat_once)));
a.add(new SpinnerItem(REPEAT_6HOURS, context.getString(R.string.repeat_6hours)));
a.add(new SpinnerItem(REPEAT_DAY, context.getString(R.string.repeat_day)));
a.add(new SpinnerItem(REPEAT_WEEK, context.getString(R.string.repeat_week)));
a.add(new SpinnerItem(REPEAT_MONTH_1, context.getString(R.string.repeat_month_1)));
......@@ -168,6 +170,9 @@ public class ScheduleTime {
return; // exit
}
break;
case REPEAT_6HOURS:
n.add(Calendar.HOUR_OF_DAY, 6);
break;
case REPEAT_DAY:
n.add(Calendar.DAY_OF_MONTH, 1);
break;
......@@ -248,6 +253,7 @@ public class ScheduleTime {
String r = get(a, repeat).name;
switch (repeat) {
case REPEAT_6HOURS:
case REPEAT_ONCE:
return r + " at " + formatDate() + " " + formatTime();
case REPEAT_DAY:
......
......@@ -45,6 +45,7 @@ import com.github.axet.androidlibrary.crypto.Bitcoin;
import com.github.axet.androidlibrary.net.HttpClient;
import com.github.axet.androidlibrary.services.DeviceAdmin;
import com.github.axet.androidlibrary.services.WifiReceiver;
import com.github.axet.androidlibrary.widgets.AboutPreferenceCompat;
import com.github.axet.androidlibrary.widgets.NotificationChannelCompat;
import com.github.axet.androidlibrary.widgets.RemoteNotificationCompat;
import com.github.axet.smsgate.R;
......@@ -1252,14 +1253,7 @@ public class FirebaseService extends Service implements FirebaseAuth.AuthStateLi
json.put("battery", getBatteryLevel());
if (phone.isTelephony())
json.put("signal", getSignalLevel());
String version = "";
try {
PackageManager pm = getPackageManager();
PackageInfo pInfo = pm.getPackageInfo(getPackageName(), 0);
version = "v" + pInfo.versionName;
} catch (PackageManager.NameNotFoundException e) {
throw new RuntimeException(e);
}
String version = AboutPreferenceCompat.getVersion(this);
info.setValue(new Info(version, keyPair.encrypt(json.toString()))).addOnSuccessListener(new OnSuccessListener<Void>() {
@Override
public void onSuccess(Void aVoid) {
......
/* Copyright (c) 2009 Christoph Studer <chstuder@gmail.com>
* Copyright (c) 2010 Jan Berkel <jan.berkel@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.github.axet.smsgate.services;
import android.content.BroadcastReceiver;
......@@ -33,12 +18,6 @@ import static com.zegoggles.smssync.App.LOCAL_LOGV;
import static com.zegoggles.smssync.App.TAG;
public class OnBootReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
if (LOCAL_LOGV) Log.v(TAG, "onReceive(" + context + "," + intent + ")");
start(context);
}
public static void start(Context context) {
main(context);
fragment(context);
......@@ -58,4 +37,10 @@ public class OnBootReceiver extends BroadcastReceiver {
SmsReplyService.startIfEnabled(context);
SmsBackupService.scheduleBootupBackup(context);
}
@Override
public void onReceive(Context context, Intent intent) {
if (LOCAL_LOGV) Log.v(TAG, "onReceive(" + context + "," + intent + ")");
start(context);
}
}
package com.github.axet.smsgate.services;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.util.Log;
public class OnExternalReceiver extends BroadcastReceiver {
static final String TAG = OnExternalReceiver.class.getSimpleName();
boolean isExternal(Context context) {
PackageManager pm = context.getPackageManager();
try {
PackageInfo pi = pm.getPackageInfo(context.getPackageName(), 0);
ApplicationInfo ai = pi.applicationInfo;
return (ai.flags & ApplicationInfo.FLAG_EXTERNAL_STORAGE) == ApplicationInfo.FLAG_EXTERNAL_STORAGE;
} catch (PackageManager.NameNotFoundException ignore) {
}
return false;
}
public class OnExternalReceiver extends com.github.axet.androidlibrary.services.OnExternalReceiver {
@Override
public void onReceive(Context context, Intent intent) {
Log.d(TAG, "OnReceive");
......
......@@ -369,6 +369,7 @@
<string name="repeat_delete">Delete after Send</string>
<string name="repeat_once">Once</string>
<string name="repeat_6hours">Every 6 Hours</string>
<string name="repeat_day">Every Day</string>
<string name="repeat_week">Every Week</string>
<string name="repeat_month_1">Every Month</string>
......
......@@ -5,7 +5,7 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.0'
classpath 'com.android.tools.build:gradle:3.3.1'
classpath 'com.google.gms:google-services:3.1.0'
}
}
......
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