1
0
mirror of https://github.com/tijder/SmsMatrix.git synced 2024-10-27 18:24:01 +00:00

Compare commits

...

13 Commits

Author SHA1 Message Date
tijder
d0810b99b6
Merge pull request #77 from tobymurray/update-tooling
Update Gradle, Kotlin, and Gradle plug-in for Android
2023-06-19 21:12:07 +02:00
tijder
8ccbf530dd
Merge pull request #80 from HammyHavoc/patch-1
Fixed typos
2023-06-19 21:10:55 +02:00
Hammy Havoc
17177fc7a9
Fixed typos
:- )
2021-07-30 00:05:51 +01:00
Toby Murray
1dc6f435ce Update Gradle, Kotlin, and Gradle plug-in for Android
Trying to build/install this application in a new installation of Android Studio yielded:

> Unable to determine application id: com.android.tools.idea.run.ApkProvisionException: Error loading build artifacts from:<snip>\sms-matrix\app\build\outputs\apk\debug\output-metadata.json

This updates the versions of applications central to building the Android project to make it compatible. This does not (intentionally, at least) have any functional impact on the application at all.

I opted not to jump to Gradle 7.0 as it has just recently been released and increasing 1 major version is change enough for one PR.
2021-05-03 19:25:37 -04:00
tijder
e7f96ba44a
Update to version 0.0.16 2019-12-04 20:03:03 +01:00
Gerben Droogers
820036d483 Fix crash at startup 2019-12-03 22:25:12 +01:00
tijder
072ebeb1b1
Update to version 0.0.15 2019-11-26 16:27:15 +01:00
tijder
c85515c917
Merge pull request #62 from PhieF/master
Start on boot and notification on Android O
2019-11-26 16:25:33 +01:00
Phie
fd08bb747a oreo need a foreground notification (it can be hidden by user) 2019-11-26 09:33:11 +01:00
Phie
faa8984c43 start service on boot 2019-11-26 09:10:28 +01:00
tijder
4471b7221a
Fix typo 2019-10-17 22:22:47 +02:00
tijder
d4912a23e1
Merge pull request #61 from Lindenk/master
Fixed typo in readme
2019-10-17 22:21:45 +02:00
Linden Krouse
9cb4a1a371
Fixed typo in readme 2019-10-17 15:57:43 -04:00
7 changed files with 58 additions and 10 deletions

View File

@ -15,14 +15,14 @@ As currently there is no end-to-end encryption implemented in this app, for priv
</a>
# Set up
- Create a acount on a homeserver
- Create an account on a homeserver
- Install this app (apk can be found by [releases](https://github.com/tijder/SmsMatrix/releases) or from [f-droid](https://f-droid.org/app/eu.droogers.smsmatrix))
- Give the app the app permission
- Type in the needed info in the app
- Bot Username: is the username of the just created user
- Bot Password: is the password of the just created user
- Homeserver url: is the url of the homeserver where the user is created
- Your username: is where you want to forward all yous text message to
- Your username: is where you want to forward all your text messages to
- Devicename: is the devicename wich the api will use
- Press save
- Now all your text messages will be bridged

View File

@ -10,8 +10,8 @@ android {
applicationId "eu.droogers.smsmatrix"
minSdkVersion 23
targetSdkVersion 29
versionCode 14
versionName "0.0.14"
versionCode 16
versionName "0.0.16"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {

View File

@ -7,6 +7,8 @@
<uses-permission android:name="android.permission.SEND_SMS" />
<uses-permission android:name="android.permission.RECEIVE_SMS" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<application
tools:replace="allowBackup,label"
@ -31,6 +33,9 @@
<intent-filter>
<action android:name="android.intent.action.PHONE_STATE" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"/>
</intent-filter>
</receiver>
<service android:name="eu.droogers.smsmatrix.MatrixService" />

View File

@ -1,14 +1,22 @@
package eu.droogers.smsmatrix;
import android.app.Notification;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.app.Service;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.Color;
import android.os.Build;
import android.os.IBinder;
import android.util.Log;
import android.widget.Toast;
import androidx.annotation.RequiresApi;
import androidx.core.app.NotificationCompat;
/**
* Created by gerben on 7-10-17.
*/
@ -24,6 +32,7 @@ public class MatrixService extends Service {
private String syncDelay;
private String syncTimeout;
private MMSMonitor mms;
private String mChannelId = "";
@Override
public void onCreate() {
@ -32,6 +41,21 @@ public class MatrixService extends Service {
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O){
if (mChannelId.isEmpty()) {
mChannelId = createNotificationChannel("sync", "Sync Service");
}
NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this, mChannelId);
Notification notification = notificationBuilder.setOngoing(true)
.setSmallIcon(R.mipmap.ic_launcher)
.setContentText(getApplicationInfo().loadLabel(getPackageManager()))
.setPriority(NotificationCompat.PRIORITY_MIN)
.setCategory(Notification.CATEGORY_SERVICE)
.build();
startForeground(1, notification);
}
SharedPreferences sp = getSharedPreferences("settings", Context.MODE_PRIVATE);
botUsername = sp.getString("botUsername", "");
botPassword = sp.getString("botPassword", "");
@ -76,9 +100,22 @@ public class MatrixService extends Service {
}
@RequiresApi(api = Build.VERSION_CODES.O)
private String createNotificationChannel(String channelId, String channelName){
NotificationChannel chan = new NotificationChannel(channelId,
channelName, NotificationManager.IMPORTANCE_NONE);
chan.setLightColor(Color.BLUE);
chan.setLockscreenVisibility(Notification.VISIBILITY_PRIVATE);
NotificationManager service = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
service.createNotificationChannel(chan);
return channelId;
}
@Override
public void onDestroy() {
mx.destroy();
if (mx != null) {
mx.destroy();
}
this.mms.stopMMSMonitoring();
this.mms = null;
super.onDestroy();

View File

@ -6,7 +6,9 @@ import android.content.Intent;
import android.os.Bundle;
import android.telephony.SmsMessage;
import android.telephony.TelephonyManager;
import android.util.Log;
import androidx.core.content.ContextCompat;
import java.util.HashMap;
import java.util.Map;
@ -24,6 +26,10 @@ public class ReceiverListener extends BroadcastReceiver {
} else if (intent.getAction().equals("android.intent.action.PHONE_STATE")) {
handleIncomingCall(context, intent);
}
else if (intent.getAction().equals("android.intent.action.BOOT_COMPLETED")) {
Intent intentServ = new Intent(context, MatrixService.class);
ContextCompat.startForegroundService(context, intentServ);
}
}
private void handleIncomingSMS(Context context, Intent intent) {

View File

@ -1,14 +1,14 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.3.10'
ext.kotlin_version = '1.4.20'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.1'
classpath 'com.android.tools.build:gradle:4.1.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "io.realm:realm-gradle-plugin:5.8.0"

View File

@ -1,6 +1,6 @@
#Fri Oct 11 22:28:14 EEST 2019
#Mon May 03 19:17:08 EDT 2021
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-all.zip