Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<uses-permission android:name="android.permission.READ_SMS" />
<uses-permission android:name="android.permission.SEND_SMS" />
<uses-permission android:name="android.permission.RECEIVE_SMS" />
<uses-permission android:name="android.permission.RECEIVE_MMS" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />

<application
Expand All @@ -28,12 +29,18 @@
<intent-filter>
<action android:name="android.provider.Telephony.SMS_RECEIVED" />
</intent-filter>
<intent-filter>
<action android:name="android.provider.Telephony.WAP_PUSH_RECEIVED" />
<data android:mimeType="application/vnd.wap.mms-message" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.PHONE_STATE" />
</intent-filter>
</receiver>

<service android:name="eu.droogers.smsmatrix.MatrixService" />
<service android:name="eu.droogers.smsmatrix.MmsService" />


</application>

Expand Down
75 changes: 75 additions & 0 deletions app/src/main/java/eu/droogers/smsmatrix/DatabaseContract.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
package eu.droogers.smsmatrix;

import android.provider.BaseColumns;

public class DatabaseContract {

private DatabaseContract () {}

public static final class SmsEntry implements BaseColumns {
public static final String TABLE_NAME = "sms";
public static final String COLUMN_TYPE = "type";
//matrix -> cell=1 ; cell -> matrix = 2
public static final String COLUMN_SOURCE_EPOCH = "source_epoch";
//epoch in ms from sending party
public static final String COLUMN_RECIEVED_EPOCH = "received_epoch";
//epoch in ms when the device on onRecieve
public static final String COLUMN_NUMBER = "number";
//Who the message is from
public static final String COLUMN_MESSAGE = "message";
//Body of the message
public static final String COLUMN_BRIDGED = "bridged";
//Was it sent successfully?
public static final String COLUMN_LOCK = "lock";
//Are we doing something with this message?
public static final String COLUMN_ERROR = "error";
//Was there an error doing something?

public static final String SQL_CREATE_TABLE =
"CREATE TABLE " + TABLE_NAME + " (" +
_ID + " INTEGER PRIMARY KEY, " +
COLUMN_TYPE + " INTEGER NOT NULL, " +
COLUMN_SOURCE_EPOCH + " INTEGER, " +
COLUMN_RECIEVED_EPOCH + " INTEGER NOT NULL, " +
COLUMN_NUMBER + " TEXT NOT NULL, " +
COLUMN_MESSAGE + " TEXT NOT NULL, " +
COLUMN_BRIDGED + " INTEGER NOT NULL, " +
COLUMN_LOCK + " INTEGER NOT NULL, " +
COLUMN_ERROR + " INTEGER NOT NULL )";

}

public static final class MmsEntry implements BaseColumns {
public static final String TABLE_NAME = "mms";
public static final String COLUMN_TYPE = "type";
//matrix -> cell=1 ; cell -> matrix = 2
public static final String COLUMN_SOURCE_EPOCH = "source_epoch";
//epoch in ms from sending party
public static final String COLUMN_RECIEVED_EPOCH = "received_epoch";
//epoch in ms when the device on onRecieve
public static final String COLUMN_NUMBER = "number";
//Who the message is from
public static final String COLUMN_MMS_ID = "mms_id";
//ID of mmssms.db - addr
public static final String COLUMN_BRIDGED = "bridged";
//Was it sent successfully?
public static final String COLUMN_LOCK = "lock";
//Are we doing something with this message?
public static final String COLUMN_ERROR = "error";
//Was there an error doing something?


public static final String SQL_CREATE_TABLE =
"CREATE TABLE " + TABLE_NAME + " (" +
_ID + " INTEGER PRIMARY KEY, " +
COLUMN_TYPE + " INTEGER NOT NULL, " +
COLUMN_SOURCE_EPOCH + " INTEGER, " +
COLUMN_RECIEVED_EPOCH + " INTEGER NOT NULL, " +
COLUMN_NUMBER + " TEXT NOT NULL, " +
COLUMN_MMS_ID + " INTEGER UNIQUE NOT NULL, " +
COLUMN_BRIDGED + " INTEGER NOT NULL, " +
COLUMN_LOCK + " INTEGER, " +
COLUMN_ERROR + " INTEGER )";
}

}
Loading