mirror of
https://github.com/tijder/SmsMatrix.git
synced 2024-10-27 18:24:01 +00:00
Compare commits
13 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
d0810b99b6 | ||
|
8ccbf530dd | ||
|
17177fc7a9 | ||
|
1dc6f435ce | ||
|
e7f96ba44a | ||
|
820036d483 | ||
|
072ebeb1b1 | ||
|
c85515c917 | ||
|
fd08bb747a | ||
|
faa8984c43 | ||
|
4471b7221a | ||
|
d4912a23e1 | ||
|
9cb4a1a371 |
@ -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
|
||||
|
@ -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 {
|
||||
|
@ -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" />
|
||||
|
@ -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();
|
||||
|
@ -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) {
|
||||
|
@ -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"
|
||||
|
||||
|
4
gradle/wrapper/gradle-wrapper.properties
vendored
4
gradle/wrapper/gradle-wrapper.properties
vendored
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user