use of com.secupwn.aimsicd.ui.fragments.DeviceFragment in project Android-IMSI-Catcher-Detector by CellularPrivacy.
the class MainActivity method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
deviceFragment = new DeviceFragment();
cellInfoFragment = new CellInfoFragment();
atCommandFragment = new AtCommandFragment();
dbViewerFragment = new DbViewerFragment();
mapFragment = new MapFragment();
mNavConf = new DrawerMenuActivityConfiguration.Builder(this).build();
mDrawerLayout = (DrawerLayout) findViewById(mNavConf.getDrawerLayoutId());
mDrawerList = (ListView) findViewById(mNavConf.getLeftDrawerId());
mActionBar = getSupportActionBar();
mTitle = getTitle();
mDrawerTitle = getTitle();
mDrawerList.setAdapter(mNavConf.getBaseAdapter());
mDrawerToggle = new ActionBarDrawerToggle(this, /* host Activity */
mDrawerLayout, /* DrawerLayout object */
R.string.drawer_open, /* "open drawer" description */
R.string.drawer_close) {
/* "close drawer" description */
public void onDrawerClosed(View view) {
super.onDrawerClosed(view);
mActionBar.setTitle(mTitle);
invalidateOptionsMenu();
}
public void onDrawerOpened(View drawerView) {
super.onDrawerOpened(drawerView);
mActionBar.setTitle(mDrawerTitle);
invalidateOptionsMenu();
}
};
// Set the drawer toggle as the DrawerListener
mDrawerList.setOnItemClickListener(new DrawerItemClickListener());
mDrawerLayout.setDrawerListener(mDrawerToggle);
mActionBar.setDisplayHomeAsUpEnabled(true);
mActionBar.setHomeButtonEnabled(true);
prefs = getSharedPreferences(AimsicdService.SHARED_PREFERENCES_BASENAME, 0);
/* Pref listener to enable sms detection on pref change */
prefListener = new SharedPreferences.OnSharedPreferenceChangeListener() {
public void onSharedPreferenceChanged(SharedPreferences prefs, String key) {
if (key.equals(getString(R.string.adv_user_root_pref_key))) {
SmsDetection();
}
}
};
prefs.registerOnSharedPreferenceChangeListener(prefListener);
mDisclaimerAccepted = getResources().getString(R.string.disclaimer_accepted);
if (!prefs.getBoolean(mDisclaimerAccepted, false)) {
final AlertDialog.Builder disclaimer = new AlertDialog.Builder(this).setTitle(R.string.disclaimer_title).setMessage(R.string.disclaimer).setPositiveButton(R.string.text_agree, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
prefsEditor = prefs.edit();
prefsEditor.putBoolean(mDisclaimerAccepted, true);
prefsEditor.apply();
startService();
}
}).setNegativeButton(R.string.text_disagree, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
prefsEditor = prefs.edit();
prefsEditor.putBoolean(mDisclaimerAccepted, false);
prefsEditor.apply();
Uri packageUri = Uri.parse("package:com.SecUpwN.AIMSICD");
Intent uninstallIntent = new Intent(Intent.ACTION_DELETE, packageUri);
startActivity(uninstallIntent);
finish();
if (mAimsicdService != null) {
mAimsicdService.onDestroy();
}
}
});
AlertDialog disclaimerAlert = disclaimer.create();
disclaimerAlert.show();
} else {
startService();
}
}
Aggregations