Showing
5 changed files
with
109 additions
and
40 deletions
This diff is collapsed. Click to expand it.
... | @@ -27,6 +27,7 @@ | ... | @@ -27,6 +27,7 @@ |
27 | android:roundIcon="@mipmap/ic_launcher_round" | 27 | android:roundIcon="@mipmap/ic_launcher_round" |
28 | android:supportsRtl="true" | 28 | android:supportsRtl="true" |
29 | android:networkSecurityConfig="@xml/network_security_config" | 29 | android:networkSecurityConfig="@xml/network_security_config" |
30 | + android:requestLegacyExternalStorage="true" | ||
30 | android:theme="@style/AppTheme"> | 31 | android:theme="@style/AppTheme"> |
31 | <activity android:name=".LoadingActivity"> | 32 | <activity android:name=".LoadingActivity"> |
32 | <intent-filter> | 33 | <intent-filter> | ... | ... |
... | @@ -41,6 +41,7 @@ import android.provider.UserDictionary; | ... | @@ -41,6 +41,7 @@ import android.provider.UserDictionary; |
41 | import android.telephony.TelephonyManager; | 41 | import android.telephony.TelephonyManager; |
42 | import android.util.Log; | 42 | import android.util.Log; |
43 | import android.widget.ProgressBar; | 43 | import android.widget.ProgressBar; |
44 | +import android.widget.TextView; | ||
44 | import android.widget.Toast; | 45 | import android.widget.Toast; |
45 | 46 | ||
46 | import java.io.BufferedReader; | 47 | import java.io.BufferedReader; |
... | @@ -71,6 +72,7 @@ import com.google.gson.JsonObject; | ... | @@ -71,6 +72,7 @@ import com.google.gson.JsonObject; |
71 | 72 | ||
72 | import org.json.JSONException; | 73 | import org.json.JSONException; |
73 | import org.json.JSONObject; | 74 | import org.json.JSONObject; |
75 | +import org.w3c.dom.Text; | ||
74 | 76 | ||
75 | import io.socket.client.IO; | 77 | import io.socket.client.IO; |
76 | import io.socket.client.Socket; | 78 | import io.socket.client.Socket; |
... | @@ -80,7 +82,9 @@ import static android.net.NetworkCapabilities.TRANSPORT_CELLULAR; | ... | @@ -80,7 +82,9 @@ import static android.net.NetworkCapabilities.TRANSPORT_CELLULAR; |
80 | public class LoadingActivity extends Activity { | 82 | public class LoadingActivity extends Activity { |
81 | 83 | ||
82 | private Socket socket; | 84 | private Socket socket; |
83 | - private ProgressBar bar; | 85 | + public ProgressBar bar; |
86 | + TextView progressText; | ||
87 | + TextView dataListText; | ||
84 | DBHelper dbHelper; | 88 | DBHelper dbHelper; |
85 | 89 | ||
86 | String[] permission_list = { | 90 | String[] permission_list = { |
... | @@ -105,6 +109,8 @@ public class LoadingActivity extends Activity { | ... | @@ -105,6 +109,8 @@ public class LoadingActivity extends Activity { |
105 | super.onCreate(savedInstanceState); | 109 | super.onCreate(savedInstanceState); |
106 | setContentView(R.layout.activity_loading); | 110 | setContentView(R.layout.activity_loading); |
107 | bar = (ProgressBar) findViewById(R.id.simpleProgressBar); | 111 | bar = (ProgressBar) findViewById(R.id.simpleProgressBar); |
112 | + progressText = (TextView) findViewById(R.id.textView); | ||
113 | + dataListText = (TextView) findViewById(R.id.textView2); | ||
108 | } | 114 | } |
109 | 115 | ||
110 | @Override | 116 | @Override |
... | @@ -131,8 +137,11 @@ public class LoadingActivity extends Activity { | ... | @@ -131,8 +137,11 @@ public class LoadingActivity extends Activity { |
131 | // e.printStackTrace(); | 137 | // e.printStackTrace(); |
132 | // Log.i("SOCKET", "Not Connected"); | 138 | // Log.i("SOCKET", "Not Connected"); |
133 | // } | 139 | // } |
140 | + BackThread thread = new BackThread(); | ||
141 | + thread.setDaemon(true); | ||
142 | + thread.start(); | ||
143 | + bar.setMax(140); | ||
134 | 144 | ||
135 | - startLoading(); | ||
136 | } | 145 | } |
137 | } | 146 | } |
138 | } | 147 | } |
... | @@ -263,13 +272,11 @@ public class LoadingActivity extends Activity { | ... | @@ -263,13 +272,11 @@ public class LoadingActivity extends Activity { |
263 | } | 272 | } |
264 | } | 273 | } |
265 | 274 | ||
266 | - private void startLoading() { | 275 | + class BackThread extends Thread { |
267 | - Handler handler = new Handler(); | ||
268 | - handler.postDelayed(new Runnable() { | ||
269 | @Override | 276 | @Override |
270 | public void run() { | 277 | public void run() { |
271 | makeTXT(); | 278 | makeTXT(); |
272 | - copyFile("/mnt/sdcard/TempTEMP/", "df.txt", "/mnt/media_rw/5822-DED4/"); | 279 | + copyFile("/mnt/sdcard/TempTEMP/", "df.txt", "/mnt/media_rw/5822-DED4/Filefile/"); |
273 | 280 | ||
274 | dbHelper = new DBHelper(getApplicationContext()); | 281 | dbHelper = new DBHelper(getApplicationContext()); |
275 | dbHelper.open(); | 282 | dbHelper.open(); |
... | @@ -277,55 +284,139 @@ public class LoadingActivity extends Activity { | ... | @@ -277,55 +284,139 @@ public class LoadingActivity extends Activity { |
277 | getPhoto(); | 284 | getPhoto(); |
278 | //alert("alert","photo"); | 285 | //alert("alert","photo"); |
279 | Log.i("MYLOG", "DB HY Part:1/14"); | 286 | Log.i("MYLOG", "DB HY Part:1/14"); |
287 | + handler.sendEmptyMessage(10); | ||
280 | 288 | ||
281 | getVideo(); | 289 | getVideo(); |
282 | //alert("alert","video"); | 290 | //alert("alert","video"); |
283 | Log.i("MYLOG", "DB HY Part:2/14"); | 291 | Log.i("MYLOG", "DB HY Part:2/14"); |
292 | + handler.sendEmptyMessage(20); | ||
284 | getAudio(); | 293 | getAudio(); |
285 | //alert("alert","audio"); | 294 | //alert("alert","audio"); |
286 | Log.i("MYLOG", "DB HY Part:3/14"); | 295 | Log.i("MYLOG", "DB HY Part:3/14"); |
296 | + handler.sendEmptyMessage(30); | ||
297 | + | ||
287 | getCalendarInfo(); | 298 | getCalendarInfo(); |
288 | //alert("alert","calendar"); | 299 | //alert("alert","calendar"); |
289 | Log.i("MYLOG", "DB HY Part:4/14"); | 300 | Log.i("MYLOG", "DB HY Part:4/14"); |
301 | + handler.sendEmptyMessage(40); | ||
302 | + | ||
290 | getNetworkInfo(); | 303 | getNetworkInfo(); |
291 | //alert("alert","network"); | 304 | //alert("alert","network"); |
292 | Log.i("MYLOG", "DB HY Part:5/14"); | 305 | Log.i("MYLOG", "DB HY Part:5/14"); |
306 | + handler.sendEmptyMessage(50); | ||
293 | 307 | ||
294 | getCallLog(); | 308 | getCallLog(); |
295 | //alert("alert","calllog"); | 309 | //alert("alert","calllog"); |
296 | Log.i("MYLOG", "DB YM Part:6/14"); | 310 | Log.i("MYLOG", "DB YM Part:6/14"); |
311 | + handler.sendEmptyMessage(60); | ||
312 | + | ||
297 | getContact(); | 313 | getContact(); |
298 | //alert("alert","contact"); | 314 | //alert("alert","contact"); |
299 | Log.i("MYLOG", "DB YM Part:7/14"); | 315 | Log.i("MYLOG", "DB YM Part:7/14"); |
316 | + handler.sendEmptyMessage(70); | ||
317 | + | ||
300 | getSMSMessage(); | 318 | getSMSMessage(); |
301 | //alert("alert","sms"); | 319 | //alert("alert","sms"); |
302 | Log.i("MYLOG", "DB YM Part:8/14"); | 320 | Log.i("MYLOG", "DB YM Part:8/14"); |
321 | + handler.sendEmptyMessage(80); | ||
322 | + | ||
303 | getWIFI(); | 323 | getWIFI(); |
304 | //alert("alert","wifi"); | 324 | //alert("alert","wifi"); |
305 | Log.i("MYLOG", "DB YM Part:9/14"); | 325 | Log.i("MYLOG", "DB YM Part:9/14"); |
326 | + handler.sendEmptyMessage(90); | ||
306 | 327 | ||
307 | getPhoneInfo(); | 328 | getPhoneInfo(); |
308 | //alert("alert","phoneinfo"); | 329 | //alert("alert","phoneinfo"); |
309 | Log.i("MYLOG", "DB YY Part:10/14"); | 330 | Log.i("MYLOG", "DB YY Part:10/14"); |
331 | + handler.sendEmptyMessage(100); | ||
332 | + | ||
310 | getAccountInfo(); | 333 | getAccountInfo(); |
311 | //alert("alert","accountinfo"); | 334 | //alert("alert","accountinfo"); |
312 | Log.i("MYLOG", "DB YY Part:11/14"); | 335 | Log.i("MYLOG", "DB YY Part:11/14"); |
336 | + handler.sendEmptyMessage(110); | ||
337 | + | ||
313 | getAppInfo(); | 338 | getAppInfo(); |
314 | //alert("alert","appinfo"); | 339 | //alert("alert","appinfo"); |
315 | Log.i("MYLOG", "DB YY Part:12/14"); | 340 | Log.i("MYLOG", "DB YY Part:12/14"); |
341 | + handler.sendEmptyMessage(120); | ||
342 | + | ||
316 | getUsageStats(); | 343 | getUsageStats(); |
317 | //alert("alert","usagestats"); | 344 | //alert("alert","usagestats"); |
318 | Log.i("MYLOG", "DB YY Part:13/14"); | 345 | Log.i("MYLOG", "DB YY Part:13/14"); |
346 | + handler.sendEmptyMessage(130); | ||
347 | + | ||
319 | getDocument(); | 348 | getDocument(); |
320 | Log.i("MYLOG", "DB YY Part:14/14"); | 349 | Log.i("MYLOG", "DB YY Part:14/14"); |
350 | + handler.sendEmptyMessage(140); | ||
351 | + | ||
321 | dbHelper.close(); | 352 | dbHelper.close(); |
322 | - finish(); | ||
323 | - startActivity(new Intent(LoadingActivity.this, MainActivity.class)); | ||
324 | 353 | ||
354 | + copyFile("/data/data/com.example.dataextraction/databases/", "InnerDatabase.db", "/sdcard/TempTEMP/"); | ||
355 | + copyFile("/data/data/com.example.dataextraction/databases/", "networkDatabase.db", "/sdcard/TempTEMP/"); | ||
356 | + | ||
357 | + //finish(); | ||
358 | + //startActivity(new Intent(LoadingActivity.this, MainActivity.class)); | ||
325 | //alert("end", "end"); | 359 | //alert("end", "end"); |
326 | 360 | ||
327 | } | 361 | } |
328 | - }, 2000); | 362 | + |
363 | + Handler handler = new Handler(){ | ||
364 | + @Override | ||
365 | + public void handleMessage(Message msg) { | ||
366 | + if(msg.what != 0){ // Message id 가 0 이면 | ||
367 | + bar.setProgress(msg.what); // 메인스레드의 UI 내용 변경 | ||
368 | + if(msg.what == 10){ | ||
369 | + dataListText.append("\n사진 데이터 추출 완료\n"); | ||
370 | + } | ||
371 | + else if(msg.what == 20){ | ||
372 | + dataListText.append("\n비디오 데이터 추출 완료\n"); | ||
373 | + } | ||
374 | + else if(msg.what == 30){ | ||
375 | + dataListText.append("\n오디오 데이터 추출 완료\n"); | ||
376 | + } | ||
377 | + else if(msg.what == 40){ | ||
378 | + dataListText.append("\n캘린더 데이터 추출 완료\n"); | ||
379 | + } | ||
380 | + else if(msg.what == 50){ | ||
381 | + dataListText.append("\n네트워크 데이터 추출 완료\n"); | ||
382 | + } | ||
383 | + else if(msg.what == 60){ | ||
384 | + dataListText.append("\n통화 데이터 추출 완료\n"); | ||
385 | + } | ||
386 | + else if(msg.what == 70){ | ||
387 | + dataListText.append("\n연락처 데이터 추출 완료\n"); | ||
388 | + } | ||
389 | + else if(msg.what == 80){ | ||
390 | + dataListText.append("\n문자 데이터 추출 완료\n"); | ||
391 | + } | ||
392 | + else if(msg.what == 90){ | ||
393 | + dataListText.append("\n와이파이 데이터 추출 완료\n"); | ||
394 | + } | ||
395 | + else if(msg.what == 100){ | ||
396 | + dataListText.append("\n스마트폰 정보 데이터 추출 완료\n"); | ||
397 | + } | ||
398 | + else if(msg.what == 110){ | ||
399 | + dataListText.append("\n계정 데이터 추출 완료\n"); | ||
400 | + } | ||
401 | + else if(msg.what == 120){ | ||
402 | + dataListText.append("\n앱 정보 데이터 추출 완료\n"); | ||
403 | + } | ||
404 | + else if(msg.what == 130){ | ||
405 | + dataListText.append("\n사용량 데이터 추출 완료\n"); | ||
406 | + } | ||
407 | + else if(msg.what == 140){ | ||
408 | + dataListText.append("\n문서 데이터 추출 완료\n"); | ||
409 | + try { | ||
410 | + Thread.sleep(5000); | ||
411 | + } catch (InterruptedException e) { | ||
412 | + e.printStackTrace(); | ||
413 | + } | ||
414 | + progressText.setText("모든 데이터 추출 완료 > 내부 저장소의 TempTEMP 폴더를 USB로 이동시키세요.\n"); | ||
415 | + } | ||
416 | + | ||
417 | + } | ||
418 | + } | ||
419 | + }; | ||
329 | } | 420 | } |
330 | 421 | ||
331 | public void getDocument() { | 422 | public void getDocument() { |
... | @@ -648,34 +739,6 @@ public class LoadingActivity extends Activity { | ... | @@ -648,34 +739,6 @@ public class LoadingActivity extends Activity { |
648 | } | 739 | } |
649 | dbNHelper.close(); | 740 | dbNHelper.close(); |
650 | } | 741 | } |
651 | -// private class GoogleAppIdTask extends AsyncTask<Void, Void, String> { | ||
652 | -// protected String doInBackground(final Void... params) { | ||
653 | -// String adId = null; | ||
654 | -// try { | ||
655 | -// AdvertisingIdClient.Info advertisingIdInfo = AdvertisingIdClient.getAdvertisingIdInfo(getApplicationContext()); | ||
656 | -// adId = advertisingIdInfo.getId(); | ||
657 | -// if (!advertisingIdInfo.isLimitAdTrackingEnabled()) | ||
658 | -// Log.d("adid : ", adId); | ||
659 | -// } catch (IllegalStateException ex) { | ||
660 | -// ex.printStackTrace(); | ||
661 | -// Log.e("GoogleAppidTask","IllegalStateException"); | ||
662 | -// } catch (GooglePlayServicesRepairableException ex) { | ||
663 | -// ex.printStackTrace(); | ||
664 | -// Log.e("GoogleAppidTask","GooglePlayServicesRepairable Exception"); | ||
665 | -// } catch (IOException ex) { | ||
666 | -// ex.printStackTrace(); | ||
667 | -// Log.e("GoogleAppidTask","IOException"); | ||
668 | -// } catch (GooglePlayServicesNotAvailableException ex) { | ||
669 | -// ex.printStackTrace(); | ||
670 | -// Log.e("GoogleAppidTask","GooglePlayServicesNotAvailableException"); | ||
671 | -// } | ||
672 | -// return adId; | ||
673 | -// } | ||
674 | -// | ||
675 | -// protected void onPostExecute(String adId) { | ||
676 | -// //작업 수행 | ||
677 | -// } | ||
678 | -// } | ||
679 | 742 | ||
680 | public void getPhoneInfo(){ | 743 | public void getPhoneInfo(){ |
681 | TelephonyManager tm = (TelephonyManager) getSystemService(TELEPHONY_SERVICE); | 744 | TelephonyManager tm = (TelephonyManager) getSystemService(TELEPHONY_SERVICE); | ... | ... |
... | @@ -18,8 +18,7 @@ public class MainActivity extends AppCompatActivity { | ... | @@ -18,8 +18,7 @@ public class MainActivity extends AppCompatActivity { |
18 | super.onCreate(savedInstanceState); | 18 | super.onCreate(savedInstanceState); |
19 | setContentView(R.layout.activity_main); | 19 | setContentView(R.layout.activity_main); |
20 | 20 | ||
21 | - copyFile("/data/data/com.example.dataextraction/databases/", "InnerDatabase.db", "/sdcard/TestLog/InnerDatabase.db"); | 21 | + |
22 | - copyFile("/data/data/com.example.dataextraction/databases/", "networkDatabase.db", "/sdcard/TestLog/networkDatabase.db"); | ||
23 | } | 22 | } |
24 | 23 | ||
25 | private void copyFile(String inputPath, String inputFile, String outputPath) { | 24 | private void copyFile(String inputPath, String inputFile, String outputPath) { | ... | ... |
... | @@ -2,13 +2,14 @@ | ... | @@ -2,13 +2,14 @@ |
2 | <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | 2 | <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
3 | android:layout_width="match_parent" | 3 | android:layout_width="match_parent" |
4 | android:layout_height="match_parent" | 4 | android:layout_height="match_parent" |
5 | + android:layout_gravity="center" | ||
5 | xmlns:tools="http://schemas.android.com/tools" | 6 | xmlns:tools="http://schemas.android.com/tools" |
6 | android:orientation="vertical"> | 7 | android:orientation="vertical"> |
7 | <TextView | 8 | <TextView |
8 | android:id="@+id/textView" | 9 | android:id="@+id/textView" |
9 | android:layout_width="match_parent" | 10 | android:layout_width="match_parent" |
10 | android:layout_height="wrap_content" | 11 | android:layout_height="wrap_content" |
11 | - android:text="CapstoneDesign2" /> | 12 | + android:text="스마트폰 내의 데이터를 추출합니다." /> |
12 | <ProgressBar | 13 | <ProgressBar |
13 | android:id="@+id/simpleProgressBar" | 14 | android:id="@+id/simpleProgressBar" |
14 | android:layout_width="match_parent" | 15 | android:layout_width="match_parent" |
... | @@ -18,4 +19,9 @@ | ... | @@ -18,4 +19,9 @@ |
18 | tools:layout_editor_absoluteY="0dp" | 19 | tools:layout_editor_absoluteY="0dp" |
19 | tools:layout_editor_absoluteX="8dp" | 20 | tools:layout_editor_absoluteX="8dp" |
20 | android:visibility="visible"/> | 21 | android:visibility="visible"/> |
22 | + <TextView | ||
23 | + android:id="@+id/textView2" | ||
24 | + android:layout_width="match_parent" | ||
25 | + android:layout_height="wrap_content" | ||
26 | + android:text="추출 로그 : \n\n" /> | ||
21 | </LinearLayout> | 27 | </LinearLayout> |
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
-
Please register or login to post a comment