Edit ex2, not working yet
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
<activity android:name=".HashfileActivity">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<action android:name="com.mobisec.intent.action.HASHFILE" />
|
||||
<action android:name="com.mobiotsec.intent.action.HASHFILE" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
@@ -25,8 +25,9 @@ public class HashfileActivity extends AppCompatActivity {
|
||||
Intent intent = getIntent();
|
||||
|
||||
Log.d("MOBIOTSEC", "PROVA 1");
|
||||
Log.d("MOBIOTSEC", intent.getAction());
|
||||
|
||||
//if(intent.getAction() == "com.mobiotsec.intent.action.HASHFILE") {
|
||||
if(intent.getAction() == "com.mobiotsec.intent.action.HASHFILE") {
|
||||
|
||||
String filePath = intent.getData().getPath();
|
||||
Log.d("MOBIOTSEC", filePath);
|
||||
@@ -36,8 +37,6 @@ public class HashfileActivity extends AppCompatActivity {
|
||||
|
||||
hash = calcHash(filePath);
|
||||
|
||||
|
||||
|
||||
// return the hash in a "result" intent
|
||||
Intent resultIntent = new Intent();
|
||||
resultIntent.putExtra("hash", hash);
|
||||
@@ -48,18 +47,15 @@ public class HashfileActivity extends AppCompatActivity {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
static public String calcHash(String filePath) throws IOException {
|
||||
File file = new File(filePath);
|
||||
if(file.exists()) {
|
||||
Log.d("MOBIOTSEC", "PROVA 3");
|
||||
return DigestUtils.sha256Hex(FileUtils.readFileToByteArray(file));
|
||||
}
|
||||
else
|
||||
Log.d("MOBIOTSEC", "Errore");
|
||||
byte[] bytes = FileUtils.readFileToByteArray(file);
|
||||
Log.d("MOBIOTSEC", "PROVA 4");
|
||||
return DigestUtils.sha256Hex(bytes);
|
||||
|
||||
return "prova";
|
||||
}
|
||||
}
|
||||
3
mobiotsec2filehasher/filehasher/filehasher_checker.py
Normal file → Executable file
3
mobiotsec2filehasher/filehasher/filehasher_checker.py
Normal file → Executable file
@@ -4,6 +4,8 @@
|
||||
# ~/Android/Sdk/tools/avdmanager create avd --force --name mobiotsec --abi google_apis/x86 --package 'system-images;android-26;google_apis;x86'
|
||||
# ~/Android/Sdk/emulator/emulator -avd mobiotsec -no-audio -no-boot-anim -accel on -gpu swiftshader_indirect &
|
||||
|
||||
# TODO check if the emulator is already running
|
||||
|
||||
import argparse
|
||||
import os
|
||||
import shutil
|
||||
@@ -62,6 +64,7 @@ def main(args):
|
||||
uninstall(malApk)
|
||||
install(malApk)
|
||||
launch_app(victimApk)
|
||||
#time.sleep(2)
|
||||
print_logs()
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
--------- beginning of main
|
||||
--------- beginning of system
|
||||
--------- beginning of kernel
|
||||
03-04 12:36:43.827 13072 13072 I MOBIOTSEC: /storage/emulated/0/YM3oPnYG.dat
|
||||
03-04 12:36:45.489 13095 13095 D MOBIOTSEC: PROVA 0
|
||||
03-04 12:36:45.489 13095 13095 D MOBIOTSEC: PROVA 1
|
||||
03-04 12:36:45.489 13095 13095 D MOBIOTSEC: /storage/emulated/0/YM3oPnYG.dat
|
||||
03-04 12:36:45.489 13095 13095 D MOBIOTSEC: PROVA 3
|
||||
03-04 14:10:11.909 15435 15435 I MOBIOTSEC: /storage/emulated/0/YM3oPnYG.dat
|
||||
--------- beginning of crash
|
||||
|
||||
Reference in New Issue
Block a user