use of com.secupwn.aimsicd.data.model.SmsData in project Android-IMSI-Catcher-Detector by CellularPrivacy.
the class AdvancedUserSmsActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
realm = Realm.getDefaultInstance();
dbaccess = new RealmHelper(getApplicationContext());
RealmResults<SmsData> msgitems = realm.where(SmsData.class).findAllSorted("timestamp");
listViewAdv.setAdapter(new SmsDataAdapter(getApplicationContext(), msgitems));
listViewAdv.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() {
@Override
public boolean onItemLongClick(AdapterView<?> a, View v, int position, long id) {
final SmsData smsData = (SmsData) listViewAdv.getItemAtPosition(position);
realm.executeTransaction(new Realm.Transaction() {
@Override
public void execute(Realm realm) {
smsData.deleteFromRealm();
}
});
Toast.makeText(a.getContext(), "Deleted Sms", LENGTH_SHORT).show();
return true;
}
});
}
use of com.secupwn.aimsicd.data.model.SmsData in project Android-IMSI-Catcher-Detector by CellularPrivacy.
the class SmsDetector method parseMwiSms.
private void parseMwiSms(String[] logcatLines, Date logcat_timestamp) {
@Cleanup Realm realm = Realm.getDefaultInstance();
long count = realm.where(SmsData.class).equalTo("timestamp", logcat_timestamp).count();
// Only alert if the timestamp is not in the data base
if (count == 0) {
realm.beginTransaction();
SmsData capturedSms = realm.createObject(SmsData.class);
String smsText = findSmsData(logcatLines, null);
String num = findSmsNumber(logcatLines, null);
capturedSms.setSenderNumber(num);
capturedSms.setMessage(smsText);
capturedSms.setTimestamp(logcat_timestamp);
capturedSms.setType("MWI");
setCurrentLocationData(null, capturedSms);
realm.commitTransaction();
mDbAdapter.toEventLog(realm, 4, "Detected MWI SMS");
startPopUpInfo(SmsType.MWI);
} else {
log.debug("Detected Sms already logged");
}
}
use of com.secupwn.aimsicd.data.model.SmsData in project Android-IMSI-Catcher-Detector by CellularPrivacy.
the class SmsDetector method parseTypeZeroSms.
private void parseTypeZeroSms(String[] bufferLines, Date logcat_timestamp) {
@Cleanup Realm realm = Realm.getDefaultInstance();
long count = realm.where(SmsData.class).equalTo("timestamp", logcat_timestamp).count();
// Only alert if the timestamp is not in the data base
if (count == 0) {
realm.beginTransaction();
SmsData capturedSms = realm.createObject(SmsData.class);
String smsText = findSmsData(bufferLines, null);
String num = findSmsNumber(bufferLines, null);
capturedSms.setSenderNumber(num);
capturedSms.setMessage(smsText);
capturedSms.setTimestamp(logcat_timestamp);
capturedSms.setType("TYPE0");
setCurrentLocationData(realm, capturedSms);
realm.commitTransaction();
mDbAdapter.toEventLog(realm, 3, "Detected Type-0 SMS");
startPopUpInfo(SmsType.SILENT);
} else {
log.debug("Detected Sms already logged");
}
}
use of com.secupwn.aimsicd.data.model.SmsData in project Android-IMSI-Catcher-Detector by CellularPrivacy.
the class SmsDetector method parseWapPushSms.
private void parseWapPushSms(String[] logcatLines, String[] postWapMessageLines, Date logcat_timestamp) {
@Cleanup Realm realm = Realm.getDefaultInstance();
long count = realm.where(SmsData.class).equalTo("timestamp", logcat_timestamp).count();
// Only alert if the timestamp is not in the data base
if (count == 0) {
realm.beginTransaction();
SmsData capturedSms = realm.createObject(SmsData.class);
String smsText = findSmsData(logcatLines, postWapMessageLines);
String num = findSmsNumber(logcatLines, postWapMessageLines);
capturedSms.setSenderNumber(num);
capturedSms.setMessage(smsText);
capturedSms.setTimestamp(logcat_timestamp);
capturedSms.setType("WAPPUSH");
setCurrentLocationData(realm, capturedSms);
realm.commitTransaction();
mDbAdapter.toEventLog(realm, 6, "Detected WAPPUSH SMS");
startPopUpInfo(SmsType.WAP_PUSH);
} else {
log.debug("Detected SMS already logged");
}
}
Aggregations