A-1
LAMPIRAN A : LISTING PROGRAM
1. Form Utama(MainActivity.java) import import import import import import
android.os.Bundle; android.view.View; android.view.View.OnClickListener; android.widget.Button; android.app.Activity; android.content.Intent;
public class MainActivity extends Activity { //Button tentang, bantuan; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); ((Button) findViewById(R.id.btnPesanbaru)).setOnClickListener(new OnClickListener() { public void onClick(View v) { MainActivity.this.startActivity(new Intent( MainActivity.this, BuatPesan.class)); } }); ((Button) findViewById(R.id.btnPesankeluar)).setOnClickListener(new OnClickListener() { public void onClick(View v) { Intent click = new Intent(MainActivity.this, DataPesan.class); click.putExtra("tipepesan", "sent"); startActivity(click); } }); ((Button) findViewById(R.id.btnPesanmasuk)).setOnClickListener(new OnClickListener() { public void onClick(View v) { Intent click = new Intent(MainActivity.this, DataPesan.class); click.putExtra("tipepesan", "inbox"); startActivity(click); } });
Universitas Sumatera Utara
A-2
((Button)findViewById(R.id.btnBantuan)).setOnClickListener(n ew OnClickListener() { @Override public void onClick(View arg0) { // TODO Auto-generated method stub Intent i = new Intent(MainActivity.this,bantuan.class); startActivity(i); } }); ((Button)findViewById(R.id.btnTentang)).setOnClickListener(n ew OnClickListener() { @Override public void onClick(View arg0) { // TODO Auto-generated method stub Intent i = new Intent(MainActivity.this,tentang.class); startActivity(i); } }); ((Button) findViewById(R.id.btnKeluar)).setOnClickListener(new OnClickListener() { public void onClick(View v) { Intent intent = new Intent(Intent.ACTION_MAIN); intent.addCategory(Intent.CATEGORY_HOME); intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(intent); System.exit(0); } }); } }
2. Form Buat Pesan Baru import import import import import import import import import
android.app.Activity; android.content.ContentValues; android.content.Intent; android.database.Cursor; android.net.Uri; android.opengl.Visibility; android.os.Bundle; android.provider.ContactsContract; android.provider.ContactsContract.CommonDataKinds.Phone;
Universitas Sumatera Utara
A-3
import import import import import import import import import import import import import
android.telephony.SmsManager; android.view.View; android.view.View.OnClickListener; android.widget.Button; android.widget.EditText; android.widget.ImageButton; android.widget.RadioButton; android.widget.RadioGroup; android.widget.Toast; java.io.UTFDataFormatException; java.nio.charset.Charset; java.security.Key; java.security.PublicKey;
import import import import
javax.crypto.Cipher; javax.crypto.spec.SecretKeySpec; javax.crypto.KeyGenerator; javax.crypto.SecretKey;
import org.xml.sax.Parser; public class BuatPesan extends Activity { EditText nomorKontak, text,hasilencrypt,kunci_a_enk,kunci_b_enk,kunciaes_enk,hasilenc ryptkunci; private static final Charset UTF8_CHARSET = Charset.forName("UTF-8"); // contact picker private static final int CONTACT_PICKER_RESULT = 1001; private long waktumulaiaes,waktuakhiraes,selisihaes,waktumulaiaffine,waktuak hiraffine,selisihaffine; final int tipe_enkripsi=128; public boolean pil_rad=true; // phonecontact public void doLaunchContactPicker(View view) { Uri uri = ContactsContract.CommonDataKinds.Phone.CONTENT_URI; Intent contactPickerIntent = new Intent(Intent.ACTION_PICK, uri); startActivityForResult(contactPickerIntent, CONTACT_PICKER_RESULT); } protected void onActivityResult(int requestCode, int resultCode, Intent data) { String phone = ""; Cursor contacts = null; try { if (resultCode == RESULT_OK) { switch (requestCode) { case CONTACT_PICKER_RESULT: // gets the uri of selected contact
Universitas Sumatera Utara
A-4
Uri result = data.getData(); // get the contact id from the Uri (last part is contact // id) String id = result.getLastPathSegment(); // queries the contacts DB for phone no contacts = getContentResolver().query( ContactsContract.CommonDataKinds.Phone.CONTENT_URI, null, ContactsContract.CommonDataKinds.Phone._ID + "=?", new String[] { id }, null); // gets index of phone no int phoneIdx = contacts.getColumnIndex(Phone.DATA); if (contacts.moveToFirst()) { // gets the phone no phone = contacts.getString(phoneIdx); EditText phoneTxt = (EditText) findViewById(R.id.nomorHp); // assigns phone no to EditText field phoneno phoneTxt.setText(phone); } else { Toast.makeText(this, "error", Toast.LENGTH_LONG).show(); } break; } } else { // gracefully handle failure Toast.makeText(BuatPesan.this, R.string.belumdipilih, Toast.LENGTH_SHORT).show(); } } catch (Exception e) { Toast.makeText(this, e.getMessage(), Toast.LENGTH_LONG).show(); } finally { if (contacts != null) { contacts.close(); } } } @Override public void onCreate(final Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.buatpesan); final ImageButton send = (ImageButton) findViewById(R.id.send); final Button encrypt = (Button) findViewById(R.id.encrypt);
Universitas Sumatera Utara
A-5
final Button encryptkunci = (Button) findViewById(R.id.encryptkunci); nomorKontak = (EditText) findViewById(R.id.nomorHp); hasilencrypt = (EditText) findViewById(R.id.hasilEncrypt); hasilencryptkunci = (EditText) findViewById(R.id.hasilEncryptkunci); kunci_a_enk = (EditText) findViewById(R.id.kunci_a_enk); kunci_b_enk = (EditText) findViewById(R.id.kunci_b_enk); kunciaes_enk = (EditText) findViewById(R.id.KunciAES_enk);
Intent i = getIntent(); if (i.getStringExtra("message") != null) { text.setText(i.getStringExtra("message")); } encryptkunci.setOnClickListener(new OnClickListener() { @Override public void onClick(View arg0) { // TODO Auto-generated method stub waktumulaiaffine=System.currentTimeMillis(); String ambilkunci=kunciaes_enk.getText().toString(); String enkunciaes=""; try { int a = Integer.parseInt(kunci_a_enk.getText().toString()) ; int b = Integer.parseInt(kunci_b_enk.getText().toString()) ; for (int i = 0; i < ambilkunci.length(); i++) { //CTxt = CTxt + (char) ((((a * Msg.charAt(i)) + b) % 26) + 65); yang asli enkunciaes = enkunciaes + (char) (((a * ambilkunci.charAt(i)) + b) % 128); //Msg.charAt(i)-->ASCII kalo di kalikan interger jadi angka //System.out.println("angka : "+(((a * Msg.charAt(i)) + b) % 128)); } waktuakhiraffine=System.currentTimeMillis(); hasilencryptkunci.setText(enkunciaes); selisihaffine=waktuakhiraffine-waktumulaiaffine; Toast.makeText(BuatPesan.this, "lama enkripsi affine "+Long.toString(selisihaffine),Toast.LENGTH_SHORT).show(); } catch (Exception e1) { Toast.makeText(BuatPesan.this, enkunciaes,
Universitas Sumatera Utara
A-6
Toast.LENGTH_SHORT).show(); e1.printStackTrace(); } } }); encrypt.setOnClickListener(new OnClickListener() { @Override public void onClick(View e) { String ambilKata = text.getText().toString(); String enKata = ""; try { if (kunciaes_enk.getText().toString()!="" && text.getText().toString()!="") { //String hasil1=null; waktumulaiaes = System.currentTimeMillis(); String keyaes_enk = kunciaes_enk.getText().toString(); enKata = Aes.encrypt(keyaes_enk,ambilKata,tipe_enkripsi); hasilencrypt.setText(enKata); waktuakhiraes = System.currentTimeMillis(); selisihaes = waktuakhiraeswaktumulaiaes; Toast.makeText(BuatPesan.this, "lama enkripsi aes "+Long.toString(selisihaes),Toast.LENGTH_SHORT).show(); } } catch (Exception e1) { Toast.makeText(BuatPesan.this, "Pesan dan kunci tidak boleh kosong", Toast.LENGTH_SHORT).show(); e1.printStackTrace(); } } }); send.setOnClickListener(new OnClickListener() { public void onClick(View v) { String pesan = hasilencrypt.getText().toString(); String nomor = nomorKontak.getText().toString(); if (pesan.length() > 0 && nomor.length() > 0) { try { // proses kirim sms SmsManager sms = SmsManager.getDefault(); sms.sendTextMessage(nomor, null, pesan, null, null); // proses simpan sms yang terkirim
Universitas Sumatera Utara
A-7
ContentValues values = new ContentValues(); values.put("address", nomor); values.put("body", pesan); getContentResolver().insert( Uri.parse("content://sms/sent"), values); Toast.makeText(BuatPesan.this, "Pesan berhasil dikirim", Toast.LENGTH_SHORT) .show(); finish(); } catch (Exception e) { Toast.makeText(BuatPesan.this, "Pesan gagal dikirim", Toast.LENGTH_SHORT).show(); e.printStackTrace(); } } else { Toast.makeText(BuatPesan.this, "Nomor atau Isi Pesan Masing Kosong", Toast.LENGTH_SHORT).show(); } } }); } }
3. Form Melihat List Pesan yang tersimpan di device (DataPesan.java) import java.util.Date; import java.text.DateFormat; import import import import import import import import import import import import import
android.app.Activity; android.content.ContentResolver; android.content.Intent; android.database.Cursor; android.net.Uri; android.os.Bundle; android.provider.ContactsContract; android.support.v4.widget.SimpleCursorAdapter; android.widget.AdapterView; android.widget.AdapterView.OnItemClickListener; android.widget.ListView; android.widget.TextView; android.view.View;
public class DataPesan extends Activity {
Universitas Sumatera Utara
A-8
private SimpleCursorAdapter dataAdapter; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.listpesan); displayListView(); } private void displayListView() { Intent i = getIntent(); Uri uriSMS = Uri .parse("content://sms/" + i.getStringExtra("tipepesan")); Cursor cursor = getContentResolver().query(uriSMS, null, null, null, null); String[] columns = new String[] { "address", "body", "date" }; int[] to = new int[] { R.id.pengirim, R.id.isipesan, R.id.waktu }; dataAdapter = new SimpleCursorAdapter(this, R.layout.pesan_row, cursor, columns, to, 0); ListView listView = (ListView) findViewById(R.id.listView1); dataAdapter.setViewBinder(new SimpleCursorAdapter.ViewBinder() { @Override public boolean setViewValue(View view, Cursor cursor, int columnIndex) { // ubah nomer hape dengan nama yang ada dikontak if (columnIndex == 2) { TextView tv = (TextView) view; String pengirimDB = cursor.getString(cursor .getColumnIndex("address")); // get contact name Uri contactUri = Uri.withAppendedPath( ContactsContract.PhoneLookup.CONTENT_FILTER_URI, Uri.encode(pengirimDB)); Cursor cur = getContentResolver().query(contactUri, null, null, null, null); ContentResolver contect_resolver = getContentResolver(); int size = cur.getCount(); if (size > 0 && cur != null) { for (int i = 0; i < size; i++) { cur.moveToPosition(i);
Universitas Sumatera Utara
A-9
String id1 = cur.getString(cur .getColumnIndexOrThrow(ContactsContract.Contacts._ID)); Cursor phoneCur = contect_resolver .query(contactUri, null, ContactsContract.CommonDataKinds.Phone.CONTACT_ID + " = ?", new String[] { id1 }, null); if (phoneCur.moveToFirst()) { String namaKontak = phoneCur.getString(phoneCur .getColumnIndex(ContactsContract.CommonDataKinds.Phone.DISPL AY_NAME)); phoneCur.close(); tv.setText(namaKontak); } else { tv.setText(pengirimDB); } } cur.close(); } else { tv.setText(pengirimDB); } return true; } // konversi tanggal if (columnIndex == 4) { TextView tv = (TextView) view; String waktu = cursor.getString(cursor .getColumnIndex("date")); long l = Long.parseLong(waktu); Date d = new Date(l); String date = DateFormat.getDateInstance(DateFormat.LONG) .format(d); String time = DateFormat.getTimeInstance().format(d); String view_waktu = date + " " + time; tv.setText(view_waktu); return true; } return false; }
Universitas Sumatera Utara
A-10
}); // menampilkan daftar pesan listView.setAdapter(dataAdapter); // jika di pesan di klik, maka akan dialihkan ke lihat pesan secara full listView.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView> listView, View view, int position, long id) { // Get the cursor, positioned to the corresponding row in the // result set Cursor cursor = (Cursor) listView.getItemAtPosition(position); // Get the state's capital from this row in the database. String view_pengirim = cursor.getString(cursor .getColumnIndexOrThrow("address")); String view_isipesan = cursor.getString(cursor .getColumnIndexOrThrow("body")); String waktu = cursor.getString(cursor .getColumnIndexOrThrow("date")); // konversi tanggal long l = Long.parseLong(waktu); Date d = new Date(l); String date = DateFormat.getDateInstance(DateFormat.LONG) .format(d); String time = DateFormat.getTimeInstance().format(d); String view_waktu = date + " " + time; String view_idpesan = cursor.getString(cursor .getColumnIndexOrThrow("_id")); String view_thread = cursor.getString(cursor .getColumnIndexOrThrow("thread_id")); Intent click = new Intent(DataPesan.this, LihatPesan.class); // get contact name Uri contactUri = Uri.withAppendedPath( ContactsContract.PhoneLookup.CONTENT_FILTER_URI, Uri.encode(view_pengirim)); Cursor cur = getContentResolver().query(contactUri, null, null, null, null); ContentResolver contect_resolver = getContentResolver(); int size = cur.getCount(); if (size > 0 && cur != null) {
Universitas Sumatera Utara
A-11
for (int i = 0; i < size; i++) { cur.moveToPosition(i); String id1 = cur.getString(cur .getColumnIndexOrThrow(ContactsContract.Contacts._ID)); Cursor phoneCur = contect_resolver .query(contactUri, null, ContactsContract.CommonDataKinds.Phone.CONTACT_ID + " = ?", new String[] { id1 }, null); if (phoneCur.moveToFirst()) { String namaKontak = phoneCur.getString(phoneCur .getColumnIndex(ContactsContract.CommonDataKinds.Phone.DISPL AY_NAME)); phoneCur.close(); click.putExtra("no", namaKontak); } else { click.putExtra("no", view_pengirim); } } cur.close(); } else { click.putExtra("no", view_pengirim); } // kirim data ke view pesan click.putExtra("msg", view_isipesan); click.putExtra("idpesan", view_idpesan); click.putExtra("idthread", view_thread); click.putExtra("date", view_waktu); Intent i = getIntent(); click.putExtra("asal", i.getStringExtra("tipepesan")); startActivity(click); } }); } @Override public void onBackPressed() { Intent link = new Intent(DataPesan.this, MainActivity.class); startActivity(link); finish();
Universitas Sumatera Utara
A-12
} }
4. Class enkripsi dan dekripsi AES (Aes.java) import java.security.SecureRandom; import import import import
javax.crypto.Cipher; javax.crypto.KeyGenerator; javax.crypto.SecretKey; javax.crypto.spec.SecretKeySpec;
public class Aes { public static String encrypt(String kunci, String plaintext, int tipe) throws Exception { byte[] rawKey = rawKey(kunci.getBytes(),tipe); byte[] hasil = encrypt(rawKey,plaintext.getBytes()); return k_hexa(hasil); } public static String decrypt(String kunci, String plaintext, int tipe) throws Exception { byte[] rawKey = rawKey(kunci.getBytes(), tipe); byte[] enc = k_byte(plaintext); byte[] result = decrypt(rawKey, enc); return new String(result); } private static byte[] encrypt(byte[] raw, byte[] clear) throws Exception { SecretKeySpec s_kunci_rahasia = new SecretKeySpec(raw, "AES"); Cipher cipher = Cipher.getInstance("AES"); cipher.init(Cipher.ENCRYPT_MODE, s_kunci_rahasia); byte[] encrypted = cipher.doFinal(clear); return encrypted; } private static byte[] decrypt(byte[] raw, byte[] encrypted) throws Exception { SecretKeySpec s_kunci_rahasia = new SecretKeySpec(raw, "AES"); Cipher cipher = Cipher.getInstance("AES"); cipher.init(Cipher.DECRYPT_MODE, s_kunci_rahasia); byte[] decrypted = cipher.doFinal(encrypted); return decrypted; } private static byte[] rawKey(byte[] kunci,int tipe) throws Exception { KeyGenerator kunci_gen = KeyGenerator.getInstance("AES"); SecureRandom acak = SecureRandom.getInstance("SHA1PRNG","Crypto"); acak.setSeed(kunci); kunci_gen.init(tipe, acak);
Universitas Sumatera Utara
A-13
SecretKey kunci_rahasia = kunci_gen.generateKey(); byte[] raw = kunci_rahasia.getEncoded(); return raw; } public static String d_hexa(String hexa) { return new String(k_byte(hexa)); } public static String k_hexa(byte[] buffer) { if (buffer == null) { return ""; } StringBuffer hasil = new StringBuffer(2 * buffer.length); for (int i = 0; i < buffer.length; i++) { appendHex(hasil, buffer[i]); } return hasil.toString(); } public static byte[] k_byte(String hexa_string) { int panjang = hexa_string.length() / 2; byte[] hasil = new byte[panjang]; for (int i = 0; i < panjang; i++) { hasil[i] = Integer.valueOf(hexa_string.substring(2 * i,2 * i + 2),16).byteValue(); } return hasil; } private final static String hexa = "0123456789ABCDEF"; private static void appendHex(StringBuffer str_buffer, byte b) { str_buffer.append(hexa.charAt((b >> 4) & 0x0f)).append(hexa.charAt(b & 0x0f)); } }
5. Form untuk membaca pesan masuk/keluar dan untuk dekripsi (LihatPesan.java) import import import import import import import import
android.app.Activity; android.content.DialogInterface; android.content.Intent; android.net.Uri; android.os.Bundle; android.view.View; android.view.View.OnClickListener; android.widget.Button;
Universitas Sumatera Utara
A-14
import import import import import import
android.widget.EditText; android.widget.RadioButton; android.widget.TextView; android.widget.Toast; java.io.UTFDataFormatException; java.nio.charset.Charset;
public class LihatPesan extends Activity { private static final Charset UTF8_CHARSET = Charset.forName("UTF-8"); final int tipe_enkripsi=128; private long selisihaes,waktuawalaes,waktuakhiraes,selisihaffine,waktuawa laffine,waktuakhiraffine,selisihtotal; TextView number, date, msg,hasilDekripsi; Button forward, hapus,dekripsi,dekripsikunci,btndekripaes; EditText kunci_a_dek,kunci_b_dek,kunciaes_Dek,hasildekkunciaes; public boolean pil_rad=true; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.lihatpesan); number = (TextView) findViewById(R.id.tvNumber); date = (TextView) findViewById(R.id.tvDate); msg = (TextView) findViewById(R.id.tvMsg); hasilDekripsi = (TextView) findViewById(R.id.hasildekrip); dekripsi = (Button) findViewById(R.id.dekripsiBtn); forward = (Button) findViewById(R.id.btFrd); btndekripaes=(Button) findViewById(R.id.btnDekripkunci); hapus = (Button) findViewById(R.id.hapus); kunci_a_dek = (EditText) findViewById(R.id.kunci_a_dek); kunci_b_dek = (EditText) findViewById(R.id.kunci_b_dek); hasildekkunciaes=(EditText) findViewById(R.id.hasildekkunciaes); kunciaes_Dek = (EditText) findViewById(R.id.kunciaes_dek); kunci_a_dek.setVisibility(View.VISIBLE); kunci_b_dek.setVisibility(View.VISIBLE); kunciaes_Dek.setVisibility(View.VISIBLE); hasildekkunciaes.setVisibility(View.VISIBLE); btndekripaes.setVisibility(View.VISIBLE); btndekripaes.setOnClickListener(new OnClickListener() { @Override public void onClick(View arg0) { // TODO Auto-generated method stub
Universitas Sumatera Utara
A-15
int a_inv = 0; int flag = 0; waktuawalaffine=System.currentTimeMillis(); String ambilKata = kunciaes_Dek.getText().toString(); String deKata = ""; try { //enKata = GenerateAES.encrypt(ambilKunci, ambilKata); int a = Integer.parseInt(kunci_a_dek.getText().toString()) ; int b = Integer.parseInt(kunci_b_dek.getText().toString()) ; for (int i = 0; i < 128; i++) { flag = (a * i) % 128; if (flag == 1) { a_inv = i; System.out.println(i); } } for (int i = 0; i < ambilKata.length(); i++) { int nilai=a_inv*(ambilKata.charAt(i)-b); int mod=128; //if (a_inv*(CTxt.charAt(i)-b)>0) while (nilai<=0) { nilai=nilai+128; mod=mod+128; } deKata = deKata + (char) (nilai % mod); //System.out.println("nilai = "+ ((a_inv * (CTxt.charAt(i) b)) % 128)+" "+a_inv); }
Universitas Sumatera Utara
A-16
waktuakhiraffine=System.currentTimeMillis(); hasildekkunciaes.setText(deKata); selisihaffine=waktuawalaffine-waktuawalaffine; Toast.makeText(LihatPesan.this, "lama dekripsi affine "+Long.toString(selisihaffine),Toast.LENGTH_SHORT).show(); } catch (Exception e) {hasilDekripsi.setText("kunci tidak memenuhi GCD atau tidak memenuhi syarat inversi modulo ");} } }); dekripsi.setOnClickListener(new OnClickListener() { @Override public void onClick(View arg0) { int a_inv = 0; int flag = 0; String ambilKata = msg.getText().toString(); String deKata = ""; try { //enKata = GenerateAES.encrypt(ambilKunci, ambilKata); if (pil_rad==true) { if (hasildekkunciaes.getText().toString()!="") { waktuawalaes=System.currentTimeMillis(); String hasil2e=null; String keyaes_dek = hasildekkunciaes.getText().toString(); hasil2e = Aes.decrypt(keyaes_dek,ambilKata,tipe_enkripsi); waktuakhiraes=System.currentTimeMillis(); hasilDekripsi.setText(hasil2e); selisihaes=(waktuakhiraes-waktuawalaes); selisihtotal=selisihaes+selisihaffine; Toast.makeText(LihatPesan.this, "waktu dekripsi aes affine "+Long.toString(selisihtotal),Toast.LENGTH_SHORT).show(); }
Universitas Sumatera Utara
A-17
else{ Toast.makeText(LihatPesan.this, "CipherText Kunci AES masih kosong",Toast.LENGTH_SHORT).show(); } } else if (pil_rad==false) { waktuawalaes=System.currentTimeMillis(); String hasil2=null; String keyaes_dek = kunciaes_Dek.getText().toString(); hasil2 = Aes.decrypt(keyaes_dek,ambilKata,tipe_enkripsi); waktuakhiraes=System.currentTimeMillis(); hasilDekripsi.setText(hasil2); selisihaes=waktuakhiraes-waktuawalaes; Toast.makeText(LihatPesan.this, "waktu dekrips aes "+Long.toString(selisihaes),Toast.LENGTH_SHORT).show(); } } catch (Exception e) {hasilDekripsi.setText("kunci tidak memenuhi GCD atau tidak memenuhi syarat inversi modulo ");} } }); } @Override protected void onStart() { super.onStart(); Intent i = getIntent(); number.setText(i.getStringExtra("no")); date.setText(i.getStringExtra("date")); msg.setText(i.getStringExtra("msg")); forward.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { Intent click = new Intent(LihatPesan.this, BuatPesan.class); click.putExtra("message", msg.getText()); startActivity(click); } }); hapus.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { Dialogs.showConfirmation(LihatPesan.this,
Universitas Sumatera Utara
A-18
R.string.hapuspesan_dialog, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { Intent i = getIntent(); String id_pesan_hapus = i .getStringExtra("idpesan"); String id_thread_hapus = i .getStringExtra("idthread"); // hapus pesan Uri deleteUri = Uri.parse("content://sms"); getContentResolver() .delete(deleteUri, "thread_id=? and _id=?", new String[] { String.valueOf(id_thread_hapus), String.valueOf(id_pesan_hapus) }); finish(); Toast.makeText(LihatPesan.this, "Pesan Terhapus", Toast.LENGTH_SHORT) .show(); // redirect data pesan onBackPressed(); } }); } }); } public void onRadioButtonCliked(View r) { boolean checked = ((RadioButton) r).isChecked();
Universitas Sumatera Utara
A-19
switch (r.getId()) { case R.id.radioButtonAESaffine: if (checked) { kunci_a_dek.setVisibility(View.VISIBLE); kunci_b_dek.setVisibility(View.VISIBLE); kunciaes_Dek.setVisibility(View.VISIBLE); hasildekkunciaes.setVisibility(View.VISIBLE); btndekripaes.setVisibility(View.VISIBLE); kunciaes_Dek.setVisibility(View.VISIBLE); kunciaes_Dek.setHint("Masukkan CipherKey AES"); kunciaes_Dek.setText(""); hasildekkunciaes.setText(""); pil_rad=true; } break; case R.id.radioButtonAES: if (checked) { kunciaes_Dek.setVisibility(View.VISIBLE); kunci_a_dek.setVisibility(View.INVISIBLE); kunci_b_dek.setVisibility(View.INVISIBLE); btndekripaes.setVisibility(View.INVISIBLE); hasildekkunciaes.setVisibility(View.INVISIBLE); kunciaes_Dek.setHint("Kunci (Max 16)"); kunci_a_dek.setText(""); kunci_b_dek.setText(""); kunciaes_Dek.setText(""); hasildekkunciaes.setText(""); pil_rad=false; } break; } } @Override public void onBackPressed() { Intent link = new Intent(LihatPesan.this, DataPesan.class); Intent i = getIntent(); link.putExtra("tipepesan", i.getStringExtra("asal")); startActivity(link); } }
Universitas Sumatera Utara
A-20
6. Form tentang (tentang.java) import android.app.Activity; import android.os.Bundle; public class tentang extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.tentang);
} }
7. Form batuan (bantuan.java) import android.app.Activity; import android.os.Bundle; public class bantuan extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.bantuan);
} }
Universitas Sumatera Utara
A-21
LAMPIRAN B : CURRICULUM VITAE
Nama
: Hari Rahman Nihe
Alamat Sekarang
: Jln. Ardagusema No.61 Delitua-Medan
Alamat Orang Tua
: Jln. Ardagusema No.61 Delitua-Medan
Telp/ Hp
: 085766452455
Email
:
[email protected]
Riwayat Pendidikan 2011 – 2015 2007 – 2010 2004 – 2007 1998 – 2004 1997 – 1998
: S-1 Ilmu Komputer Universitas Sumatera Utara, Medan : SMA Negeri 1, Delitua : SMP Negeri 1, Delitua : SD 101799, Delitua : TK Tri Sandya Yudha Yon Armed 2 Deli Serdang
Keahlian Bahasa
: Indonesia, Inggris
Bahasa Pemrograman : C#.NET, Vb, C++, Java,C. Database
: Microsoft Access, Mysql, Oracle.
Design
: Photoshop, Corel Draw, Ilustrator
Pengalaman Organisasi [2008 – 2009] OSIS SMA Negeri 1 Delitua [2012 – 2013] Anggota Syiar UKMI AL-KHUWARIZMI [2014 –2015] Deputi Kemenlu PEMA USU [2013 – 2015] Asisten Laboratory IKLC(Ilmu Komputer Laboratory Center) [2014 – 2015] Anggota Kominfo IMILKOM 2014 - 2015
Universitas Sumatera Utara
A-22
Pengalaman Kepanitiaan [2013]
Anggota Bidang Dana dan Usaha PORSENI IMILKOM 2013
[2013]
Anggota Bidang Konsumsi PMB IMILKOM 2013
[2014]
Ketua Penerimaan Asisten Lab pada Tahun 2014
Universitas Sumatera Utara