diff --git a/mobiotsec2file/.gitignore b/mobiotsec2file/.gitignore new file mode 100644 index 0000000..aa724b7 --- /dev/null +++ b/mobiotsec2file/.gitignore @@ -0,0 +1,15 @@ +*.iml +.gradle +/local.properties +/.idea/caches +/.idea/libraries +/.idea/modules.xml +/.idea/workspace.xml +/.idea/navEditor.xml +/.idea/assetWizardSettings.xml +.DS_Store +/build +/captures +.externalNativeBuild +.cxx +local.properties diff --git a/mobiotsec2file/.idea/.gitignore b/mobiotsec2file/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/mobiotsec2file/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/mobiotsec2file/.idea/.name b/mobiotsec2file/.idea/.name new file mode 100644 index 0000000..daf0f1e --- /dev/null +++ b/mobiotsec2file/.idea/.name @@ -0,0 +1 @@ +FileHasher Malicious App \ No newline at end of file diff --git a/mobiotsec2file/.idea/compiler.xml b/mobiotsec2file/.idea/compiler.xml new file mode 100644 index 0000000..61a9130 --- /dev/null +++ b/mobiotsec2file/.idea/compiler.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/mobiotsec2file/.idea/gradle.xml b/mobiotsec2file/.idea/gradle.xml new file mode 100644 index 0000000..23a89bb --- /dev/null +++ b/mobiotsec2file/.idea/gradle.xml @@ -0,0 +1,22 @@ + + + + + + + \ No newline at end of file diff --git a/mobiotsec2file/.idea/jarRepositories.xml b/mobiotsec2file/.idea/jarRepositories.xml new file mode 100644 index 0000000..a5f05cd --- /dev/null +++ b/mobiotsec2file/.idea/jarRepositories.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/mobiotsec2file/.idea/misc.xml b/mobiotsec2file/.idea/misc.xml new file mode 100644 index 0000000..d5d35ec --- /dev/null +++ b/mobiotsec2file/.idea/misc.xml @@ -0,0 +1,9 @@ + + + + + + + + \ No newline at end of file diff --git a/mobiotsec2file/app/.gitignore b/mobiotsec2file/app/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/mobiotsec2file/app/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/mobiotsec2file/app/build.gradle b/mobiotsec2file/app/build.gradle new file mode 100644 index 0000000..a22aa65 --- /dev/null +++ b/mobiotsec2file/app/build.gradle @@ -0,0 +1,46 @@ +plugins { + id 'com.android.application' +} + +android { + compileSdkVersion 30 + buildToolsVersion "30.0.3" + + defaultConfig { + applicationId "com.example.maliciousapp" + minSdkVersion 26 + targetSdkVersion 30 + versionCode 1 + versionName "1.0" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } +} + +dependencies { + + implementation 'androidx.appcompat:appcompat:1.2.0' + implementation 'com.google.android.material:material:1.3.0' + implementation 'androidx.constraintlayout:constraintlayout:2.0.4' + implementation 'androidx.wear:wear:1.0.0' + implementation 'androidx.navigation:navigation-fragment:2.2.2' + implementation 'androidx.navigation:navigation-ui:2.2.2' + testImplementation 'junit:junit:4.+' + androidTestImplementation 'androidx.test.ext:junit:1.1.2' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' + // https://mvnrepository.com/artifact/commons-codec/commons-codec + compile group: 'commons-codec', name: 'commons-codec', version: '1.13' + implementation 'commons-io:commons-io:2.6' + compileOnly 'com.google.android.wearable:wearable:2.6.0' +} \ No newline at end of file diff --git a/mobiotsec2file/app/proguard-rules.pro b/mobiotsec2file/app/proguard-rules.pro new file mode 100644 index 0000000..481bb43 --- /dev/null +++ b/mobiotsec2file/app/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/mobiotsec2file/app/src/androidTest/java/com/example/maliciousapp/ExampleInstrumentedTest.java b/mobiotsec2file/app/src/androidTest/java/com/example/maliciousapp/ExampleInstrumentedTest.java new file mode 100644 index 0000000..4c27b51 --- /dev/null +++ b/mobiotsec2file/app/src/androidTest/java/com/example/maliciousapp/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package com.example.maliciousapp; + +import android.content.Context; + +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); + assertEquals("com.example.maliciousapp", appContext.getPackageName()); + } +} \ No newline at end of file diff --git a/mobiotsec2file/app/src/main/AndroidManifest.xml b/mobiotsec2file/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..84afcde --- /dev/null +++ b/mobiotsec2file/app/src/main/AndroidManifest.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/mobiotsec2file/app/src/main/java/com/example/maliciousapp/HashfileActivity.java b/mobiotsec2file/app/src/main/java/com/example/maliciousapp/HashfileActivity.java new file mode 100644 index 0000000..768161b --- /dev/null +++ b/mobiotsec2file/app/src/main/java/com/example/maliciousapp/HashfileActivity.java @@ -0,0 +1,47 @@ +package com.example.maliciousapp; + +import androidx.appcompat.app.AppCompatActivity; + +import android.app.Activity; +import android.content.Intent; +import android.os.Bundle; + +import org.apache.commons.codec.digest.DigestUtils; +import org.apache.commons.io.FileUtils; + +import java.io.File; +import java.io.IOException; + +public class HashfileActivity extends AppCompatActivity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + + Intent intent = getIntent(); + String filePath = intent.getData().getPath(); + + // calculate hash + String hash = null; + try { + + hash = calcHash(filePath); + + // return the hash in a "result" intent + Intent resultIntent = new Intent(); + resultIntent.putExtra("hash", hash); + setResult(Activity.RESULT_OK, resultIntent); + finish(); + + } catch (IOException e) { + e.printStackTrace(); + } + } + + static public String calcHash(String filePath) throws IOException { + File file = new File(filePath); + byte[] bytes = FileUtils.readFileToByteArray(file); + return DigestUtils.sha256Hex(bytes); + } +} \ No newline at end of file diff --git a/mobiotsec2file/app/src/main/java/com/example/maliciousapp/MainActivity.java b/mobiotsec2file/app/src/main/java/com/example/maliciousapp/MainActivity.java new file mode 100644 index 0000000..3ef416d --- /dev/null +++ b/mobiotsec2file/app/src/main/java/com/example/maliciousapp/MainActivity.java @@ -0,0 +1,24 @@ +package com.example.maliciousapp; + +import androidx.appcompat.app.AppCompatActivity; + +import android.app.Activity; +import android.content.Intent; +import android.os.Bundle; + +import org.apache.commons.codec.digest.DigestUtils; +import org.apache.commons.io.*; + +import java.io.File; +import java.io.IOException; + +public class MainActivity extends AppCompatActivity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); + } + + +} \ No newline at end of file diff --git a/mobiotsec2file/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/mobiotsec2file/app/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/mobiotsec2file/app/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/mobiotsec2file/app/src/main/res/drawable/ic_launcher_background.xml b/mobiotsec2file/app/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/mobiotsec2file/app/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mobiotsec2file/app/src/main/res/layout/activity_main.xml b/mobiotsec2file/app/src/main/res/layout/activity_main.xml new file mode 100644 index 0000000..4fc2444 --- /dev/null +++ b/mobiotsec2file/app/src/main/res/layout/activity_main.xml @@ -0,0 +1,18 @@ + + + + + + \ No newline at end of file diff --git a/mobiotsec2file/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/mobiotsec2file/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/mobiotsec2file/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/mobiotsec2file/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/mobiotsec2file/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/mobiotsec2file/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/mobiotsec2file/app/src/main/res/mipmap-hdpi/ic_launcher.png b/mobiotsec2file/app/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 0000000..a571e60 Binary files /dev/null and b/mobiotsec2file/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/mobiotsec2file/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/mobiotsec2file/app/src/main/res/mipmap-hdpi/ic_launcher_round.png new file mode 100644 index 0000000..61da551 Binary files /dev/null and b/mobiotsec2file/app/src/main/res/mipmap-hdpi/ic_launcher_round.png differ diff --git a/mobiotsec2file/app/src/main/res/mipmap-mdpi/ic_launcher.png b/mobiotsec2file/app/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 0000000..c41dd28 Binary files /dev/null and b/mobiotsec2file/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/mobiotsec2file/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/mobiotsec2file/app/src/main/res/mipmap-mdpi/ic_launcher_round.png new file mode 100644 index 0000000..db5080a Binary files /dev/null and b/mobiotsec2file/app/src/main/res/mipmap-mdpi/ic_launcher_round.png differ diff --git a/mobiotsec2file/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/mobiotsec2file/app/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 0000000..6dba46d Binary files /dev/null and b/mobiotsec2file/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/mobiotsec2file/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/mobiotsec2file/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png new file mode 100644 index 0000000..da31a87 Binary files /dev/null and b/mobiotsec2file/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ diff --git a/mobiotsec2file/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/mobiotsec2file/app/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 0000000..15ac681 Binary files /dev/null and b/mobiotsec2file/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/mobiotsec2file/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/mobiotsec2file/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png new file mode 100644 index 0000000..b216f2d Binary files /dev/null and b/mobiotsec2file/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ diff --git a/mobiotsec2file/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/mobiotsec2file/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 0000000..f25a419 Binary files /dev/null and b/mobiotsec2file/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/mobiotsec2file/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/mobiotsec2file/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png new file mode 100644 index 0000000..e96783c Binary files /dev/null and b/mobiotsec2file/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ diff --git a/mobiotsec2file/app/src/main/res/navigation/nav_graph.xml b/mobiotsec2file/app/src/main/res/navigation/nav_graph.xml new file mode 100644 index 0000000..9ffa9f1 --- /dev/null +++ b/mobiotsec2file/app/src/main/res/navigation/nav_graph.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/mobiotsec2file/app/src/main/res/values-night/themes.xml b/mobiotsec2file/app/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..7b0ceb1 --- /dev/null +++ b/mobiotsec2file/app/src/main/res/values-night/themes.xml @@ -0,0 +1,16 @@ + + + + \ No newline at end of file diff --git a/mobiotsec2file/app/src/main/res/values-round/strings.xml b/mobiotsec2file/app/src/main/res/values-round/strings.xml new file mode 100644 index 0000000..d74c66c --- /dev/null +++ b/mobiotsec2file/app/src/main/res/values-round/strings.xml @@ -0,0 +1,3 @@ + + Hello Round World! + \ No newline at end of file diff --git a/mobiotsec2file/app/src/main/res/values/colors.xml b/mobiotsec2file/app/src/main/res/values/colors.xml new file mode 100644 index 0000000..f8c6127 --- /dev/null +++ b/mobiotsec2file/app/src/main/res/values/colors.xml @@ -0,0 +1,10 @@ + + + #FFBB86FC + #FF6200EE + #FF3700B3 + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + \ No newline at end of file diff --git a/mobiotsec2file/app/src/main/res/values/dimens.xml b/mobiotsec2file/app/src/main/res/values/dimens.xml new file mode 100644 index 0000000..564919d --- /dev/null +++ b/mobiotsec2file/app/src/main/res/values/dimens.xml @@ -0,0 +1,16 @@ + + + + 0dp + + + 5dp + 16dp + \ No newline at end of file diff --git a/mobiotsec2file/app/src/main/res/values/strings.xml b/mobiotsec2file/app/src/main/res/values/strings.xml new file mode 100644 index 0000000..ea38a6d --- /dev/null +++ b/mobiotsec2file/app/src/main/res/values/strings.xml @@ -0,0 +1,18 @@ + + FileHasher Malicious App + HashFileActivity + + Hello Square World! + HashfileActivity + + First Fragment + Second Fragment + Next + Previous + + Hello first fragment + Hello second fragment. Arg: %1$s + \ No newline at end of file diff --git a/mobiotsec2file/app/src/main/res/values/themes.xml b/mobiotsec2file/app/src/main/res/values/themes.xml new file mode 100644 index 0000000..f5cee06 --- /dev/null +++ b/mobiotsec2file/app/src/main/res/values/themes.xml @@ -0,0 +1,25 @@ + + + + + + +