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
96 changes: 48 additions & 48 deletions gen/org/scorelab/sense/R.java
Original file line number Diff line number Diff line change
@@ -1,48 +1,48 @@
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* aapt tool from the resource data it found. It
* should not be modified by hand.
*/
package org.scorelab.sense;
public final class R {
public static final class attr {
}
public static final class drawable {
public static final int ic_launcher=0x7f020000;
public static final int icon=0x7f020001;
}
public static final class string {
public static final int app_name=0x7f030000;
}
public static final class style {
/**
Base application theme, dependent on API level. This theme is replaced
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
Theme customizations available in newer API levels can go in
res/values-vXX/styles.xml, while customizations related to
backward-compatibility can go here.
Base application theme for API 11+. This theme completely replaces
AppBaseTheme from res/values/styles.xml on API 11+ devices.
API 11 theme customizations can go here.
Base application theme for API 14+. This theme completely replaces
AppBaseTheme from BOTH res/values/styles.xml and
res/values-v11/styles.xml on API 14+ devices.
API 14 theme customizations can go here.
*/
public static final int AppBaseTheme=0x7f040000;
/** Application theme.
All customizations that are NOT specific to a particular API-level can go here.
*/
public static final int AppTheme=0x7f040001;
}
}
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* aapt tool from the resource data it found. It
* should not be modified by hand.
*/

package org.scorelab.sense;

public final class R {
public static final class attr {
}
public static final class drawable {
public static final int ic_launcher=0x7f020000;
public static final int icon=0x7f020001;
}
public static final class string {
public static final int app_name=0x7f030000;
}
public static final class style {
/**
Base application theme, dependent on API level. This theme is replaced
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.


Theme customizations available in newer API levels can go in
res/values-vXX/styles.xml, while customizations related to
backward-compatibility can go here.


Base application theme for API 11+. This theme completely replaces
AppBaseTheme from res/values/styles.xml on API 11+ devices.

API 11 theme customizations can go here.

Base application theme for API 14+. This theme completely replaces
AppBaseTheme from BOTH res/values/styles.xml and
res/values-v11/styles.xml on API 14+ devices.

API 14 theme customizations can go here.
*/
public static final int AppBaseTheme=0x7f040000;
/** Application theme.
All customizations that are NOT specific to a particular API-level can go here.
*/
public static final int AppTheme=0x7f040001;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package org.scorelab.sense.dataCollector.sms.observe;

import org.scorelab.sense.annotation.Attributes;

public class SmsObserveData {
@Attributes(primaryKey = true)
public String toAddress;
public String messageLength;
public String messageTimestamp;
@Attributes(primaryKey = true)
public String timestamp;
public String collectTimestamp;

public SmsObserveData(String toAddress, String messageLength, String messageTimestamp){

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
package org.scorelab.sense.dataCollector.sms.observe;

import java.math.BigInteger;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

import org.scorelab.sense.util.SenseLog;

import android.content.Context;
import android.database.ContentObserver;
import android.database.Cursor;
import android.net.Uri;
import android.os.Handler;

public class SmsObserveDataReader extends ContentObserver {

private MessageDigest sensMessageDigest;
Context context;

public SmsObserveDataReader(Handler handler) {
super(handler);
}

@Override
public void onChange(boolean selfChange) {
super.onChange(selfChange);

try {
sensMessageDigest = MessageDigest.getInstance("MD5");
} catch (NoSuchAlgorithmException e) {
SenseLog.w("NoSuchAlgorithmException Throws");
}

Uri sMSURI = Uri.parse("content://sms/");

Cursor cursor = context.getContentResolver().query(sMSURI, null, null,
null, null);

while (cursor.moveToNext()) {

String toAddress = cursor.getString(cursor
.getColumnIndex("address"));
int messageLength = cursor.getString(cursor.getColumnIndex("body"))
.length();
long messageTimestamp = cursor.getLong(cursor
.getColumnIndex("date"));

sensMessageDigest.reset();
byte[] fromAdressDigest = sensMessageDigest.digest(toAddress

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please have proper indentation.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.getBytes());
BigInteger bigIntegerOfFromAdress = new BigInteger(1,
fromAdressDigest);
String fromAddressHash = bigIntegerOfFromAdress.toString();
}

;

}

}