├── .gradle ├── 6.5 │ ├── executionHistory │ │ ├── executionHistory.bin │ │ └── executionHistory.lock │ ├── fileChanges │ │ └── last-build.bin │ ├── fileContent │ │ └── fileContent.lock │ ├── fileHashes │ │ ├── fileHashes.bin │ │ ├── fileHashes.lock │ │ └── resourceHashesCache.bin │ ├── gc.properties │ └── javaCompile │ │ ├── classAnalysis.bin │ │ ├── jarAnalysis.bin │ │ ├── javaCompile.lock │ │ └── taskHistory.bin ├── buildOutputCleanup │ ├── buildOutputCleanup.lock │ ├── cache.properties │ └── outputFiles.bin ├── checksums │ ├── checksums.lock │ ├── md5-checksums.bin │ └── sha1-checksums.bin └── vcs-1 │ └── gc.properties ├── .idea ├── .gitignore ├── .name ├── Apimonitor.iml ├── caches │ └── build_file_checksums.ser ├── codeStyles │ ├── Project.xml │ └── codeStyleConfig.xml ├── compiler.xml ├── gradle.xml ├── inspectionProfiles │ ├── Project_Default.xml │ └── profiles_settings.xml ├── jarRepositories.xml ├── libraries │ ├── Gradle__android_arch_core_common_1_0_0.xml │ ├── Gradle__android_arch_lifecycle_common_1_0_0.xml │ ├── Gradle__android_arch_lifecycle_runtime_1_0_0_aar.xml │ ├── Gradle__com_android_support_animated_vector_drawable_26_1_0_aar.xml │ ├── Gradle__com_android_support_appcompat_v7_26_1_0_aar.xml │ ├── Gradle__com_android_support_constraint_constraint_layout_1_1_3_aar.xml │ ├── Gradle__com_android_support_constraint_constraint_layout_solver_1_1_3.xml │ ├── Gradle__com_android_support_percent_26_1_0_aar.xml │ ├── Gradle__com_android_support_support_annotations_26_1_0.xml │ ├── Gradle__com_android_support_support_compat_26_1_0_aar.xml │ ├── Gradle__com_android_support_support_core_ui_26_1_0_aar.xml │ ├── Gradle__com_android_support_support_core_utils_26_1_0_aar.xml │ ├── Gradle__com_android_support_support_fragment_26_1_0_aar.xml │ ├── Gradle__com_android_support_support_media_compat_26_1_0_aar.xml │ ├── Gradle__com_android_support_support_v4_26_1_0_aar.xml │ ├── Gradle__com_android_support_support_vector_drawable_26_1_0_aar.xml │ ├── Gradle__com_android_support_test_espresso_espresso_core_3_0_2_aar.xml │ ├── Gradle__com_android_support_test_espresso_espresso_idling_resource_3_0_2_aar.xml │ ├── Gradle__com_android_support_test_monitor_1_0_2_aar.xml │ ├── Gradle__com_android_support_test_runner_1_0_2_aar.xml │ ├── Gradle__com_google_code_findbugs_jsr305_2_0_1.xml │ ├── Gradle__com_google_code_gson_gson_2_8_6.xml │ ├── Gradle__com_squareup_javawriter_2_1_1.xml │ ├── Gradle__com_squareup_okhttp3_okhttp_4_3_1.xml │ ├── Gradle__com_squareup_okio_okio_2_4_1.xml │ ├── Gradle__commons_cli_commons_cli_1_4.xml │ ├── Gradle__de_robv_android_xposed_api_82.xml │ ├── Gradle__de_robv_android_xposed_api_82_sources.xml │ ├── Gradle__javax_inject_javax_inject_1.xml │ ├── Gradle__junit_junit_4_12.xml │ ├── Gradle__net_sf_kxml_kxml2_2_3_0.xml │ ├── Gradle__org_conscrypt_conscrypt_android_2_2_1_aar.xml │ ├── Gradle__org_hamcrest_hamcrest_core_1_3.xml │ ├── Gradle__org_hamcrest_hamcrest_integration_1_3.xml │ ├── Gradle__org_hamcrest_hamcrest_library_1_3.xml │ ├── Gradle__org_jetbrains_annotations_13_0.xml │ ├── Gradle__org_jetbrains_kotlin_kotlin_android_extensions_runtime_1_3_61.xml │ ├── Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_3_61.xml │ ├── Gradle__org_jetbrains_kotlin_kotlin_stdlib_common_1_3_61.xml │ └── Gradle__org_jetbrains_kotlin_kotlin_stdlib_jdk7_1_3_61.xml ├── misc.xml ├── modules.xml ├── modules │ └── app │ │ └── Apimonitor.app.iml ├── runConfigurations.xml └── vcs.xml ├── ApiMonitor ├── ApiMonitor.iml ├── DAE调用API Mnitor.md ├── README.md ├── app ├── .gitignore ├── build.gradle ├── build │ └── outputs │ │ └── apk │ │ └── debug │ │ └── app-debug.apk ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── softsec │ │ └── mobsec │ │ └── ExampleInstrumentedTest.kt │ ├── main │ ├── AndroidManifest.xml │ ├── assets │ │ └── xposed_init │ ├── cpp │ │ ├── CMakeLists.txt │ │ └── tool.cpp │ ├── java │ │ └── com │ │ │ └── softsec │ │ │ └── mobsec │ │ │ └── dae │ │ │ └── apimonitor │ │ │ ├── MyApplication.kt │ │ │ ├── broadcastreceiver │ │ │ └── DaeBCReceiver.kt │ │ │ ├── hook │ │ │ ├── XposedHide.java │ │ │ ├── XposedModule.java │ │ │ ├── apis │ │ │ │ ├── AccountManagerHook.java │ │ │ │ ├── ActivityManagerHook.java │ │ │ │ ├── ActivityThreadHook.java │ │ │ │ ├── AudioRecordHook.java │ │ │ │ ├── CameraHook.java │ │ │ │ ├── ContentResolverHook.java │ │ │ │ ├── ContextImplHook.java │ │ │ │ ├── CookieManagerHook.java │ │ │ │ ├── CryptoHook.java │ │ │ │ ├── EncoderHook.java │ │ │ │ ├── FileSystemHook.java │ │ │ │ ├── IPCHook.java │ │ │ │ ├── LocationManagerHook.java │ │ │ │ ├── MediaRecorderHook.java │ │ │ │ ├── NetInfoHook.java │ │ │ │ ├── NotificationManagerHook.java │ │ │ │ ├── OthersHook.java │ │ │ │ ├── PackageManagerHook.java │ │ │ │ ├── ProcessHook.java │ │ │ │ ├── RuntimeHook.java │ │ │ │ ├── SensorManagerHook.java │ │ │ │ ├── SettingsHook.java │ │ │ │ ├── SmsManagerHook.java │ │ │ │ ├── TelephonyManagerHook.java │ │ │ │ ├── TestHook.java │ │ │ │ ├── WebViewHook.java │ │ │ │ └── httphook │ │ │ │ │ ├── HttpHook.java │ │ │ │ │ ├── NetStreamHook.java │ │ │ │ │ ├── OkHttpHook.java │ │ │ │ │ ├── OkHttpHookInterceptor.java │ │ │ │ │ └── virjarSocketHook │ │ │ │ │ ├── InputStreamWrapper.java │ │ │ │ │ ├── OutputStreamWrapper.java │ │ │ │ │ ├── SocketMonitor.java │ │ │ │ │ ├── SocketPackEvent.java │ │ │ │ │ ├── formatter │ │ │ │ │ ├── EventFormatter.java │ │ │ │ │ ├── GZipDecodeFormatter.java │ │ │ │ │ ├── HttpBaseFormatter.java │ │ │ │ │ └── HttpChunckAggregateFormatter.java │ │ │ │ │ ├── observer │ │ │ │ │ ├── EventObserver.java │ │ │ │ │ └── FileLogEventObserver.java │ │ │ │ │ └── orgApacheCommons │ │ │ │ │ ├── io │ │ │ │ │ ├── ByteOrderMark.java │ │ │ │ │ ├── ByteOrderParser.java │ │ │ │ │ ├── Charsets.java │ │ │ │ │ ├── CopyUtils.java │ │ │ │ │ ├── DirectoryWalker.java │ │ │ │ │ ├── EndianUtils.java │ │ │ │ │ ├── FileCleaner.java │ │ │ │ │ ├── FileCleaningTracker.java │ │ │ │ │ ├── FileDeleteStrategy.java │ │ │ │ │ ├── FileExistsException.java │ │ │ │ │ ├── FileSystemUtils.java │ │ │ │ │ ├── FileUtils.java │ │ │ │ │ ├── FilenameUtils.java │ │ │ │ │ ├── HexDump.java │ │ │ │ │ ├── IOCase.java │ │ │ │ │ ├── IOExceptionWithCause.java │ │ │ │ │ ├── IOUtils.java │ │ │ │ │ ├── LineIterator.java │ │ │ │ │ ├── TaggedIOException.java │ │ │ │ │ ├── ThreadMonitor.java │ │ │ │ │ ├── comparator │ │ │ │ │ │ ├── AbstractFileComparator.java │ │ │ │ │ │ ├── CompositeFileComparator.java │ │ │ │ │ │ ├── DefaultFileComparator.java │ │ │ │ │ │ ├── DirectoryFileComparator.java │ │ │ │ │ │ ├── ExtensionFileComparator.java │ │ │ │ │ │ ├── LastModifiedFileComparator.java │ │ │ │ │ │ ├── NameFileComparator.java │ │ │ │ │ │ ├── PathFileComparator.java │ │ │ │ │ │ ├── ReverseComparator.java │ │ │ │ │ │ ├── SizeFileComparator.java │ │ │ │ │ │ └── package.html │ │ │ │ │ ├── filefilter │ │ │ │ │ │ ├── AbstractFileFilter.java │ │ │ │ │ │ ├── AgeFileFilter.java │ │ │ │ │ │ ├── AndFileFilter.java │ │ │ │ │ │ ├── CanReadFileFilter.java │ │ │ │ │ │ ├── CanWriteFileFilter.java │ │ │ │ │ │ ├── ConditionalFileFilter.java │ │ │ │ │ │ ├── DelegateFileFilter.java │ │ │ │ │ │ ├── DirectoryFileFilter.java │ │ │ │ │ │ ├── EmptyFileFilter.java │ │ │ │ │ │ ├── FalseFileFilter.java │ │ │ │ │ │ ├── FileFileFilter.java │ │ │ │ │ │ ├── FileFilterUtils.java │ │ │ │ │ │ ├── HiddenFileFilter.java │ │ │ │ │ │ ├── IOFileFilter.java │ │ │ │ │ │ ├── MagicNumberFileFilter.java │ │ │ │ │ │ ├── NameFileFilter.java │ │ │ │ │ │ ├── NotFileFilter.java │ │ │ │ │ │ ├── OrFileFilter.java │ │ │ │ │ │ ├── PrefixFileFilter.java │ │ │ │ │ │ ├── RegexFileFilter.java │ │ │ │ │ │ ├── SizeFileFilter.java │ │ │ │ │ │ ├── SuffixFileFilter.java │ │ │ │ │ │ ├── TrueFileFilter.java │ │ │ │ │ │ ├── WildcardFileFilter.java │ │ │ │ │ │ ├── WildcardFilter.java │ │ │ │ │ │ └── package.html │ │ │ │ │ ├── input │ │ │ │ │ │ ├── AutoCloseInputStream.java │ │ │ │ │ │ ├── BOMInputStream.java │ │ │ │ │ │ ├── BoundedInputStream.java │ │ │ │ │ │ ├── BoundedReader.java │ │ │ │ │ │ ├── BrokenInputStream.java │ │ │ │ │ │ ├── CharSequenceInputStream.java │ │ │ │ │ │ ├── CharSequenceReader.java │ │ │ │ │ │ ├── ClassLoaderObjectInputStream.java │ │ │ │ │ │ ├── CloseShieldInputStream.java │ │ │ │ │ │ ├── ClosedInputStream.java │ │ │ │ │ │ ├── CountingInputStream.java │ │ │ │ │ │ ├── DemuxInputStream.java │ │ │ │ │ │ ├── InfiniteCircularInputStream.java │ │ │ │ │ │ ├── MessageDigestCalculatingInputStream.java │ │ │ │ │ │ ├── NullInputStream.java │ │ │ │ │ │ ├── NullReader.java │ │ │ │ │ │ ├── ObservableInputStream.java │ │ │ │ │ │ ├── ProxyInputStream.java │ │ │ │ │ │ ├── ProxyReader.java │ │ │ │ │ │ ├── ReaderInputStream.java │ │ │ │ │ │ ├── ReversedLinesFileReader.java │ │ │ │ │ │ ├── SwappedDataInputStream.java │ │ │ │ │ │ ├── TaggedInputStream.java │ │ │ │ │ │ ├── Tailer.java │ │ │ │ │ │ ├── TailerListener.java │ │ │ │ │ │ ├── TailerListenerAdapter.java │ │ │ │ │ │ ├── TeeInputStream.java │ │ │ │ │ │ ├── UnixLineEndingInputStream.java │ │ │ │ │ │ ├── WindowsLineEndingInputStream.java │ │ │ │ │ │ ├── XmlStreamReader.java │ │ │ │ │ │ ├── XmlStreamReaderException.java │ │ │ │ │ │ └── package.html │ │ │ │ │ ├── monitor │ │ │ │ │ │ ├── FileAlterationListener.java │ │ │ │ │ │ ├── FileAlterationListenerAdaptor.java │ │ │ │ │ │ ├── FileAlterationMonitor.java │ │ │ │ │ │ ├── FileAlterationObserver.java │ │ │ │ │ │ ├── FileEntry.java │ │ │ │ │ │ └── package.html │ │ │ │ │ ├── output │ │ │ │ │ │ ├── AppendableOutputStream.java │ │ │ │ │ │ ├── BrokenOutputStream.java │ │ │ │ │ │ ├── ByteArrayOutputStream.java │ │ │ │ │ │ ├── ChunkedOutputStream.java │ │ │ │ │ │ ├── ChunkedWriter.java │ │ │ │ │ │ ├── CloseShieldOutputStream.java │ │ │ │ │ │ ├── ClosedOutputStream.java │ │ │ │ │ │ ├── CountingOutputStream.java │ │ │ │ │ │ ├── DeferredFileOutputStream.java │ │ │ │ │ │ ├── DemuxOutputStream.java │ │ │ │ │ │ ├── FileWriterWithEncoding.java │ │ │ │ │ │ ├── LockableFileWriter.java │ │ │ │ │ │ ├── NullOutputStream.java │ │ │ │ │ │ ├── NullWriter.java │ │ │ │ │ │ ├── ProxyOutputStream.java │ │ │ │ │ │ ├── ProxyWriter.java │ │ │ │ │ │ ├── StringBuilderWriter.java │ │ │ │ │ │ ├── TaggedOutputStream.java │ │ │ │ │ │ ├── TeeOutputStream.java │ │ │ │ │ │ ├── ThresholdingOutputStream.java │ │ │ │ │ │ ├── WriterOutputStream.java │ │ │ │ │ │ ├── XmlStreamWriter.java │ │ │ │ │ │ └── package.html │ │ │ │ │ ├── overview.html │ │ │ │ │ ├── package.html │ │ │ │ │ └── serialization │ │ │ │ │ │ ├── ClassNameMatcher.java │ │ │ │ │ │ ├── FullClassNameMatcher.java │ │ │ │ │ │ ├── RegexpClassNameMatcher.java │ │ │ │ │ │ ├── ValidatingObjectInputStream.java │ │ │ │ │ │ ├── WildcardClassNameMatcher.java │ │ │ │ │ │ └── package.html │ │ │ │ │ └── lang3 │ │ │ │ │ ├── ArrayUtils.java │ │ │ │ │ ├── CharSequenceUtils.java │ │ │ │ │ ├── CharUtils.java │ │ │ │ │ ├── ClassUtils.java │ │ │ │ │ ├── JavaVersion.java │ │ │ │ │ ├── ObjectUtils.java │ │ │ │ │ ├── StringUtils.java │ │ │ │ │ ├── SystemUtils.java │ │ │ │ │ ├── Validate.java │ │ │ │ │ ├── builder │ │ │ │ │ ├── Builder.java │ │ │ │ │ ├── CompareToBuilder.java │ │ │ │ │ ├── EqualsBuilder.java │ │ │ │ │ ├── HashCodeBuilder.java │ │ │ │ │ ├── IDKey.java │ │ │ │ │ ├── ReflectionToStringBuilder.java │ │ │ │ │ ├── ToStringBuilder.java │ │ │ │ │ ├── ToStringStyle.java │ │ │ │ │ └── package.html │ │ │ │ │ ├── exception │ │ │ │ │ ├── CloneFailedException.java │ │ │ │ │ └── package.html │ │ │ │ │ ├── mutable │ │ │ │ │ ├── Mutable.java │ │ │ │ │ ├── MutableInt.java │ │ │ │ │ └── package.html │ │ │ │ │ ├── overview.html │ │ │ │ │ ├── package.html │ │ │ │ │ ├── reflect │ │ │ │ │ ├── MemberUtils.java │ │ │ │ │ ├── MethodUtils.java │ │ │ │ │ └── package.html │ │ │ │ │ └── tuple │ │ │ │ │ ├── ImmutablePair.java │ │ │ │ │ ├── Pair.java │ │ │ │ │ └── package.html │ │ │ └── hookUtils │ │ │ │ ├── CLogUtils.java │ │ │ │ ├── Hook.java │ │ │ │ ├── IsExactnessis.java │ │ │ │ ├── LogInterceptorImp.java │ │ │ │ ├── Logger.java │ │ │ │ ├── MethodHookCallBack.java │ │ │ │ ├── MethodHookHandler.java │ │ │ │ └── Reflector.java │ │ │ ├── service │ │ │ └── MainService.kt │ │ │ ├── tools │ │ │ └── ConsoleTool.kt │ │ │ ├── ui │ │ │ ├── ChooseAppActivity.kt │ │ │ ├── MainActivity.kt │ │ │ ├── RecordContentActivity.kt │ │ │ └── RecordListActivity.kt │ │ │ └── util │ │ │ ├── Config.kt │ │ │ ├── CrashHandler.kt │ │ │ ├── DataUtil.kt │ │ │ ├── FileUtil.java │ │ │ ├── HttpUtil.kt │ │ │ ├── ResultParser.kt │ │ │ ├── SharedPreferencesUtil.kt │ │ │ └── Util.java │ └── res │ │ ├── drawable-v24 │ │ └── ic_launcher_foreground.xml │ │ ├── drawable │ │ ├── android.png │ │ ├── background.xml │ │ └── ic_launcher_background.xml │ │ ├── layout │ │ ├── activity_chooseapp.xml │ │ ├── activity_content_record.xml │ │ ├── activity_list_record.xml │ │ ├── activity_main.xml │ │ ├── item_chooseapp.xml │ │ ├── item_result.xml │ │ ├── layout.xml │ │ └── listview_result.xml │ │ ├── mipmap-anydpi-v26 │ │ ├── ic_launcher.xml │ │ └── ic_launcher_round.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── values │ │ ├── colors.xml │ │ ├── strings.xml │ │ └── styles.xml │ │ └── xml │ │ └── backup_descriptor.xml │ └── test │ └── java │ └── com │ └── softsec │ └── mobsec │ └── ExampleUnitTest.kt ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── local.properties └── settings.gradle /.gradle/6.5/executionHistory/executionHistory.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xingyueren-qinmu/ApiMonitor/bc6ce1b72fbaa7d82141ee795c993e3f4cfe9a2b/.gradle/6.5/executionHistory/executionHistory.bin -------------------------------------------------------------------------------- /.gradle/6.5/executionHistory/executionHistory.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xingyueren-qinmu/ApiMonitor/bc6ce1b72fbaa7d82141ee795c993e3f4cfe9a2b/.gradle/6.5/executionHistory/executionHistory.lock -------------------------------------------------------------------------------- /.gradle/6.5/fileChanges/last-build.bin: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gradle/6.5/fileContent/fileContent.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xingyueren-qinmu/ApiMonitor/bc6ce1b72fbaa7d82141ee795c993e3f4cfe9a2b/.gradle/6.5/fileContent/fileContent.lock -------------------------------------------------------------------------------- /.gradle/6.5/fileHashes/fileHashes.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xingyueren-qinmu/ApiMonitor/bc6ce1b72fbaa7d82141ee795c993e3f4cfe9a2b/.gradle/6.5/fileHashes/fileHashes.bin -------------------------------------------------------------------------------- /.gradle/6.5/fileHashes/fileHashes.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xingyueren-qinmu/ApiMonitor/bc6ce1b72fbaa7d82141ee795c993e3f4cfe9a2b/.gradle/6.5/fileHashes/fileHashes.lock -------------------------------------------------------------------------------- /.gradle/6.5/fileHashes/resourceHashesCache.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xingyueren-qinmu/ApiMonitor/bc6ce1b72fbaa7d82141ee795c993e3f4cfe9a2b/.gradle/6.5/fileHashes/resourceHashesCache.bin -------------------------------------------------------------------------------- /.gradle/6.5/gc.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xingyueren-qinmu/ApiMonitor/bc6ce1b72fbaa7d82141ee795c993e3f4cfe9a2b/.gradle/6.5/gc.properties -------------------------------------------------------------------------------- /.gradle/6.5/javaCompile/classAnalysis.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xingyueren-qinmu/ApiMonitor/bc6ce1b72fbaa7d82141ee795c993e3f4cfe9a2b/.gradle/6.5/javaCompile/classAnalysis.bin -------------------------------------------------------------------------------- /.gradle/6.5/javaCompile/jarAnalysis.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xingyueren-qinmu/ApiMonitor/bc6ce1b72fbaa7d82141ee795c993e3f4cfe9a2b/.gradle/6.5/javaCompile/jarAnalysis.bin -------------------------------------------------------------------------------- /.gradle/6.5/javaCompile/javaCompile.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xingyueren-qinmu/ApiMonitor/bc6ce1b72fbaa7d82141ee795c993e3f4cfe9a2b/.gradle/6.5/javaCompile/javaCompile.lock -------------------------------------------------------------------------------- /.gradle/6.5/javaCompile/taskHistory.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xingyueren-qinmu/ApiMonitor/bc6ce1b72fbaa7d82141ee795c993e3f4cfe9a2b/.gradle/6.5/javaCompile/taskHistory.bin -------------------------------------------------------------------------------- /.gradle/buildOutputCleanup/buildOutputCleanup.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xingyueren-qinmu/ApiMonitor/bc6ce1b72fbaa7d82141ee795c993e3f4cfe9a2b/.gradle/buildOutputCleanup/buildOutputCleanup.lock -------------------------------------------------------------------------------- /.gradle/buildOutputCleanup/cache.properties: -------------------------------------------------------------------------------- 1 | #Fri Feb 26 13:46:13 CST 2021 2 | gradle.version=6.5 3 | -------------------------------------------------------------------------------- /.gradle/buildOutputCleanup/outputFiles.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xingyueren-qinmu/ApiMonitor/bc6ce1b72fbaa7d82141ee795c993e3f4cfe9a2b/.gradle/buildOutputCleanup/outputFiles.bin -------------------------------------------------------------------------------- /.gradle/checksums/checksums.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xingyueren-qinmu/ApiMonitor/bc6ce1b72fbaa7d82141ee795c993e3f4cfe9a2b/.gradle/checksums/checksums.lock -------------------------------------------------------------------------------- /.gradle/checksums/md5-checksums.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xingyueren-qinmu/ApiMonitor/bc6ce1b72fbaa7d82141ee795c993e3f4cfe9a2b/.gradle/checksums/md5-checksums.bin -------------------------------------------------------------------------------- /.gradle/checksums/sha1-checksums.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xingyueren-qinmu/ApiMonitor/bc6ce1b72fbaa7d82141ee795c993e3f4cfe9a2b/.gradle/checksums/sha1-checksums.bin -------------------------------------------------------------------------------- /.gradle/vcs-1/gc.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xingyueren-qinmu/ApiMonitor/bc6ce1b72fbaa7d82141ee795c993e3f4cfe9a2b/.gradle/vcs-1/gc.properties -------------------------------------------------------------------------------- /.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /workspace.xml -------------------------------------------------------------------------------- /.idea/.name: -------------------------------------------------------------------------------- 1 | Apimonitor -------------------------------------------------------------------------------- /.idea/Apimonitor.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /.idea/caches/build_file_checksums.ser: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xingyueren-qinmu/ApiMonitor/bc6ce1b72fbaa7d82141ee795c993e3f4cfe9a2b/.idea/caches/build_file_checksums.ser -------------------------------------------------------------------------------- /.idea/codeStyles/codeStyleConfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 22 | 23 | -------------------------------------------------------------------------------- /.idea/inspectionProfiles/Project_Default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16 | -------------------------------------------------------------------------------- /.idea/inspectionProfiles/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | -------------------------------------------------------------------------------- /.idea/jarRepositories.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 10 | 14 | 15 | 19 | 20 | 24 | 25 | 29 | 30 | 34 | 35 | 39 | 40 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__android_arch_core_common_1_0_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__android_arch_lifecycle_common_1_0_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__android_arch_lifecycle_runtime_1_0_0_aar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__com_android_support_animated_vector_drawable_26_1_0_aar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__com_android_support_appcompat_v7_26_1_0_aar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__com_android_support_constraint_constraint_layout_1_1_3_aar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__com_android_support_constraint_constraint_layout_solver_1_1_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__com_android_support_percent_26_1_0_aar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__com_android_support_support_annotations_26_1_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__com_android_support_support_compat_26_1_0_aar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__com_android_support_support_core_ui_26_1_0_aar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__com_android_support_support_core_utils_26_1_0_aar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__com_android_support_support_fragment_26_1_0_aar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__com_android_support_support_media_compat_26_1_0_aar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__com_android_support_support_v4_26_1_0_aar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__com_android_support_support_vector_drawable_26_1_0_aar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__com_android_support_test_espresso_espresso_core_3_0_2_aar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__com_android_support_test_espresso_espresso_idling_resource_3_0_2_aar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__com_android_support_test_monitor_1_0_2_aar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__com_android_support_test_runner_1_0_2_aar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__com_google_code_findbugs_jsr305_2_0_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__com_google_code_gson_gson_2_8_6.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__com_squareup_javawriter_2_1_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__com_squareup_okhttp3_okhttp_4_3_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__com_squareup_okio_okio_2_4_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__commons_cli_commons_cli_1_4.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__de_robv_android_xposed_api_82.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__de_robv_android_xposed_api_82_sources.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__javax_inject_javax_inject_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__junit_junit_4_12.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__net_sf_kxml_kxml2_2_3_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__org_conscrypt_conscrypt_android_2_2_1_aar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__org_hamcrest_hamcrest_integration_1_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__org_hamcrest_hamcrest_library_1_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_android_extensions_runtime_1_3_61.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_3_61.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_common_1_3_61.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_jdk7_1_3_61.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 9 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /ApiMonitor: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /ApiMonitor.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /DAE调用API Mnitor.md: -------------------------------------------------------------------------------- 1 | ## DAE调用API Mnitor 2 | 3 | ### 【开始Hook】 4 | 5 | ```java 6 | sendBroadcast(Intent("ACTION_DAE_TASK") 7 | .putExtra("INTENT_BC_FROM", "com.softsec.mobsec.dae") 8 | .putExtra("INTENT_DAE_BC_PKGNAME", "philm.vilo.im") 9 | .putExtra("INTENT_DAE_BC_TEST_START", true) 10 | ); 11 | ``` 12 | 13 | ###【结束Hook】 14 | 15 | ```java 16 | sendBroadcast(Intent("ACTION_DAE_TASK") 17 | .putExtra("INTENT_BC_FROM", "com.softsec.mobsec.dae") 18 | .putExtra("INTENT_DAE_BC_PKGNAME", "philm.vilo.im") 19 | .putExtra("INTENT_DAE_BC_TEST_START", false) 20 | ); 21 | ``` 22 | 23 | ### 【接收结果】 24 | 25 | ```java 26 | if(intent?.action == "ACTION_DAE_APIMONITOR_RES") { 27 | String resultPath = intent.getStringExtra("INTENT_BC_APIMONITOR_RES_PATH"); 28 | } 29 | ``` 30 | 31 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # aasl_dae_apimonitor 2 | 3 | 动态引擎下的API监控程序,包含Xposed模块和可视化管理工具,可用于自动化API监控和拨测。 -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | # Built application files 2 | *.apk 3 | *.ap_ 4 | # Files for the Dalvik VM 5 | *.dex 6 | # Java class files 7 | *.class 8 | # Generated files 9 | bin/ 10 | gen/ 11 | out/ 12 | # Gradle files 13 | .gradle/ 14 | .cxx/ 15 | build/ 16 | # Local configuration file (sdk path, etc) 17 | local.properties 18 | # Proguard folder generated by Eclipse 19 | proguard/ 20 | # Log Files 21 | *.log 22 | # Android Studio Navigation editor temp files 23 | .navigation/ 24 | # Android Studio captures folder 25 | captures/ 26 | # Intellij 27 | *.iml 28 | # Keystore files 29 | *.jks -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | apply plugin: 'kotlin-android' 4 | 5 | apply plugin: 'kotlin-android-extensions' 6 | 7 | 8 | android { 9 | compileSdkVersion 26 10 | buildToolsVersion '29.0.2' 11 | defaultConfig { 12 | applicationId "com.softsec.mobsec.dae.apimonitor" 13 | minSdkVersion 19 14 | targetSdkVersion 26 15 | versionCode 1 16 | versionName "1.0" 17 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 18 | } 19 | buildTypes { 20 | release { 21 | minifyEnabled false 22 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 23 | } 24 | } 25 | compileOptions { 26 | sourceCompatibility = 1.8 27 | targetCompatibility = 1.8 28 | } 29 | 30 | ndkVersion '21.1.6352462' 31 | 32 | } 33 | 34 | repositories { 35 | maven { url 'https://api.xposed.info/' } 36 | } 37 | 38 | 39 | dependencies { 40 | implementation fileTree(dir: 'libs', include: ['*.jar']) 41 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 42 | implementation 'com.android.support:appcompat-v7:26.+' 43 | implementation 'com.android.support.constraint:constraint-layout:1.1.3' 44 | implementation 'com.android.support:percent:26.1.+' 45 | 46 | testImplementation 'junit:junit:4.12' 47 | androidTestImplementation 'com.android.support.test:runner:1.0.2' 48 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' 49 | 50 | // okhttp 51 | implementation("com.squareup.okhttp3:okhttp:4.3.1") 52 | implementation 'org.conscrypt:conscrypt-android:2.2.1' 53 | 54 | // xposed 55 | compileOnly 'de.robv.android.xposed:api:82' 56 | compileOnly 'de.robv.android.xposed:api:82:sources' 57 | 58 | // commons-cli 59 | implementation 'commons-cli:commons-cli:1.4' 60 | 61 | implementation group: 'com.google.code.gson', name: 'gson', version: '2.8.6' 62 | 63 | } 64 | 65 | 66 | configurations.all { 67 | resolutionStrategy.eachDependency { DependencyResolveDetails details -> 68 | def requested = details.requested 69 | if (requested.group == "com.android.support") { 70 | if (!requested.name.startsWith("multidex")) { 71 | details.useVersion "26.+" 72 | } 73 | } 74 | }} -------------------------------------------------------------------------------- /app/build/outputs/apk/debug/app-debug.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xingyueren-qinmu/ApiMonitor/bc6ce1b72fbaa7d82141ee795c993e3f4cfe9a2b/app/build/outputs/apk/debug/app-debug.apk -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /app/src/androidTest/java/com/softsec/mobsec/ExampleInstrumentedTest.kt: -------------------------------------------------------------------------------- 1 | package com.softsec.mobsec 2 | 3 | import android.support.test.InstrumentationRegistry 4 | import android.support.test.runner.AndroidJUnit4 5 | 6 | import org.junit.Test 7 | import org.junit.runner.RunWith 8 | 9 | import org.junit.Assert.* 10 | 11 | /** 12 | * Instrumented test, which will execute on an Android device. 13 | * 14 | * See [testing documentation](http://d.android.com/tools/testing). 15 | */ 16 | @RunWith(AndroidJUnit4::class) 17 | class ExampleInstrumentedTest { 18 | @Test 19 | fun useAppContext() { 20 | // Context of the app under test. 21 | val appContext = InstrumentationRegistry.getInstrumentation().targetContext 22 | assertEquals("", appContext.packageName) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /app/src/main/assets/xposed_init: -------------------------------------------------------------------------------- 1 | com.softsec.mobsec.dae.apimonitor.hook.XposedModule -------------------------------------------------------------------------------- /app/src/main/cpp/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | cmake_minimum_required(VERSION 3.4.1) 3 | 4 | #add_library( # Sets the name of the library. 5 | # native-lib 6 | # 7 | # # Sets the library as a shared library. 8 | # SHARED 9 | # 10 | # # Provides a relative path to your source file(s). 11 | # tool.cpp ) 12 | # 13 | # 14 | #find_library( # Sets the name of the path variable. 15 | # log-lib 16 | # 17 | # # Specifies the name of the NDK library that 18 | # # you want CMake to locate. 19 | # log ) 20 | # 21 | ## Specifies libraries CMake should link to your target library. You 22 | ## can link multiple libraries, such as libraries you define in this 23 | ## build script, prebuilt third-party libraries, or system libraries. 24 | # 25 | #target_link_libraries( # Specifies the target library. 26 | # native-lib 27 | # 28 | # # Links the target library to the log library 29 | # # included in the NDK. 30 | # ${log-lib} ) 31 | 32 | add_executable( 33 | tool tool.cpp 34 | ) -------------------------------------------------------------------------------- /app/src/main/java/com/softsec/mobsec/dae/apimonitor/MyApplication.kt: -------------------------------------------------------------------------------- 1 | package com.softsec.mobsec.dae.apimonitor 2 | 3 | import android.app.Application 4 | import com.softsec.mobsec.dae.apimonitor.util.CrashHandler 5 | 6 | class MyApplication : Application() { 7 | 8 | override fun onCreate() { 9 | super.onCreate() 10 | CrashHandler.init() 11 | } 12 | } -------------------------------------------------------------------------------- /app/src/main/java/com/softsec/mobsec/dae/apimonitor/broadcastreceiver/DaeBCReceiver.kt: -------------------------------------------------------------------------------- 1 | package com.softsec.mobsec.dae.apimonitor.broadcastreceiver 2 | 3 | import android.content.BroadcastReceiver 4 | import android.content.Context 5 | import android.content.Intent 6 | import android.util.Log 7 | import com.softsec.mobsec.dae.apimonitor.util.Config 8 | import com.softsec.mobsec.dae.apimonitor.util.SharedPreferencesUtil 9 | import com.softsec.mobsec.dae.apimonitor.util.Util 10 | 11 | class DaeBCReceiver : BroadcastReceiver() { 12 | 13 | override fun onReceive(context: Context?, intent: Intent?) { 14 | if((intent != null) and (context != null) ) { 15 | val fromStr = intent!!.getStringExtra(Config.INTENT_BC_FROM) 16 | Log.i("from", fromStr) 17 | if(fromStr?.equals(Config.DAE_PKGNAME) == true) { 18 | val pkgName = intent.getStringExtra(Config.INTENT_DAE_BC_PKGNAME) 19 | val testIntent = intent.getBooleanExtra(Config.INTENT_DAE_BC_TEST_START, true) 20 | val appsToHookStr = SharedPreferencesUtil.getString(Config.SP_APPS_TO_HOOK) 21 | Log.i("pkgName", pkgName) 22 | Log.i("testIntent", testIntent.toString()) 23 | if(testIntent) { 24 | if(appsToHookStr.contains(pkgName)) return 25 | val logDir = context!!.packageManager.getPackageInfo(pkgName, 0).applicationInfo.dataDir + Config.PATH_TARGET_APP_LOG 26 | val dataDir = context.packageManager.getPackageInfo(pkgName, 0).applicationInfo.dataDir 27 | SharedPreferencesUtil.context = context 28 | SharedPreferencesUtil.addAppToHook(pkgName, false, logDir, dataDir) 29 | SharedPreferencesUtil.put(Config.SP_APPS_TO_HOOK, "$appsToHookStr$pkgName;") 30 | Util.execRootCmdWithResult("am force-stop $pkgName") 31 | context.sendBroadcast( 32 | Intent(Config.INTENTFILTER_BC_DAE_TEST_ACK) 33 | .setComponent(Config.INTENT_BC_COMPONENT) 34 | ) 35 | Config.MOD_DAE_TESTING = true 36 | Config.MOD_DAE_TESTING_PKGNAME = pkgName 37 | } else { 38 | if(!appsToHookStr.contains(pkgName)) return 39 | SharedPreferencesUtil.removeAppToHook(pkgName) 40 | Config.MOD_DAE_TESTING = false 41 | } 42 | } else return 43 | 44 | } 45 | } 46 | 47 | } -------------------------------------------------------------------------------- /app/src/main/java/com/softsec/mobsec/dae/apimonitor/hook/apis/ActivityManagerHook.java: -------------------------------------------------------------------------------- 1 | package com.softsec.mobsec.dae.apimonitor.hook.apis; 2 | 3 | import android.app.ActivityManager; 4 | 5 | import com.softsec.mobsec.dae.apimonitor.hook.hookUtils.Hook; 6 | import com.softsec.mobsec.dae.apimonitor.hook.hookUtils.Logger; 7 | import com.softsec.mobsec.dae.apimonitor.hook.hookUtils.MethodHookHandler; 8 | import com.softsec.mobsec.dae.apimonitor.hook.hookUtils.MethodHookCallBack; 9 | import com.softsec.mobsec.dae.apimonitor.hook.hookUtils.Reflector; 10 | 11 | import java.lang.reflect.Method; 12 | 13 | import de.robv.android.xposed.callbacks.XC_LoadPackage; 14 | 15 | public class ActivityManagerHook extends Hook { 16 | 17 | public static final String TAG = "ActivityManager:"; 18 | 19 | @Override 20 | public void initAllHooks(XC_LoadPackage.LoadPackageParam packageParam) { 21 | 22 | 23 | Method killBackgroundProcessesmethod = Reflector.findMethod(ActivityManager.class, "killBackgroundProcesses", String.class); 24 | MethodHookHandler.hookMethod(killBackgroundProcessesmethod, new MethodHookCallBack() { 25 | @Override 26 | protected void afterHookedMethod(MethodHookParam param) throws Throwable { 27 | // logger.recordAPICalling(param, "关闭程序", "killedprogram", (String)param.args[0]); 28 | } 29 | }); 30 | 31 | Method forceStopPackagemethod = Reflector.findMethod(ActivityManager.class, "forceStopPackage", String.class); 32 | MethodHookHandler.hookMethod(forceStopPackagemethod, new MethodHookCallBack() { 33 | @Override 34 | protected void afterHookedMethod(MethodHookParam param) throws Throwable { 35 | // logger.recordAPICalling(param, "关闭程序","killedprogram", (String)param.args[0]); 36 | } 37 | }); 38 | 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /app/src/main/java/com/softsec/mobsec/dae/apimonitor/hook/apis/ActivityThreadHook.java: -------------------------------------------------------------------------------- 1 | package com.softsec.mobsec.dae.apimonitor.hook.apis; 2 | 3 | import android.annotation.SuppressLint; 4 | 5 | import com.softsec.mobsec.dae.apimonitor.hook.hookUtils.Hook; 6 | import com.softsec.mobsec.dae.apimonitor.hook.hookUtils.Logger; 7 | import com.softsec.mobsec.dae.apimonitor.hook.hookUtils.MethodHookHandler; 8 | import com.softsec.mobsec.dae.apimonitor.hook.hookUtils.MethodHookCallBack; 9 | import com.softsec.mobsec.dae.apimonitor.hook.hookUtils.Reflector; 10 | 11 | import java.lang.reflect.Method; 12 | 13 | import de.robv.android.xposed.callbacks.XC_LoadPackage; 14 | 15 | public class ActivityThreadHook extends Hook { 16 | 17 | public static final String TAG = "ActivityThread"; 18 | 19 | @Override 20 | public void initAllHooks(XC_LoadPackage.LoadPackageParam packageParam) { 21 | 22 | try { 23 | @SuppressLint("PrivateApi") 24 | Class receiverDataClass = Class.forName("android.app.ActivityThread$ReceiverData"); 25 | Method handleReceiverMethod = Reflector.findMethod("android.app.ActivityThread", 26 | packageParam.classLoader, 27 | "handleReceiver", receiverDataClass); 28 | MethodHookHandler.hookMethod(handleReceiverMethod, new MethodHookCallBack() { 29 | 30 | @Override 31 | protected void afterHookedMethod(MethodHookParam param) throws Throwable { 32 | // logger.recordAPICalling(param, "接收器"); 33 | } 34 | }); 35 | } catch (ClassNotFoundException | NoSuchMethodException e) { 36 | Logger.logError(e); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /app/src/main/java/com/softsec/mobsec/dae/apimonitor/hook/apis/AudioRecordHook.java: -------------------------------------------------------------------------------- 1 | package com.softsec.mobsec.dae.apimonitor.hook.apis; 2 | 3 | import android.media.AudioRecord; 4 | 5 | import com.softsec.mobsec.dae.apimonitor.hook.hookUtils.Hook; 6 | import com.softsec.mobsec.dae.apimonitor.hook.hookUtils.Logger; 7 | import com.softsec.mobsec.dae.apimonitor.hook.hookUtils.MethodHookHandler; 8 | import com.softsec.mobsec.dae.apimonitor.hook.hookUtils.MethodHookCallBack; 9 | import com.softsec.mobsec.dae.apimonitor.hook.hookUtils.Reflector; 10 | 11 | import java.lang.reflect.Method; 12 | 13 | import de.robv.android.xposed.callbacks.XC_LoadPackage; 14 | 15 | public class AudioRecordHook extends Hook { 16 | 17 | public static final String TAG = "AudioRecord"; 18 | 19 | 20 | @Override 21 | public void initAllHooks(XC_LoadPackage.LoadPackageParam packageParam) { 22 | 23 | Method startRecordingMethod = Reflector.findMethod(AudioRecord.class, "startRecording"); 24 | MethodHookHandler.hookMethod(startRecordingMethod, new MethodHookCallBack() { 25 | @Override 26 | protected void afterHookedMethod(MethodHookParam param) throws Throwable { 27 | // logger.recordAPICalling(param, "启动录音"); 28 | } 29 | }); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /app/src/main/java/com/softsec/mobsec/dae/apimonitor/hook/apis/ContextImplHook.java: -------------------------------------------------------------------------------- 1 | package com.softsec.mobsec.dae.apimonitor.hook.apis; 2 | 3 | import android.content.BroadcastReceiver; 4 | import android.content.IntentFilter; 5 | 6 | import com.softsec.mobsec.dae.apimonitor.hook.hookUtils.Hook; 7 | import com.softsec.mobsec.dae.apimonitor.hook.hookUtils.Logger; 8 | import com.softsec.mobsec.dae.apimonitor.hook.hookUtils.MethodHookHandler; 9 | import com.softsec.mobsec.dae.apimonitor.hook.hookUtils.MethodHookCallBack; 10 | import com.softsec.mobsec.dae.apimonitor.hook.hookUtils.Reflector; 11 | 12 | import java.lang.reflect.Method; 13 | import java.util.Iterator; 14 | 15 | import de.robv.android.xposed.callbacks.XC_LoadPackage; 16 | 17 | public class ContextImplHook extends Hook { 18 | 19 | public static final String TAG = "ContextImpl"; 20 | 21 | private String descIntentFilter(IntentFilter intentFilter) { 22 | StringBuilder sb = new StringBuilder(); 23 | Iterator actions =intentFilter.actionsIterator(); 24 | String action; 25 | while(actions.hasNext()){ 26 | action = actions.next(); 27 | sb.append(action).append(","); 28 | } 29 | String res = sb.toString(); 30 | return res.endsWith(",") ? res.substring(0, res.length() - 1) : res; 31 | } 32 | 33 | @Override 34 | public void initAllHooks(XC_LoadPackage.LoadPackageParam packageParam) { 35 | 36 | 37 | try { 38 | Method registerReceiverMethod = Reflector.findMethod( 39 | "android.app.ContextImpl", packageParam.classLoader, 40 | "registerReceiver", BroadcastReceiver.class, IntentFilter.class); 41 | MethodHookHandler.hookMethod(registerReceiverMethod, new MethodHookCallBack() { 42 | @Override 43 | protected void afterHookedMethod(MethodHookParam param) throws Throwable { 44 | if(param.args[1] != null){ 45 | String intentstr = descIntentFilter((IntentFilter) param.args[1]); 46 | String[] callingInfo = getCallingInfo(param.method.getName()); 47 | Logger logger = new Logger(); 48 | logger.setTag(TAG); 49 | logger.setCallingInfo(callingInfo[0]); 50 | logger.addRelatedAttrs("xrefFrom", callingInfo[1]); 51 | logger.recordAPICalling(param, "注册广播接收器","IntentFilter", intentstr); 52 | } 53 | } 54 | }); 55 | } catch (NoSuchMethodException | ClassNotFoundException e) { 56 | Logger.logError(e); 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /app/src/main/java/com/softsec/mobsec/dae/apimonitor/hook/apis/CookieManagerHook.java: -------------------------------------------------------------------------------- 1 | package com.softsec.mobsec.dae.apimonitor.hook.apis; 2 | 3 | import android.util.Log; 4 | import android.webkit.CookieManager; 5 | 6 | import com.softsec.mobsec.dae.apimonitor.hook.hookUtils.Hook; 7 | import com.softsec.mobsec.dae.apimonitor.hook.hookUtils.Logger; 8 | import com.softsec.mobsec.dae.apimonitor.hook.hookUtils.MethodHookHandler; 9 | import com.softsec.mobsec.dae.apimonitor.hook.hookUtils.MethodHookCallBack; 10 | import com.softsec.mobsec.dae.apimonitor.hook.hookUtils.Reflector; 11 | 12 | import java.lang.reflect.Method; 13 | 14 | import de.robv.android.xposed.callbacks.XC_LoadPackage; 15 | 16 | public class CookieManagerHook extends Hook { 17 | 18 | public static final String TAG = "CookieManager"; 19 | 20 | @Override 21 | public void initAllHooks(XC_LoadPackage.LoadPackageParam packageParam) { 22 | 23 | 24 | try { 25 | Method getInstanceMethod = Reflector.findMethod(CookieManager.class, "getInstance"); 26 | MethodHookHandler.hookMethod(getInstanceMethod, new MethodHookCallBack() { 27 | @Override 28 | protected void afterHookedMethod(MethodHookParam param) throws Throwable { 29 | Class cmCLass = param.getResult().getClass(); 30 | Method getCookieMethod = cmCLass.getDeclaredMethod("getCookie", String.class); 31 | MethodHookHandler.hookMethod(getCookieMethod, new MethodHookCallBack() { 32 | @Override 33 | protected void afterHookedMethod(MethodHookParam param) throws Throwable { 34 | String[] callingInfo = getCallingInfo(param.method.getName()); 35 | Logger logger = new Logger(); 36 | logger.setTag(TAG); 37 | logger.setCallingInfo(callingInfo[0]); 38 | logger.addRelatedAttrs("xrefFrom", callingInfo[1]); 39 | logger.recordAPICalling(param, "获取Cookie", 40 | "url", (String)param.args[0]); 41 | } 42 | }); 43 | } 44 | }); 45 | } catch (Exception e) { 46 | Log.e("Cookie获取错误", e.getMessage()); 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /app/src/main/java/com/softsec/mobsec/dae/apimonitor/hook/apis/LocationManagerHook.java: -------------------------------------------------------------------------------- 1 | package com.softsec.mobsec.dae.apimonitor.hook.apis; 2 | 3 | import android.location.Location; 4 | import android.location.LocationManager; 5 | 6 | import com.softsec.mobsec.dae.apimonitor.hook.hookUtils.Hook; 7 | import com.softsec.mobsec.dae.apimonitor.hook.hookUtils.Logger; 8 | import com.softsec.mobsec.dae.apimonitor.hook.hookUtils.MethodHookHandler; 9 | import com.softsec.mobsec.dae.apimonitor.hook.hookUtils.MethodHookCallBack; 10 | import com.softsec.mobsec.dae.apimonitor.hook.hookUtils.Reflector; 11 | 12 | import java.lang.reflect.Method; 13 | 14 | import de.robv.android.xposed.callbacks.XC_LoadPackage; 15 | 16 | public class LocationManagerHook extends Hook { 17 | public static final String TAG = "LocationManager"; 18 | 19 | @Override 20 | public void initAllHooks(XC_LoadPackage.LoadPackageParam packageParam) { 21 | 22 | Method getLastKnownLocationMethod = Reflector.findMethod(LocationManager.class, "getLastKnownLocation", String.class); 23 | MethodHookHandler.hookMethod(getLastKnownLocationMethod, new MethodHookCallBack() { 24 | @Override 25 | protected void afterHookedMethod(MethodHookParam param) throws Throwable { 26 | Location location = (Location)param.getResult(); 27 | String[] callingInfo = getCallingInfo(param.method.getName()); 28 | Logger logger = new Logger(); 29 | logger.setTag(TAG); 30 | logger.setCallingInfo(callingInfo[0]); 31 | logger.addRelatedAttrs("xrefFrom", callingInfo[1]); 32 | String result = 33 | location != null ? 34 | "lat=" + location.getLatitude() + "&lng=" + location.getLongitude() 35 | : 36 | ""; 37 | logger.addRelatedAttrs("result", result); 38 | logger.recordAPICalling(param, "获取地理位置", "provider", (String)param.args[0]); 39 | } 40 | }); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /app/src/main/java/com/softsec/mobsec/dae/apimonitor/hook/apis/MediaRecorderHook.java: -------------------------------------------------------------------------------- 1 | package com.softsec.mobsec.dae.apimonitor.hook.apis; 2 | 3 | import android.media.MediaRecorder; 4 | 5 | import com.softsec.mobsec.dae.apimonitor.hook.hookUtils.Hook; 6 | import com.softsec.mobsec.dae.apimonitor.hook.hookUtils.Logger; 7 | import com.softsec.mobsec.dae.apimonitor.hook.hookUtils.MethodHookHandler; 8 | import com.softsec.mobsec.dae.apimonitor.hook.hookUtils.MethodHookCallBack; 9 | import com.softsec.mobsec.dae.apimonitor.hook.hookUtils.Reflector; 10 | 11 | import java.io.FileDescriptor; 12 | import java.lang.reflect.Method; 13 | 14 | import de.robv.android.xposed.callbacks.XC_LoadPackage; 15 | 16 | public class MediaRecorderHook extends Hook { 17 | public static final String TAG = "MediaRecorder"; 18 | 19 | @Override 20 | public void initAllHooks(XC_LoadPackage.LoadPackageParam packageParam) { 21 | 22 | Method startMethod = Reflector.findMethod(MediaRecorder.class, "start"); 23 | MethodHookHandler.hookMethod(startMethod, new MethodHookCallBack() { 24 | @Override 25 | protected void afterHookedMethod(MethodHookParam param) throws Throwable { 26 | String[] callingInfo = getCallingInfo(param.method.getName()); 27 | Logger logger = new Logger(); 28 | logger.setTag(TAG); 29 | logger.setCallingInfo(callingInfo[0]); 30 | logger.addRelatedAttrs("xrefFrom", callingInfo[1]); 31 | 32 | String mPath = (String)Reflector.getFieldOjbect(MediaRecorder.class, param.thisObject, "mPath"); 33 | if(mPath != null) logger.recordAPICalling(param, "path", mPath); 34 | else { 35 | FileDescriptor mFd = (FileDescriptor) Reflector.getFieldOjbect(MediaRecorder.class, param.thisObject, "mFd"); 36 | assert mFd != null; 37 | logger.recordAPICalling(param, "开始录音", "path", mFd.toString()); 38 | } 39 | } 40 | }); 41 | 42 | Method stopMethod = Reflector.findMethod(MediaRecorder.class, "stop"); 43 | MethodHookHandler.hookMethod(stopMethod, new MethodHookCallBack() { 44 | @Override 45 | protected void afterHookedMethod(MethodHookParam param) throws Throwable { 46 | String[] callingInfo = getCallingInfo(param.method.getName()); 47 | Logger logger = new Logger(); 48 | logger.setTag(TAG); 49 | logger.setCallingInfo(callingInfo[0]); 50 | logger.addRelatedAttrs("xrefFrom", callingInfo[1]); 51 | logger.recordAPICalling(param, "结束录音"); 52 | } 53 | }); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /app/src/main/java/com/softsec/mobsec/dae/apimonitor/hook/apis/NotificationManagerHook.java: -------------------------------------------------------------------------------- 1 | package com.softsec.mobsec.dae.apimonitor.hook.apis; 2 | 3 | import android.app.Notification; 4 | import android.app.NotificationManager; 5 | 6 | import com.softsec.mobsec.dae.apimonitor.hook.hookUtils.Hook; 7 | import com.softsec.mobsec.dae.apimonitor.hook.hookUtils.Logger; 8 | import com.softsec.mobsec.dae.apimonitor.hook.hookUtils.MethodHookHandler; 9 | import com.softsec.mobsec.dae.apimonitor.hook.hookUtils.MethodHookCallBack; 10 | import com.softsec.mobsec.dae.apimonitor.hook.hookUtils.Reflector; 11 | 12 | import java.lang.reflect.Method; 13 | 14 | import de.robv.android.xposed.callbacks.XC_LoadPackage; 15 | 16 | public class NotificationManagerHook extends Hook { 17 | 18 | public static final String TAG = "NotificationManager"; 19 | 20 | @Override 21 | public void initAllHooks(XC_LoadPackage.LoadPackageParam packageParam) { 22 | 23 | Method notifyMethod = Reflector.findMethod(NotificationManager.class, "notify", int.class, Notification.class); 24 | MethodHookHandler.hookMethod(notifyMethod, new MethodHookCallBack() { 25 | @Override 26 | protected void afterHookedMethod(MethodHookParam param) throws Throwable { 27 | Logger logger = new Logger(); 28 | logger.setTag(TAG); 29 | logger.recordAPICalling(param, "发送通知", "notification", ((Notification) param.args[1]).toString()); 30 | } 31 | }); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /app/src/main/java/com/softsec/mobsec/dae/apimonitor/hook/apis/OthersHook.java: -------------------------------------------------------------------------------- 1 | package com.softsec.mobsec.dae.apimonitor.hook.apis; 2 | 3 | import android.os.Build; 4 | import android.util.Log; 5 | 6 | import com.softsec.mobsec.dae.apimonitor.hook.hookUtils.Hook; 7 | import com.softsec.mobsec.dae.apimonitor.hook.hookUtils.Logger; 8 | import com.softsec.mobsec.dae.apimonitor.hook.hookUtils.MethodHookHandler; 9 | import com.softsec.mobsec.dae.apimonitor.hook.hookUtils.MethodHookCallBack; 10 | import com.softsec.mobsec.dae.apimonitor.hook.hookUtils.Reflector; 11 | 12 | import java.lang.reflect.Method; 13 | 14 | import de.robv.android.xposed.callbacks.XC_LoadPackage; 15 | 16 | public class OthersHook extends Hook { 17 | public static final String TAG = "TelephonyManager"; 18 | 19 | @Override 20 | public void initAllHooks(XC_LoadPackage.LoadPackageParam packageParam) { 21 | 22 | 23 | try { 24 | Method getSerialMethod = Reflector.findMethod(Build.class, "getSerial"); 25 | MethodHookHandler.hookMethod(getSerialMethod, new MethodHookCallBack() { 26 | @Override 27 | protected void afterHookedMethod(MethodHookParam param) throws Throwable { 28 | String[] callingInfo = getCallingInfo(param.method.getName()); 29 | Logger logger = new Logger(); 30 | logger.setTag(TAG); 31 | logger.setCallingInfo(callingInfo[0]); 32 | logger.addRelatedAttrs("xrefFrom", callingInfo[1]); 33 | String serial = (String)param.getResult(); 34 | logger.addRelatedAttrs("serial", null == serial ? "" : serial); 35 | logger.recordAPICalling(param, "获取运营商"); 36 | } 37 | }); 38 | } catch (Exception e) { 39 | Log.e("SN码", e.getMessage()); 40 | } 41 | 42 | Method getStringMethod = Reflector.findMethod(Build.class, "getString", String.class); 43 | MethodHookHandler.hookMethod(getStringMethod, new MethodHookCallBack() { 44 | @Override 45 | protected void afterHookedMethod(MethodHookParam param) throws Throwable { 46 | if("ro.product.brand".equals(param.args[0])) { 47 | String[] callingInfo = getCallingInfo(param.method.getName()); 48 | Logger logger = new Logger(); 49 | logger.setTag(TAG); 50 | logger.setCallingInfo(callingInfo[0]); 51 | logger.addRelatedAttrs("xrefFrom", callingInfo[1]); 52 | String brand = (String)param.getResult(); 53 | logger.addRelatedAttrs("brand", null == brand ? "" : brand); 54 | logger.recordAPICalling(param, "获取设备名称"); 55 | } 56 | } 57 | }); 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /app/src/main/java/com/softsec/mobsec/dae/apimonitor/hook/apis/ProcessHook.java: -------------------------------------------------------------------------------- 1 | package com.softsec.mobsec.dae.apimonitor.hook.apis; 2 | 3 | import com.softsec.mobsec.dae.apimonitor.hook.hookUtils.Hook; 4 | import com.softsec.mobsec.dae.apimonitor.hook.hookUtils.Logger; 5 | import com.softsec.mobsec.dae.apimonitor.hook.hookUtils.MethodHookHandler; 6 | import com.softsec.mobsec.dae.apimonitor.hook.hookUtils.MethodHookCallBack; 7 | import com.softsec.mobsec.dae.apimonitor.hook.hookUtils.Reflector; 8 | 9 | import java.lang.reflect.Method; 10 | 11 | import de.robv.android.xposed.XposedBridge; 12 | import de.robv.android.xposed.callbacks.XC_LoadPackage; 13 | 14 | public class ProcessHook extends Hook { 15 | 16 | public static final String TAG = "Process"; 17 | 18 | @Override 19 | public void initAllHooks(XC_LoadPackage.LoadPackageParam loadPackageParam) { 20 | 21 | 22 | try { 23 | Method startMethod = Reflector.findMethod(android.os.Process.class, "start", 24 | String.class, String.class, int.class, int.class, int[].class, int.class, 25 | int.class, int.class, String.class, String.class, String.class, String.class, 26 | String.class, String[].class); 27 | MethodHookHandler.hookMethod(startMethod, new MethodHookCallBack() { 28 | @Override 29 | protected void afterHookedMethod(MethodHookParam param) throws Throwable { 30 | int uid = (Integer) param.args[2]; 31 | if (uid == 10066) { 32 | int debugFlags = (Integer) param.args[5]; 33 | param.args[5] = (debugFlags | 0x1); 34 | Logger logger = new Logger(); 35 | logger.setTag(TAG); 36 | logger.recordAPICalling(param, "开启新进程", "debugFlags", String.valueOf(param.args[5])); 37 | } 38 | } 39 | }); 40 | }catch (Exception e){ 41 | Logger.logError(e); 42 | } 43 | } 44 | } 45 | 46 | 47 | -------------------------------------------------------------------------------- /app/src/main/java/com/softsec/mobsec/dae/apimonitor/hook/apis/RuntimeHook.java: -------------------------------------------------------------------------------- 1 | package com.softsec.mobsec.dae.apimonitor.hook.apis; 2 | 3 | import com.softsec.mobsec.dae.apimonitor.hook.hookUtils.Hook; 4 | import com.softsec.mobsec.dae.apimonitor.hook.hookUtils.Logger; 5 | import com.softsec.mobsec.dae.apimonitor.hook.hookUtils.MethodHookHandler; 6 | import com.softsec.mobsec.dae.apimonitor.hook.hookUtils.MethodHookCallBack; 7 | import com.softsec.mobsec.dae.apimonitor.hook.hookUtils.Reflector; 8 | 9 | import java.io.File; 10 | import java.lang.reflect.Method; 11 | 12 | import de.robv.android.xposed.callbacks.XC_LoadPackage; 13 | 14 | public class RuntimeHook extends Hook { 15 | 16 | public static final String TAG = "Runtime"; 17 | 18 | @Override 19 | public void initAllHooks(XC_LoadPackage.LoadPackageParam packageParam) { 20 | 21 | Method execmethod = Reflector.findMethod( 22 | Runtime.class, "exec", String[].class, String[].class, File.class); 23 | MethodHookHandler.hookMethod(execmethod, new MethodHookCallBack() { 24 | @Override 25 | protected void afterHookedMethod(MethodHookParam param) throws Throwable { 26 | String[] progs = (String[]) param.args[0]; 27 | String[] logs = new String[progs.length * 2]; 28 | for(int i = 0 ;i < progs.length; i++) { 29 | logs[i * 2] = "Command" + i; 30 | logs[i * 2 + 1] = progs[i]; 31 | } 32 | Logger logger = new Logger(); 33 | logger.setTag(TAG); 34 | logger.recordAPICalling(param, "执行命令", logs); 35 | } 36 | }); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /app/src/main/java/com/softsec/mobsec/dae/apimonitor/hook/apis/SensorManagerHook.java: -------------------------------------------------------------------------------- 1 | package com.softsec.mobsec.dae.apimonitor.hook.apis; 2 | 3 | import android.hardware.Sensor; 4 | import android.hardware.SensorManager; 5 | 6 | import com.softsec.mobsec.dae.apimonitor.hook.hookUtils.Hook; 7 | import com.softsec.mobsec.dae.apimonitor.hook.hookUtils.Logger; 8 | import com.softsec.mobsec.dae.apimonitor.hook.hookUtils.MethodHookHandler; 9 | import com.softsec.mobsec.dae.apimonitor.hook.hookUtils.MethodHookCallBack; 10 | import com.softsec.mobsec.dae.apimonitor.hook.hookUtils.Reflector; 11 | 12 | import java.lang.reflect.Method; 13 | import java.util.HashMap; 14 | import java.util.Map; 15 | 16 | import de.robv.android.xposed.callbacks.XC_LoadPackage; 17 | 18 | public class SensorManagerHook extends Hook { 19 | 20 | private static Map sensorTypeMap; 21 | static { 22 | sensorTypeMap = new HashMap<>(); 23 | sensorTypeMap.put(Sensor.TYPE_GRAVITY, "重力传感器"); 24 | sensorTypeMap.put(Sensor.TYPE_LINEAR_ACCELERATION, "线性加速度传感器"); 25 | sensorTypeMap.put(Sensor.TYPE_ROTATION_VECTOR, "旋转矢量传感器"); 26 | sensorTypeMap.put(Sensor.TYPE_SIGNIFICANT_MOTION, "有效运动传感器"); 27 | sensorTypeMap.put(Sensor.TYPE_STEP_COUNTER, "计步传感器"); 28 | sensorTypeMap.put(Sensor.TYPE_STEP_DETECTOR, "步测器传感器"); 29 | } 30 | 31 | public static final String TAG = "SensorManager"; 32 | 33 | @Override 34 | public void initAllHooks(XC_LoadPackage.LoadPackageParam packageParam) { 35 | 36 | Method getDefaultSensorMethod = Reflector.findMethod(SensorManager.class, "getDefaultSensor", int.class); 37 | MethodHookHandler.hookMethod(getDefaultSensorMethod, new MethodHookCallBack() { 38 | @Override 39 | protected void afterHookedMethod(MethodHookParam param) throws Throwable { 40 | super.afterHookedMethod(param); 41 | String[] callingInfo = getCallingInfo(param.method.getName()); 42 | Logger logger = new Logger(); 43 | logger.setTag(TAG); 44 | logger.setCallingInfo(callingInfo[0]); 45 | logger.addRelatedAttrs("xrefFrom", callingInfo[1]); 46 | logger.recordAPICalling(param, "获取传感器信息", 47 | "类型", sensorTypeMap.get((int)param.args[0])); 48 | } 49 | }); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /app/src/main/java/com/softsec/mobsec/dae/apimonitor/hook/apis/SettingsHook.java: -------------------------------------------------------------------------------- 1 | package com.softsec.mobsec.dae.apimonitor.hook.apis; 2 | 3 | import android.content.ContentResolver; 4 | import android.provider.Settings; 5 | 6 | import com.softsec.mobsec.dae.apimonitor.hook.hookUtils.Hook; 7 | import com.softsec.mobsec.dae.apimonitor.hook.hookUtils.Logger; 8 | import com.softsec.mobsec.dae.apimonitor.hook.hookUtils.MethodHookHandler; 9 | import com.softsec.mobsec.dae.apimonitor.hook.hookUtils.MethodHookCallBack; 10 | import com.softsec.mobsec.dae.apimonitor.hook.hookUtils.Reflector; 11 | 12 | import java.lang.reflect.Method; 13 | 14 | import de.robv.android.xposed.callbacks.XC_LoadPackage; 15 | 16 | public class SettingsHook extends Hook { 17 | 18 | public static final String TAG = "SettingsManager"; 19 | 20 | @Override 21 | public void initAllHooks(XC_LoadPackage.LoadPackageParam packageParam) { 22 | 23 | try { 24 | Method getStringMethod = Reflector.findMethod("android.provider.Settings$Secure", 25 | packageParam.classLoader, 26 | "getString", 27 | ContentResolver.class, String.class); 28 | MethodHookHandler.hookMethod(getStringMethod, new MethodHookCallBack() { 29 | @Override 30 | protected void afterHookedMethod(MethodHookParam param) throws Throwable { 31 | super.afterHookedMethod(param); 32 | if(Settings.Secure.ANDROID_ID.equals((String)param.args[1])) { 33 | String[] callingInfo = getCallingInfo(param.method.getName()); 34 | Logger logger = new Logger(); 35 | logger.setTag(TAG); 36 | logger.setCallingInfo(callingInfo[0]); 37 | logger.addRelatedAttrs("xrefFrom", callingInfo[1]); 38 | logger.addRelatedAttrs("result", (String)param.getResult()); 39 | logger.recordAPICalling(param, "获取Android ID"); 40 | } 41 | } 42 | }); 43 | } catch (NoSuchMethodException | ClassNotFoundException e) { 44 | Logger.logError(e); 45 | } 46 | 47 | 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /app/src/main/java/com/softsec/mobsec/dae/apimonitor/hook/apis/TestHook.java: -------------------------------------------------------------------------------- 1 | package com.softsec.mobsec.dae.apimonitor.hook.apis; 2 | 3 | import android.util.Log; 4 | 5 | import com.softsec.mobsec.dae.apimonitor.hook.hookUtils.Hook; 6 | import com.softsec.mobsec.dae.apimonitor.hook.hookUtils.Logger; 7 | import com.softsec.mobsec.dae.apimonitor.hook.hookUtils.MethodHookHandler; 8 | import com.softsec.mobsec.dae.apimonitor.hook.hookUtils.MethodHookCallBack; 9 | import com.softsec.mobsec.dae.apimonitor.hook.hookUtils.Reflector; 10 | import com.softsec.mobsec.dae.apimonitor.util.FileUtil; 11 | 12 | import java.lang.reflect.Method; 13 | 14 | import de.robv.android.xposed.XposedBridge; 15 | import de.robv.android.xposed.callbacks.XC_LoadPackage; 16 | 17 | public class TestHook extends Hook { 18 | 19 | @Override 20 | public void initAllHooks(XC_LoadPackage.LoadPackageParam packageParam) { 21 | Method iMethod = Reflector.findMethod(Log.class, "w", String.class, String.class); 22 | MethodHookHandler.hookMethod(iMethod, new MethodHookCallBack() { 23 | @Override 24 | protected void afterHookedMethod(MethodHookParam param) throws Throwable { 25 | XposedBridge.log((String)param.args[0] + ":" + (String)param.args[1]); 26 | FileUtil.writeToFile((String)param.args[1], "/sdcard/Android/data/com.cleanmaster.mguard_cn/xposedLog"); 27 | } 28 | }); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /app/src/main/java/com/softsec/mobsec/dae/apimonitor/hook/apis/WebViewHook.java: -------------------------------------------------------------------------------- 1 | package com.softsec.mobsec.dae.apimonitor.hook.apis; 2 | 3 | import com.softsec.mobsec.dae.apimonitor.hook.hookUtils.Hook; 4 | import com.softsec.mobsec.dae.apimonitor.hook.hookUtils.Logger; 5 | import com.softsec.mobsec.dae.apimonitor.hook.hookUtils.MethodHookHandler; 6 | import com.softsec.mobsec.dae.apimonitor.hook.hookUtils.MethodHookCallBack; 7 | import com.softsec.mobsec.dae.apimonitor.hook.hookUtils.Reflector; 8 | 9 | import java.lang.reflect.Method; 10 | 11 | import de.robv.android.xposed.callbacks.XC_LoadPackage; 12 | 13 | 14 | public class WebViewHook extends Hook { 15 | 16 | public static final String TAG = "WebView"; 17 | 18 | @Override 19 | public void initAllHooks(XC_LoadPackage.LoadPackageParam packageParam) { 20 | 21 | try { 22 | Method loadUrlMethod= Reflector.findMethod("android.webkit.WebView", 23 | packageParam.classLoader, "loadUrl", String.class); 24 | MethodHookHandler.hookMethod(loadUrlMethod, new MethodHookCallBack(){ 25 | @Override 26 | protected void afterHookedMethod(MethodHookParam param) throws Throwable { 27 | Logger logger = new Logger(); 28 | logger.setTag(TAG); 29 | logger.recordAPICalling(param, "通过WebView加载URL", "URL", (String)param.args[0]); 30 | } 31 | }); 32 | } catch (NoSuchMethodException | ClassNotFoundException e) { 33 | Logger.logError(e); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /app/src/main/java/com/softsec/mobsec/dae/apimonitor/hook/apis/httphook/virjarSocketHook/SocketPackEvent.java: -------------------------------------------------------------------------------- 1 | package com.softsec.mobsec.dae.apimonitor.hook.apis.httphook.virjarSocketHook; 2 | 3 | import java.net.Socket; 4 | import java.nio.charset.Charset; 5 | import java.util.HashMap; 6 | import java.util.Map; 7 | 8 | /** 9 | * 一个网络报文事件 10 | */ 11 | public class SocketPackEvent { 12 | public Socket socket; 13 | public Throwable stackTrace; 14 | public byte[] body; 15 | 16 | public int readAndWrite; 17 | 18 | public boolean isHttp = false; 19 | 20 | 21 | /** 22 | * 第一行,不是header区域,如在响应中:HTTP/1.1 200 OK ,如在请求中:GET /path?query 23 | */ 24 | public String httpFirstLine = null; 25 | 26 | public String httpFeatureKey = null; 27 | 28 | /** 29 | * 在http2.0,firstLine的数据会分成多行了,而且是一个map 30 | */ 31 | public Map http2Params = new HashMap<>(); 32 | 33 | public Map httpHeaders = new HashMap<>(); 34 | 35 | public byte[] httpHeaderContent = null; 36 | 37 | public byte[] httpBodyContent = null; 38 | 39 | public Charset charset; 40 | 41 | 42 | public boolean needDecodeHttpBody() { 43 | if (!isHttp) { 44 | return false; 45 | } 46 | 47 | return httpBodyContent != null && httpBodyContent.length != 0; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /app/src/main/java/com/softsec/mobsec/dae/apimonitor/hook/apis/httphook/virjarSocketHook/formatter/EventFormatter.java: -------------------------------------------------------------------------------- 1 | package com.softsec.mobsec.dae.apimonitor.hook.apis.httphook.virjarSocketHook.formatter; 2 | 3 | import com.softsec.mobsec.dae.apimonitor.hook.apis.httphook.virjarSocketHook.SocketPackEvent; 4 | 5 | public interface EventFormatter { 6 | String HTTP_BASE = "http_base"; 7 | String HTTP_CHUNKED_AGGRE = "http_chuncked_aggre"; 8 | 9 | String HTTP_UNZIP_GZIP = "http_unzip_gzip"; 10 | 11 | String HTTP_1_1_REQUEST = "http_1.1_req"; 12 | 13 | void formatEvent(SocketPackEvent socketPackEvent); 14 | } 15 | -------------------------------------------------------------------------------- /app/src/main/java/com/softsec/mobsec/dae/apimonitor/hook/apis/httphook/virjarSocketHook/formatter/GZipDecodeFormatter.java: -------------------------------------------------------------------------------- 1 | package com.softsec.mobsec.dae.apimonitor.hook.apis.httphook.virjarSocketHook.formatter; 2 | 3 | import android.util.Log; 4 | 5 | import com.softsec.mobsec.dae.apimonitor.hook.apis.httphook.virjarSocketHook.SocketPackEvent; 6 | 7 | import java.io.ByteArrayInputStream; 8 | import java.io.IOException; 9 | import java.util.Locale; 10 | import java.util.zip.GZIPInputStream; 11 | 12 | import com.softsec.mobsec.dae.apimonitor.hook.apis.httphook.virjarSocketHook.orgApacheCommons.io.IOUtils; 13 | import com.softsec.mobsec.dae.apimonitor.hook.apis.httphook.virjarSocketHook.orgApacheCommons.io.output.ByteArrayOutputStream; 14 | 15 | public class GZipDecodeFormatter implements EventFormatter { 16 | @Override 17 | public void formatEvent(SocketPackEvent socketPackEvent) { 18 | if (!socketPackEvent.needDecodeHttpBody()) { 19 | return; 20 | } 21 | 22 | boolean isGzip = false; 23 | if ("gzip".equalsIgnoreCase(socketPackEvent.httpHeaders.get("Content-Encoding".toLowerCase(Locale.US)))) { 24 | isGzip = true; 25 | } else { 26 | String contentType = socketPackEvent.httpHeaders.get("Content-Type".toLowerCase(Locale.US)); 27 | if (contentType != null && contentType.toLowerCase(Locale.US).contains("application/zip")) { 28 | isGzip = true; 29 | } 30 | } 31 | 32 | if (!isGzip) { 33 | return; 34 | } 35 | 36 | ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(socketPackEvent.httpBodyContent); 37 | ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); 38 | try { 39 | GZIPInputStream gzipInputStream = new GZIPInputStream(byteArrayInputStream); 40 | IOUtils.copy(gzipInputStream, byteArrayOutputStream); 41 | gzipInputStream.close(); 42 | byteArrayInputStream.close(); 43 | byteArrayOutputStream.close(); 44 | 45 | socketPackEvent.httpBodyContent = byteArrayOutputStream.toByteArray(); 46 | } catch (IOException e) { 47 | Log.w("RATEL", "http unzip gzip failed", e); 48 | } 49 | 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /app/src/main/java/com/softsec/mobsec/dae/apimonitor/hook/apis/httphook/virjarSocketHook/formatter/HttpChunckAggregateFormatter.java: -------------------------------------------------------------------------------- 1 | package com.softsec.mobsec.dae.apimonitor.hook.apis.httphook.virjarSocketHook.formatter; 2 | 3 | import android.text.TextUtils; 4 | import android.util.Log; 5 | 6 | import com.softsec.mobsec.dae.apimonitor.hook.apis.httphook.virjarSocketHook.SocketPackEvent; 7 | 8 | import java.util.Locale; 9 | 10 | import com.softsec.mobsec.dae.apimonitor.hook.apis.httphook.virjarSocketHook.orgApacheCommons.io.output.ByteArrayOutputStream; 11 | 12 | public class HttpChunckAggregateFormatter implements EventFormatter { 13 | @Override 14 | public void formatEvent(SocketPackEvent socketPackEvent) { 15 | if (!socketPackEvent.needDecodeHttpBody()) { 16 | return; 17 | } 18 | if (!"chunked".equalsIgnoreCase(socketPackEvent.httpHeaders.get("Transfer-Encoding".toLowerCase(Locale.US)))) { 19 | return; 20 | } 21 | 22 | ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); 23 | int index = 0; 24 | while (index < socketPackEvent.httpBodyContent.length) { 25 | int lineEnd = findLineEnd(index, socketPackEvent.httpBodyContent); 26 | if (lineEnd < index) { 27 | Log.w("RATEL", "http chunked decode error"); 28 | return; 29 | } 30 | String chunkLengthString = new String(socketPackEvent.httpBodyContent, index, lineEnd - index).trim(); 31 | int chunkLength = 0; 32 | if (!TextUtils.isEmpty(chunkLengthString)) { 33 | //最后的换行符,会导致最后一次读取到空行 34 | chunkLength = Integer.parseInt(chunkLengthString, 16); 35 | } 36 | if (chunkLength == 0) { 37 | //the chunck end 38 | socketPackEvent.httpBodyContent = byteArrayOutputStream.toByteArray(); 39 | return; 40 | } 41 | 42 | byteArrayOutputStream.write(socketPackEvent.httpBodyContent, lineEnd, chunkLength); 43 | index = lineEnd + chunkLength; 44 | } 45 | 46 | Log.w("RATEL", "http chunked decode error"); 47 | } 48 | 49 | private int findLineEnd(int start, byte[] data) { 50 | int index = start; 51 | while (index < data.length - 1) { 52 | if (data[index] == '\r' && data[index + 1] == '\n') { 53 | return index + 2; 54 | } else if (data[index] == '\n') { 55 | return index + 1; 56 | } 57 | index++; 58 | } 59 | return -1; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /app/src/main/java/com/softsec/mobsec/dae/apimonitor/hook/apis/httphook/virjarSocketHook/observer/EventObserver.java: -------------------------------------------------------------------------------- 1 | package com.softsec.mobsec.dae.apimonitor.hook.apis.httphook.virjarSocketHook.observer; 2 | 3 | import com.softsec.mobsec.dae.apimonitor.hook.apis.httphook.virjarSocketHook.SocketPackEvent; 4 | 5 | public interface EventObserver { 6 | void onSocketPackageArrival(SocketPackEvent socketPackEvent); 7 | } 8 | -------------------------------------------------------------------------------- /app/src/main/java/com/softsec/mobsec/dae/apimonitor/hook/apis/httphook/virjarSocketHook/orgApacheCommons/io/FileExistsException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.softsec.mobsec.dae.apimonitor.hook.apis.httphook.virjarSocketHook.orgApacheCommons.io; 18 | 19 | import java.io.File; 20 | import java.io.IOException; 21 | 22 | /** 23 | * Indicates that a file already exists. 24 | * 25 | * @since 2.0 26 | */ 27 | public class FileExistsException extends IOException { 28 | 29 | /** 30 | * Defines the serial version UID. 31 | */ 32 | private static final long serialVersionUID = 1L; 33 | 34 | /** 35 | * Default Constructor. 36 | */ 37 | public FileExistsException() { 38 | super(); 39 | } 40 | 41 | /** 42 | * Construct an instance with the specified message. 43 | * 44 | * @param message The error message 45 | */ 46 | public FileExistsException(final String message) { 47 | super(message); 48 | } 49 | 50 | /** 51 | * Construct an instance with the specified file. 52 | * 53 | * @param file The file that exists 54 | */ 55 | public FileExistsException(final File file) { 56 | super("File " + file + " exists"); 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /app/src/main/java/com/softsec/mobsec/dae/apimonitor/hook/apis/httphook/virjarSocketHook/orgApacheCommons/io/IOExceptionWithCause.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package com.softsec.mobsec.dae.apimonitor.hook.apis.httphook.virjarSocketHook.orgApacheCommons.io; 19 | 20 | import java.io.IOException; 21 | 22 | /** 23 | * Subclasses IOException with the {@link Throwable} constructors missing before Java 6. 24 | * 25 | * @since 1.4 26 | * @deprecated (since 2.5) use {@link IOException} instead 27 | */ 28 | @Deprecated 29 | public class IOExceptionWithCause extends IOException { 30 | 31 | /** 32 | * Defines the serial version UID. 33 | */ 34 | private static final long serialVersionUID = 1L; 35 | 36 | /** 37 | * Constructs a new instance with the given message and cause. 38 | *

39 | * As specified in {@link Throwable}, the message in the given cause is not used in this instance's 40 | * message. 41 | *

42 | * 43 | * @param message 44 | * the message (see {@link #getMessage()}) 45 | * @param cause 46 | * the cause (see {@link #getCause()}). A {@code null} value is allowed. 47 | */ 48 | public IOExceptionWithCause(final String message, final Throwable cause) { 49 | super(message, cause); 50 | } 51 | 52 | /** 53 | * Constructs a new instance with the given cause. 54 | *

55 | * The message is set to cause==null ? null : cause.toString(), which by default contains the class 56 | * and message of cause. This constructor is useful for call sites that just wrap another throwable. 57 | *

58 | * 59 | * @param cause 60 | * the cause (see {@link #getCause()}). A {@code null} value is allowed. 61 | */ 62 | public IOExceptionWithCause(final Throwable cause) { 63 | super(cause); 64 | } 65 | 66 | } 67 | -------------------------------------------------------------------------------- /app/src/main/java/com/softsec/mobsec/dae/apimonitor/hook/apis/httphook/virjarSocketHook/orgApacheCommons/io/comparator/AbstractFileComparator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.softsec.mobsec.dae.apimonitor.hook.apis.httphook.virjarSocketHook.orgApacheCommons.io.comparator; 18 | 19 | import java.io.File; 20 | import java.util.Arrays; 21 | import java.util.Collections; 22 | import java.util.Comparator; 23 | import java.util.List; 24 | 25 | /** 26 | * Abstract file {@link Comparator} which provides sorting for file arrays and lists. 27 | * 28 | * @since 2.0 29 | */ 30 | abstract class AbstractFileComparator implements Comparator { 31 | 32 | /** 33 | * Sort an array of files. 34 | *

35 | * This method uses {@link Arrays#sort(Object[], Comparator)} 36 | * and returns the original array. 37 | * 38 | * @param files The files to sort, may be null 39 | * @return The sorted array 40 | * @since 2.0 41 | */ 42 | public File[] sort(final File... files) { 43 | if (files != null) { 44 | Arrays.sort(files, this); 45 | } 46 | return files; 47 | } 48 | 49 | /** 50 | * Sort a List of files. 51 | *

52 | * This method uses {@link Collections#sort(List, Comparator)} 53 | * and returns the original list. 54 | * 55 | * @param files The files to sort, may be null 56 | * @return The sorted list 57 | * @since 2.0 58 | */ 59 | public List sort(final List files) { 60 | if (files != null) { 61 | Collections.sort(files, this); 62 | } 63 | return files; 64 | } 65 | 66 | /** 67 | * String representation of this file comparator. 68 | * 69 | * @return String representation of this file comparator 70 | */ 71 | @Override 72 | public String toString() { 73 | return getClass().getSimpleName(); 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /app/src/main/java/com/softsec/mobsec/dae/apimonitor/hook/apis/httphook/virjarSocketHook/orgApacheCommons/io/comparator/ReverseComparator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.softsec.mobsec.dae.apimonitor.hook.apis.httphook.virjarSocketHook.orgApacheCommons.io.comparator; 18 | 19 | import java.io.File; 20 | import java.io.Serializable; 21 | import java.util.Comparator; 22 | 23 | /** 24 | * Reverses the result of comparing two objects using 25 | * the delegate {@link Comparator}. 26 | * 27 | * @since 1.4 28 | */ 29 | class ReverseComparator extends AbstractFileComparator implements Serializable { 30 | 31 | private static final long serialVersionUID = -4808255005272229056L; 32 | private final Comparator delegate; 33 | 34 | /** 35 | * Construct an instance with the specified delegate {@link Comparator}. 36 | * 37 | * @param delegate The comparator to delegate to 38 | */ 39 | public ReverseComparator(final Comparator delegate) { 40 | if (delegate == null) { 41 | throw new IllegalArgumentException("Delegate comparator is missing"); 42 | } 43 | this.delegate = delegate; 44 | } 45 | 46 | /** 47 | * Compare using the delegate Comparator, but reversing the result. 48 | * 49 | * @param file1 The first file to compare 50 | * @param file2 The second file to compare 51 | * @return the result from the delegate {@link Comparator#compare(Object, Object)} 52 | * reversing the value (i.e. positive becomes negative and vice versa) 53 | */ 54 | @Override 55 | public int compare(final File file1, final File file2) { 56 | return delegate.compare(file2, file1); // parameters switched round 57 | } 58 | 59 | /** 60 | * String representation of this file comparator. 61 | * 62 | * @return String representation of this file comparator 63 | */ 64 | @Override 65 | public String toString() { 66 | return super.toString() + "[" + delegate.toString() + "]"; 67 | } 68 | 69 | } 70 | -------------------------------------------------------------------------------- /app/src/main/java/com/softsec/mobsec/dae/apimonitor/hook/apis/httphook/virjarSocketHook/orgApacheCommons/io/filefilter/AbstractFileFilter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.softsec.mobsec.dae.apimonitor.hook.apis.httphook.virjarSocketHook.orgApacheCommons.io.filefilter; 18 | 19 | import java.io.File; 20 | 21 | /** 22 | * An abstract class which implements the Java FileFilter and FilenameFilter 23 | * interfaces via the IOFileFilter interface. 24 | *

25 | * Note that a subclass must override one of the accept methods, 26 | * otherwise your class will infinitely loop. 27 | * 28 | * @since 1.0 29 | * @version $Id$ 30 | */ 31 | public abstract class AbstractFileFilter implements IOFileFilter { 32 | 33 | /** 34 | * Checks to see if the File should be accepted by this filter. 35 | * 36 | * @param file the File to check 37 | * @return true if this file matches the test 38 | */ 39 | @Override 40 | public boolean accept(final File file) { 41 | return accept(file.getParentFile(), file.getName()); 42 | } 43 | 44 | /** 45 | * Checks to see if the File should be accepted by this filter. 46 | * 47 | * @param dir the directory File to check 48 | * @param name the filename within the directory to check 49 | * @return true if this file matches the test 50 | */ 51 | @Override 52 | public boolean accept(final File dir, final String name) { 53 | return accept(new File(dir, name)); 54 | } 55 | 56 | /** 57 | * Provide a String representation of this file filter. 58 | * 59 | * @return a String representation 60 | */ 61 | @Override 62 | public String toString() { 63 | return getClass().getSimpleName(); 64 | } 65 | 66 | } 67 | -------------------------------------------------------------------------------- /app/src/main/java/com/softsec/mobsec/dae/apimonitor/hook/apis/httphook/virjarSocketHook/orgApacheCommons/io/filefilter/ConditionalFileFilter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.softsec.mobsec.dae.apimonitor.hook.apis.httphook.virjarSocketHook.orgApacheCommons.io.filefilter; 18 | 19 | import java.util.List; 20 | 21 | /** 22 | * Defines operations for conditional file filters. 23 | * 24 | * @since 1.1 25 | * @version $Id$ 26 | */ 27 | public interface ConditionalFileFilter { 28 | 29 | /** 30 | * Adds the specified file filter to the list of file filters at the end of 31 | * the list. 32 | * 33 | * @param ioFileFilter the filter to be added 34 | * @since 1.1 35 | */ 36 | void addFileFilter(IOFileFilter ioFileFilter); 37 | 38 | /** 39 | * Returns this conditional file filter's list of file filters. 40 | * 41 | * @return the file filter list 42 | * @since 1.1 43 | */ 44 | List getFileFilters(); 45 | 46 | /** 47 | * Removes the specified file filter. 48 | * 49 | * @param ioFileFilter filter to be removed 50 | * @return {@code true} if the filter was found in the list, 51 | * {@code false} otherwise 52 | * @since 1.1 53 | */ 54 | boolean removeFileFilter(IOFileFilter ioFileFilter); 55 | 56 | /** 57 | * Sets the list of file filters, replacing any previously configured 58 | * file filters on this filter. 59 | * 60 | * @param fileFilters the list of filters 61 | * @since 1.1 62 | */ 63 | void setFileFilters(List fileFilters); 64 | 65 | } 66 | -------------------------------------------------------------------------------- /app/src/main/java/com/softsec/mobsec/dae/apimonitor/hook/apis/httphook/virjarSocketHook/orgApacheCommons/io/filefilter/DirectoryFileFilter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.softsec.mobsec.dae.apimonitor.hook.apis.httphook.virjarSocketHook.orgApacheCommons.io.filefilter; 18 | 19 | import java.io.File; 20 | import java.io.Serializable; 21 | 22 | /** 23 | * This filter accepts Files that are directories. 24 | *

25 | * For example, here is how to print out a list of the 26 | * current directory's subdirectories: 27 | * 28 | *

29 |  * File dir = new File(".");
30 |  * String[] files = dir.list( DirectoryFileFilter.INSTANCE );
31 |  * for ( int i = 0; i < files.length; i++ ) {
32 |  *     System.out.println(files[i]);
33 |  * }
34 |  * 
35 | * 36 | * @since 1.0 37 | * @version $Id$ 38 | * 39 | * @see FileFilterUtils#directoryFileFilter() 40 | */ 41 | public class DirectoryFileFilter extends AbstractFileFilter implements Serializable { 42 | 43 | private static final long serialVersionUID = -5148237843784525732L; 44 | /** 45 | * Singleton instance of directory filter. 46 | * @since 1.3 47 | */ 48 | public static final IOFileFilter DIRECTORY = new DirectoryFileFilter(); 49 | /** 50 | * Singleton instance of directory filter. 51 | * Please use the identical DirectoryFileFilter.DIRECTORY constant. 52 | * The new name is more JDK 1.5 friendly as it doesn't clash with other 53 | * values when using static imports. 54 | */ 55 | public static final IOFileFilter INSTANCE = DIRECTORY; 56 | 57 | /** 58 | * Restrictive constructor. 59 | */ 60 | protected DirectoryFileFilter() { 61 | } 62 | 63 | /** 64 | * Checks to see if the file is a directory. 65 | * 66 | * @param file the File to check 67 | * @return true if the file is a directory 68 | */ 69 | @Override 70 | public boolean accept(final File file) { 71 | return file.isDirectory(); 72 | } 73 | 74 | } 75 | -------------------------------------------------------------------------------- /app/src/main/java/com/softsec/mobsec/dae/apimonitor/hook/apis/httphook/virjarSocketHook/orgApacheCommons/io/filefilter/FalseFileFilter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.softsec.mobsec.dae.apimonitor.hook.apis.httphook.virjarSocketHook.orgApacheCommons.io.filefilter; 18 | 19 | import java.io.File; 20 | import java.io.Serializable; 21 | 22 | /** 23 | * A file filter that always returns false. 24 | * 25 | * @since 1.0 26 | * @version $Id$ 27 | * 28 | * @see FileFilterUtils#falseFileFilter() 29 | */ 30 | public class FalseFileFilter implements IOFileFilter, Serializable { 31 | 32 | private static final long serialVersionUID = 6210271677940926200L; 33 | /** 34 | * Singleton instance of false filter. 35 | * @since 1.3 36 | */ 37 | public static final IOFileFilter FALSE = new FalseFileFilter(); 38 | /** 39 | * Singleton instance of false filter. 40 | * Please use the identical FalseFileFilter.FALSE constant. 41 | * The new name is more JDK 1.5 friendly as it doesn't clash with other 42 | * values when using static imports. 43 | */ 44 | public static final IOFileFilter INSTANCE = FALSE; 45 | 46 | /** 47 | * Restrictive constructor. 48 | */ 49 | protected FalseFileFilter() { 50 | } 51 | 52 | /** 53 | * Returns false. 54 | * 55 | * @param file the file to check (ignored) 56 | * @return false 57 | */ 58 | @Override 59 | public boolean accept(final File file) { 60 | return false; 61 | } 62 | 63 | /** 64 | * Returns false. 65 | * 66 | * @param dir the directory to check (ignored) 67 | * @param name the filename (ignored) 68 | * @return false 69 | */ 70 | @Override 71 | public boolean accept(final File dir, final String name) { 72 | return false; 73 | } 74 | 75 | } 76 | -------------------------------------------------------------------------------- /app/src/main/java/com/softsec/mobsec/dae/apimonitor/hook/apis/httphook/virjarSocketHook/orgApacheCommons/io/filefilter/FileFileFilter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.softsec.mobsec.dae.apimonitor.hook.apis.httphook.virjarSocketHook.orgApacheCommons.io.filefilter; 18 | 19 | import java.io.File; 20 | import java.io.Serializable; 21 | 22 | /** 23 | * This filter accepts Files that are files (not directories). 24 | *

25 | * For example, here is how to print out a list of the real files 26 | * within the current directory: 27 | * 28 | *

29 |  * File dir = new File(".");
30 |  * String[] files = dir.list( FileFileFilter.FILE );
31 |  * for ( int i = 0; i < files.length; i++ ) {
32 |  *     System.out.println(files[i]);
33 |  * }
34 |  * 
35 | * 36 | * @since 1.3 37 | * @version $Id$ 38 | * @see FileFilterUtils#fileFileFilter() 39 | */ 40 | public class FileFileFilter extends AbstractFileFilter implements Serializable { 41 | 42 | private static final long serialVersionUID = 5345244090827540862L; 43 | /** Singleton instance of file filter */ 44 | public static final IOFileFilter FILE = new FileFileFilter(); 45 | 46 | /** 47 | * Restrictive constructor. 48 | */ 49 | protected FileFileFilter() { 50 | } 51 | 52 | /** 53 | * Checks to see if the file is a file. 54 | * 55 | * @param file the File to check 56 | * @return true if the file is a file 57 | */ 58 | @Override 59 | public boolean accept(final File file) { 60 | return file.isFile(); 61 | } 62 | 63 | } 64 | -------------------------------------------------------------------------------- /app/src/main/java/com/softsec/mobsec/dae/apimonitor/hook/apis/httphook/virjarSocketHook/orgApacheCommons/io/filefilter/IOFileFilter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.softsec.mobsec.dae.apimonitor.hook.apis.httphook.virjarSocketHook.orgApacheCommons.io.filefilter; 18 | 19 | import java.io.File; 20 | import java.io.FileFilter; 21 | import java.io.FilenameFilter; 22 | 23 | /** 24 | * An interface which brings the FileFilter and FilenameFilter 25 | * interfaces together. 26 | * 27 | * @since 1.0 28 | * @version $Id$ 29 | */ 30 | public interface IOFileFilter extends FileFilter, FilenameFilter { 31 | 32 | /** 33 | * Checks to see if the File should be accepted by this filter. 34 | *

35 | * Defined in {@link FileFilter}. 36 | * 37 | * @param file the File to check 38 | * @return true if this file matches the test 39 | */ 40 | @Override 41 | boolean accept(File file); 42 | 43 | /** 44 | * Checks to see if the File should be accepted by this filter. 45 | *

46 | * Defined in {@link FilenameFilter}. 47 | * 48 | * @param dir the directory File to check 49 | * @param name the filename within the directory to check 50 | * @return true if this file matches the test 51 | */ 52 | @Override 53 | boolean accept(File dir, String name); 54 | 55 | } 56 | -------------------------------------------------------------------------------- /app/src/main/java/com/softsec/mobsec/dae/apimonitor/hook/apis/httphook/virjarSocketHook/orgApacheCommons/io/filefilter/TrueFileFilter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.softsec.mobsec.dae.apimonitor.hook.apis.httphook.virjarSocketHook.orgApacheCommons.io.filefilter; 18 | 19 | import java.io.File; 20 | import java.io.Serializable; 21 | 22 | /** 23 | * A file filter that always returns true. 24 | * 25 | * @since 1.0 26 | * @version $Id$ 27 | * @see FileFilterUtils#trueFileFilter() 28 | */ 29 | public class TrueFileFilter implements IOFileFilter, Serializable { 30 | 31 | private static final long serialVersionUID = 8782512160909720199L; 32 | /** 33 | * Singleton instance of true filter. 34 | * @since 1.3 35 | */ 36 | public static final IOFileFilter TRUE = new TrueFileFilter(); 37 | /** 38 | * Singleton instance of true filter. 39 | * Please use the identical TrueFileFilter.TRUE constant. 40 | * The new name is more JDK 1.5 friendly as it doesn't clash with other 41 | * values when using static imports. 42 | */ 43 | public static final IOFileFilter INSTANCE = TRUE; 44 | 45 | /** 46 | * Restrictive constructor. 47 | */ 48 | protected TrueFileFilter() { 49 | } 50 | 51 | /** 52 | * Returns true. 53 | * 54 | * @param file the file to check (ignored) 55 | * @return true 56 | */ 57 | @Override 58 | public boolean accept(final File file) { 59 | return true; 60 | } 61 | 62 | /** 63 | * Returns true. 64 | * 65 | * @param dir the directory to check (ignored) 66 | * @param name the filename (ignored) 67 | * @return true 68 | */ 69 | @Override 70 | public boolean accept(final File dir, final String name) { 71 | return true; 72 | } 73 | 74 | } 75 | -------------------------------------------------------------------------------- /app/src/main/java/com/softsec/mobsec/dae/apimonitor/hook/apis/httphook/virjarSocketHook/orgApacheCommons/io/input/CloseShieldInputStream.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.softsec.mobsec.dae.apimonitor.hook.apis.httphook.virjarSocketHook.orgApacheCommons.io.input; 18 | 19 | import java.io.InputStream; 20 | 21 | /** 22 | * Proxy stream that prevents the underlying input stream from being closed. 23 | *

24 | * This class is typically used in cases where an input stream needs to be 25 | * passed to a component that wants to explicitly close the stream even if 26 | * more input would still be available to other components. 27 | * 28 | * @since 1.4 29 | */ 30 | public class CloseShieldInputStream extends ProxyInputStream { 31 | 32 | /** 33 | * Creates a proxy that shields the given input stream from being 34 | * closed. 35 | * 36 | * @param in underlying input stream 37 | */ 38 | public CloseShieldInputStream(final InputStream in) { 39 | super(in); 40 | } 41 | 42 | /** 43 | * Replaces the underlying input stream with a {@link ClosedInputStream} 44 | * sentinel. The original input stream will remain open, but this proxy 45 | * will appear closed. 46 | */ 47 | @Override 48 | public void close() { 49 | in = new ClosedInputStream(); 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /app/src/main/java/com/softsec/mobsec/dae/apimonitor/hook/apis/httphook/virjarSocketHook/orgApacheCommons/io/input/ClosedInputStream.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.softsec.mobsec.dae.apimonitor.hook.apis.httphook.virjarSocketHook.orgApacheCommons.io.input; 18 | 19 | import static com.softsec.mobsec.dae.apimonitor.hook.apis.httphook.virjarSocketHook.orgApacheCommons.io.IOUtils.EOF; 20 | 21 | import java.io.InputStream; 22 | 23 | /** 24 | * Closed input stream. This stream returns EOF to all attempts to read 25 | * something from the stream. 26 | *

27 | * Typically uses of this class include testing for corner cases in methods 28 | * that accept input streams and acting as a sentinel value instead of a 29 | * {@code null} input stream. 30 | * 31 | * @since 1.4 32 | */ 33 | public class ClosedInputStream extends InputStream { 34 | 35 | /** 36 | * A singleton. 37 | */ 38 | public static final ClosedInputStream CLOSED_INPUT_STREAM = new ClosedInputStream(); 39 | 40 | /** 41 | * Returns -1 to indicate that the stream is closed. 42 | * 43 | * @return always -1 44 | */ 45 | @Override 46 | public int read() { 47 | return EOF; 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /app/src/main/java/com/softsec/mobsec/dae/apimonitor/hook/apis/httphook/virjarSocketHook/orgApacheCommons/io/input/InfiniteCircularInputStream.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.softsec.mobsec.dae.apimonitor.hook.apis.httphook.virjarSocketHook.orgApacheCommons.io.input; 18 | 19 | import java.io.InputStream; 20 | 21 | /** 22 | * 23 | * An {@link InputStream} that infinitely repeats provided bytes. 24 | *

25 | * Closing a InfiniteCircularInputStream has no effect. The methods in 26 | * this class can be called after the stream has been closed without generating 27 | * an IOException. 28 | * 29 | */ 30 | public class InfiniteCircularInputStream extends InputStream { 31 | 32 | final private byte[] repeatedContent; 33 | private int position = -1; 34 | 35 | /** 36 | * Creates a InfiniteCircularStream from the specified array of chars. 37 | * 38 | * @param repeatedContent 39 | * Input buffer to be repeated (not copied) 40 | */ 41 | public InfiniteCircularInputStream(final byte[] repeatedContent) { 42 | this.repeatedContent = repeatedContent; 43 | } 44 | 45 | @Override 46 | public int read() { 47 | position = (position + 1) % repeatedContent.length; 48 | return repeatedContent[position] & 0xff; // copied from 49 | // java.io.ByteArrayInputStream.read() 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /app/src/main/java/com/softsec/mobsec/dae/apimonitor/hook/apis/httphook/virjarSocketHook/orgApacheCommons/io/input/TailerListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.softsec.mobsec.dae.apimonitor.hook.apis.httphook.virjarSocketHook.orgApacheCommons.io.input; 18 | 19 | /** 20 | * Listener for events from a {@link Tailer}. 21 | * 22 | * @since 2.0 23 | */ 24 | public interface TailerListener { 25 | 26 | /** 27 | * The tailer will call this method during construction, 28 | * giving the listener a method of stopping the tailer. 29 | * @param tailer the tailer. 30 | */ 31 | void init(Tailer tailer); 32 | 33 | /** 34 | * This method is called if the tailed file is not found. 35 | *

36 | * Note: this is called from the tailer thread. 37 | */ 38 | void fileNotFound(); 39 | 40 | /** 41 | * Called if a file rotation is detected. 42 | * 43 | * This method is called before the file is reopened, and fileNotFound may 44 | * be called if the new file has not yet been created. 45 | *

46 | * Note: this is called from the tailer thread. 47 | */ 48 | void fileRotated(); 49 | 50 | /** 51 | * Handles a line from a Tailer. 52 | *

53 | * Note: this is called from the tailer thread. 54 | * @param line the line. 55 | */ 56 | void handle(String line); 57 | 58 | /** 59 | * Handles an Exception . 60 | *

61 | * Note: this is called from the tailer thread. 62 | * @param ex the exception. 63 | */ 64 | void handle(Exception ex); 65 | 66 | } 67 | -------------------------------------------------------------------------------- /app/src/main/java/com/softsec/mobsec/dae/apimonitor/hook/apis/httphook/virjarSocketHook/orgApacheCommons/io/input/TailerListenerAdapter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.softsec.mobsec.dae.apimonitor.hook.apis.httphook.virjarSocketHook.orgApacheCommons.io.input; 18 | 19 | /** 20 | * {@link TailerListener} Adapter. 21 | * 22 | * @since 2.0 23 | */ 24 | public class TailerListenerAdapter implements TailerListener { 25 | 26 | /** 27 | * The tailer will call this method during construction, 28 | * giving the listener a method of stopping the tailer. 29 | * @param tailer the tailer. 30 | */ 31 | @Override 32 | public void init(final Tailer tailer) { 33 | } 34 | 35 | /** 36 | * This method is called if the tailed file is not found. 37 | */ 38 | @Override 39 | public void fileNotFound() { 40 | } 41 | 42 | /** 43 | * Called if a file rotation is detected. 44 | * 45 | * This method is called before the file is reopened, and fileNotFound may 46 | * be called if the new file has not yet been created. 47 | */ 48 | @Override 49 | public void fileRotated() { 50 | } 51 | 52 | /** 53 | * Handles a line from a Tailer. 54 | * @param line the line. 55 | */ 56 | @Override 57 | public void handle(final String line) { 58 | } 59 | 60 | /** 61 | * Handles an Exception . 62 | * @param ex the exception. 63 | */ 64 | @Override 65 | public void handle(final Exception ex) { 66 | } 67 | 68 | /** 69 | * Called each time the Tailer reaches the end of the file. 70 | * 71 | * Note: this is called from the tailer thread. 72 | * 73 | * Note: a future version of commons-io will pull this method up to the TailerListener interface, 74 | * for now clients must subclass this class to use this feature. 75 | * 76 | * @since 2.5 77 | */ 78 | public void endOfFileReached() { 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /app/src/main/java/com/softsec/mobsec/dae/apimonitor/hook/apis/httphook/virjarSocketHook/orgApacheCommons/io/input/package.html: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 |

21 | This package provides implementations of input classes, such as 22 | InputStream and Reader. 23 |

24 | 25 | 26 | -------------------------------------------------------------------------------- /app/src/main/java/com/softsec/mobsec/dae/apimonitor/hook/apis/httphook/virjarSocketHook/orgApacheCommons/io/monitor/package.html: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 |

21 | This package provides a component for monitoring file system events 22 | (directory and file create, update and delete events). 23 |

24 | 25 | 26 | -------------------------------------------------------------------------------- /app/src/main/java/com/softsec/mobsec/dae/apimonitor/hook/apis/httphook/virjarSocketHook/orgApacheCommons/io/output/AppendableOutputStream.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.softsec.mobsec.dae.apimonitor.hook.apis.httphook.virjarSocketHook.orgApacheCommons.io.output; 18 | 19 | import java.io.IOException; 20 | import java.io.OutputStream; 21 | 22 | /** 23 | * OutputStream implementation that writes the data to an {@link Appendable} 24 | * Object. 25 | *

26 | * For example, can be used with any {@link java.io.Writer} or a {@link StringBuilder} 27 | * or {@link StringBuffer}. 28 | * 29 | * @since 2.5 30 | * @see Appendable 31 | * @version $Id$ 32 | */ 33 | public class AppendableOutputStream extends OutputStream { 34 | 35 | private final T appendable; 36 | 37 | /** 38 | * Construct a new instance with the specified appendable. 39 | * 40 | * @param appendable the appendable to write to 41 | */ 42 | public AppendableOutputStream(final T appendable) { 43 | this.appendable = appendable; 44 | } 45 | 46 | /** 47 | * Write a character to the underlying appendable. 48 | * 49 | * @param b the character to write 50 | * @throws IOException upon error 51 | */ 52 | @Override 53 | public void write(final int b) throws IOException { 54 | appendable.append((char)b); 55 | } 56 | 57 | /** 58 | * Return the target appendable. 59 | * 60 | * @return the target appendable 61 | */ 62 | public T getAppendable() { 63 | return appendable; 64 | } 65 | 66 | } 67 | -------------------------------------------------------------------------------- /app/src/main/java/com/softsec/mobsec/dae/apimonitor/hook/apis/httphook/virjarSocketHook/orgApacheCommons/io/output/CloseShieldOutputStream.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.softsec.mobsec.dae.apimonitor.hook.apis.httphook.virjarSocketHook.orgApacheCommons.io.output; 18 | 19 | import java.io.OutputStream; 20 | 21 | /** 22 | * Proxy stream that prevents the underlying output stream from being closed. 23 | *

24 | * This class is typically used in cases where an output stream needs to be 25 | * passed to a component that wants to explicitly close the stream even if 26 | * other components would still use the stream for output. 27 | *

28 | * @version $Id$ 29 | * @since 1.4 30 | */ 31 | public class CloseShieldOutputStream extends ProxyOutputStream { 32 | 33 | /** 34 | * Creates a proxy that shields the given output stream from being 35 | * closed. 36 | * 37 | * @param out underlying output stream 38 | */ 39 | public CloseShieldOutputStream(final OutputStream out) { 40 | super(out); 41 | } 42 | 43 | /** 44 | * Replaces the underlying output stream with a {@link ClosedOutputStream} 45 | * sentinel. The original output stream will remain open, but this proxy 46 | * will appear closed. 47 | */ 48 | @Override 49 | public void close() { 50 | out = new ClosedOutputStream(); 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /app/src/main/java/com/softsec/mobsec/dae/apimonitor/hook/apis/httphook/virjarSocketHook/orgApacheCommons/io/output/ClosedOutputStream.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.softsec.mobsec.dae.apimonitor.hook.apis.httphook.virjarSocketHook.orgApacheCommons.io.output; 18 | 19 | import java.io.IOException; 20 | import java.io.OutputStream; 21 | 22 | /** 23 | * Closed output stream. This stream throws an exception on all attempts to 24 | * write something to the stream. 25 | *

26 | * Typically uses of this class include testing for corner cases in methods 27 | * that accept an output stream and acting as a sentinel value instead of 28 | * a {@code null} output stream. 29 | * 30 | * @since 1.4 31 | */ 32 | public class ClosedOutputStream extends OutputStream { 33 | 34 | /** 35 | * A singleton. 36 | */ 37 | public static final ClosedOutputStream CLOSED_OUTPUT_STREAM = new ClosedOutputStream(); 38 | 39 | /** 40 | * Throws an {@link IOException} to indicate that the stream is closed. 41 | * 42 | * @param b ignored 43 | * @throws IOException always thrown 44 | */ 45 | @Override 46 | public void write(final int b) throws IOException { 47 | throw new IOException("write(" + b + ") failed: stream is closed"); 48 | } 49 | 50 | /** 51 | * Throws an {@link IOException} to indicate that the stream is closed. 52 | * 53 | * @throws IOException always thrown 54 | */ 55 | @Override 56 | public void flush() throws IOException { 57 | throw new IOException("flush() failed: stream is closed"); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /app/src/main/java/com/softsec/mobsec/dae/apimonitor/hook/apis/httphook/virjarSocketHook/orgApacheCommons/io/output/NullOutputStream.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.softsec.mobsec.dae.apimonitor.hook.apis.httphook.virjarSocketHook.orgApacheCommons.io.output; 18 | 19 | import java.io.IOException; 20 | import java.io.OutputStream; 21 | 22 | /** 23 | * This OutputStream writes all data to the famous /dev/null. 24 | *

25 | * This output stream has no destination (file/socket etc.) and all 26 | * bytes written to it are ignored and lost. 27 | *

28 | * @version $Id$ 29 | */ 30 | public class NullOutputStream extends OutputStream { 31 | 32 | /** 33 | * A singleton. 34 | */ 35 | public static final NullOutputStream NULL_OUTPUT_STREAM = new NullOutputStream(); 36 | 37 | /** 38 | * Does nothing - output to /dev/null. 39 | * @param b The bytes to write 40 | * @param off The start offset 41 | * @param len The number of bytes to write 42 | */ 43 | @Override 44 | public void write(final byte[] b, final int off, final int len) { 45 | //to /dev/null 46 | } 47 | 48 | /** 49 | * Does nothing - output to /dev/null. 50 | * @param b The byte to write 51 | */ 52 | @Override 53 | public void write(final int b) { 54 | //to /dev/null 55 | } 56 | 57 | /** 58 | * Does nothing - output to /dev/null. 59 | * @param b The bytes to write 60 | * @throws IOException never 61 | */ 62 | @Override 63 | public void write(final byte[] b) throws IOException { 64 | //to /dev/null 65 | } 66 | 67 | } 68 | -------------------------------------------------------------------------------- /app/src/main/java/com/softsec/mobsec/dae/apimonitor/hook/apis/httphook/virjarSocketHook/orgApacheCommons/io/output/package.html: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 |

21 | This package provides implementations of output classes, such as 22 | OutputStream and Writer. 23 |

24 | 25 | 26 | -------------------------------------------------------------------------------- /app/src/main/java/com/softsec/mobsec/dae/apimonitor/hook/apis/httphook/virjarSocketHook/orgApacheCommons/io/overview.html: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 |

21 | The commons-io component contains utility classes, 22 | filters, streams, readers and writers. 23 |

24 |

25 | These classes aim to add to the standard JDK IO classes. 26 | The utilities provide convenience wrappers around the JDK, simplifying 27 | various operations into pre-tested units of code. 28 | The filters and streams provide useful implementations that perhaps should 29 | be in the JDK itself. 30 |

31 | 32 | 33 | -------------------------------------------------------------------------------- /app/src/main/java/com/softsec/mobsec/dae/apimonitor/hook/apis/httphook/virjarSocketHook/orgApacheCommons/io/package.html: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 |

21 | This package defines utility classes for working with streams, readers, 22 | writers and files. The most commonly used classes are described here: 23 |

24 |

25 | IOUtils is the most frequently used class. 26 | It provides operations to read, write, copy and close streams. 27 |

28 |

29 | FileUtils provides operations based around the JDK File class. 30 | These include reading, writing, copying, comparing and deleting. 31 |

32 |

33 | FilenameUtils provides utilities based on filenames. 34 | This utility class manipulates filenames without using File objects. 35 | It aims to simplify the transition between Windows and Unix. 36 | Before using this class however, you should consider whether you should 37 | be using File objects. 38 |

39 |

40 | FileSystemUtils allows access to the filing system in ways the JDK 41 | does not support. At present this allows you to get the free space on a drive. 42 |

43 |

44 | EndianUtils swaps data between Big-Endian and Little-Endian formats. 45 |

46 | 47 | 48 | -------------------------------------------------------------------------------- /app/src/main/java/com/softsec/mobsec/dae/apimonitor/hook/apis/httphook/virjarSocketHook/orgApacheCommons/io/serialization/ClassNameMatcher.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.softsec.mobsec.dae.apimonitor.hook.apis.httphook.virjarSocketHook.orgApacheCommons.io.serialization; 20 | 21 | /** 22 | * An object that matches a Class name to a condition. 23 | */ 24 | public interface ClassNameMatcher { 25 | 26 | /** 27 | * Returns true if the supplied class name matches this object's condition. 28 | * 29 | * @param className fully qualified class name 30 | * @return true if the class name matches this object's condition 31 | */ 32 | boolean matches(String className); 33 | } -------------------------------------------------------------------------------- /app/src/main/java/com/softsec/mobsec/dae/apimonitor/hook/apis/httphook/virjarSocketHook/orgApacheCommons/io/serialization/FullClassNameMatcher.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.softsec.mobsec.dae.apimonitor.hook.apis.httphook.virjarSocketHook.orgApacheCommons.io.serialization; 20 | 21 | import java.util.Arrays; 22 | import java.util.Collections; 23 | import java.util.HashSet; 24 | import java.util.Set; 25 | 26 | /** 27 | * A {@link ClassNameMatcher} that matches on full class names. 28 | *

29 | * This object is immutable and thread-safe. 30 | *

31 | */ 32 | final class FullClassNameMatcher implements ClassNameMatcher { 33 | 34 | private final Set classesSet; 35 | 36 | /** 37 | * Constructs an object based on the specified class names. 38 | * 39 | * @param classes a list of class names 40 | */ 41 | public FullClassNameMatcher(final String... classes) { 42 | classesSet = Collections.unmodifiableSet(new HashSet<>(Arrays.asList(classes))); 43 | } 44 | 45 | @Override 46 | public boolean matches(final String className) { 47 | return classesSet.contains(className); 48 | } 49 | } -------------------------------------------------------------------------------- /app/src/main/java/com/softsec/mobsec/dae/apimonitor/hook/apis/httphook/virjarSocketHook/orgApacheCommons/io/serialization/RegexpClassNameMatcher.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.softsec.mobsec.dae.apimonitor.hook.apis.httphook.virjarSocketHook.orgApacheCommons.io.serialization; 20 | 21 | import java.util.regex.Pattern; 22 | 23 | /** 24 | * A {@link ClassNameMatcher} that uses regular expressions. 25 | *

26 | * This object is immutable and thread-safe. 27 | *

28 | */ 29 | final class RegexpClassNameMatcher implements ClassNameMatcher { 30 | 31 | private final Pattern pattern; // Class is thread-safe 32 | 33 | /** 34 | * Constructs an object based on the specified regular expression. 35 | * 36 | * @param regex a regular expression for evaluating acceptable class names 37 | */ 38 | public RegexpClassNameMatcher(final String regex) { 39 | this(Pattern.compile(regex)); 40 | } 41 | 42 | /** 43 | * Constructs an object based on the specified pattern. 44 | * 45 | * @param pattern a pattern for evaluating acceptable class names 46 | * @throws IllegalArgumentException if pattern is null 47 | */ 48 | public RegexpClassNameMatcher(final Pattern pattern) { 49 | if (pattern == null) { 50 | throw new IllegalArgumentException("Null pattern"); 51 | } 52 | this.pattern = pattern; 53 | } 54 | 55 | @Override 56 | public boolean matches(final String className) { 57 | return pattern.matcher(className).matches(); 58 | } 59 | } -------------------------------------------------------------------------------- /app/src/main/java/com/softsec/mobsec/dae/apimonitor/hook/apis/httphook/virjarSocketHook/orgApacheCommons/io/serialization/WildcardClassNameMatcher.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.softsec.mobsec.dae.apimonitor.hook.apis.httphook.virjarSocketHook.orgApacheCommons.io.serialization; 20 | 21 | import com.softsec.mobsec.dae.apimonitor.hook.apis.httphook.virjarSocketHook.orgApacheCommons.io.FilenameUtils; 22 | 23 | /** 24 | * A {@link ClassNameMatcher} that uses simplified regular expressions 25 | * provided by {@link org.apache.commons.io.FilenameUtils#wildcardMatch(String, String) FilenameUtils.wildcardMatch} 26 | *

27 | * This object is immutable and thread-safe. 28 | *

29 | */ 30 | final class WildcardClassNameMatcher implements ClassNameMatcher { 31 | 32 | private final String pattern; 33 | 34 | /** 35 | * Constructs an object based on the specified simplified regular expression. 36 | * 37 | * @param pattern a {@link FilenameUtils#wildcardMatch} pattern. 38 | */ 39 | public WildcardClassNameMatcher(final String pattern) { 40 | this.pattern = pattern; 41 | } 42 | 43 | @Override 44 | public boolean matches(final String className) { 45 | return FilenameUtils.wildcardMatch(className, pattern); 46 | } 47 | } -------------------------------------------------------------------------------- /app/src/main/java/com/softsec/mobsec/dae/apimonitor/hook/apis/httphook/virjarSocketHook/orgApacheCommons/io/serialization/package.html: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 |

21 | This package provides a framework for controlling the deserialization of classes. 22 |

23 | 24 | 25 | -------------------------------------------------------------------------------- /app/src/main/java/com/softsec/mobsec/dae/apimonitor/hook/apis/httphook/virjarSocketHook/orgApacheCommons/lang3/builder/package.html: -------------------------------------------------------------------------------- 1 | 17 | 18 | 19 | Assists in creating consistent equals(Object), toString(), 20 | hashCode(), and compareTo(Object) methods. 21 | @see java.lang.Object#equals(Object) 22 | @see java.lang.Object#toString() 23 | @see java.lang.Object#hashCode() 24 | @see java.lang.Comparable#compareTo(Object) 25 | @since 1.0 26 |

These classes are not thread-safe.

27 | 28 | 29 | -------------------------------------------------------------------------------- /app/src/main/java/com/softsec/mobsec/dae/apimonitor/hook/apis/httphook/virjarSocketHook/orgApacheCommons/lang3/exception/CloneFailedException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.softsec.mobsec.dae.apimonitor.hook.apis.httphook.virjarSocketHook.orgApacheCommons.lang3.exception; 18 | 19 | /** 20 | * Exception thrown when a clone cannot be created. In contrast to 21 | * {@link CloneNotSupportedException} this is a {@link RuntimeException}. 22 | * 23 | * @since 3.0 24 | */ 25 | public class CloneFailedException extends RuntimeException { 26 | // ~ Static fields/initializers --------------------------------------------- 27 | 28 | private static final long serialVersionUID = 20091223L; 29 | 30 | // ~ Constructors ----------------------------------------------------------- 31 | 32 | /** 33 | * Constructs a CloneFailedException. 34 | * 35 | * @param message description of the exception 36 | * @since upcoming 37 | */ 38 | public CloneFailedException(final String message) { 39 | super(message); 40 | } 41 | 42 | /** 43 | * Constructs a CloneFailedException. 44 | * 45 | * @param cause cause of the exception 46 | * @since upcoming 47 | */ 48 | public CloneFailedException(final Throwable cause) { 49 | super(cause); 50 | } 51 | 52 | /** 53 | * Constructs a CloneFailedException. 54 | * 55 | * @param message description of the exception 56 | * @param cause cause of the exception 57 | * @since upcoming 58 | */ 59 | public CloneFailedException(final String message, final Throwable cause) { 60 | super(message, cause); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /app/src/main/java/com/softsec/mobsec/dae/apimonitor/hook/apis/httphook/virjarSocketHook/orgApacheCommons/lang3/exception/package.html: -------------------------------------------------------------------------------- 1 | 17 | 18 | 19 | Provides functionality for Exceptions. 20 |

Contains the concept of an exception with context i.e. such an exception 21 | will contain a map with keys and values. This provides an easy way to pass valuable 22 | state information at exception time in useful form to a calling process.

23 |

Lastly, {@link org.apache.commons.lang3.exception.ExceptionUtils} 24 | also contains Throwable manipulation and examination routines.

25 | @since 1.0 26 | 27 | 28 | -------------------------------------------------------------------------------- /app/src/main/java/com/softsec/mobsec/dae/apimonitor/hook/apis/httphook/virjarSocketHook/orgApacheCommons/lang3/mutable/Mutable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package com.softsec.mobsec.dae.apimonitor.hook.apis.httphook.virjarSocketHook.orgApacheCommons.lang3.mutable; 19 | 20 | /** 21 | * Provides mutable access to a value. 22 | *

23 | * Mutable is used as a generic interface to the implementations in this package. 24 | *

25 | * A typical use case would be to enable a primitive or string to be passed to a method and allow that method to 26 | * effectively change the value of the primitive/string. Another use case is to store a frequently changing primitive in 27 | * a collection (for example a total in a map) without needing to create new Integer/Long wrapper objects. 28 | * 29 | * @since 2.1 30 | * @param the type to set and get 31 | * @version $Id: Mutable.java 1153213 2011-08-02 17:35:39Z ggregory $ 32 | */ 33 | public interface Mutable { 34 | 35 | /** 36 | * Gets the value of this mutable. 37 | * 38 | * @return the stored value 39 | */ 40 | T getValue(); 41 | 42 | /** 43 | * Sets the value of this mutable. 44 | * 45 | * @param value 46 | * the value to store 47 | * @throws NullPointerException 48 | * if the object is null and null is invalid 49 | * @throws ClassCastException 50 | * if the type is invalid 51 | */ 52 | void setValue(T value); 53 | 54 | } 55 | -------------------------------------------------------------------------------- /app/src/main/java/com/softsec/mobsec/dae/apimonitor/hook/apis/httphook/virjarSocketHook/orgApacheCommons/lang3/mutable/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 22 | 23 | 24 | 25 | Provides typed mutable wrappers to primitive values and Object. 26 | @since 2.1 27 |

These classes are not thread-safe.

28 | 29 | 30 | -------------------------------------------------------------------------------- /app/src/main/java/com/softsec/mobsec/dae/apimonitor/hook/apis/httphook/virjarSocketHook/orgApacheCommons/lang3/overview.html: -------------------------------------------------------------------------------- 1 | 17 | 18 | 19 |

20 | This document is the API specification for the Apache Commons Lang library. 21 |

22 | 23 | 24 | -------------------------------------------------------------------------------- /app/src/main/java/com/softsec/mobsec/dae/apimonitor/hook/apis/httphook/virjarSocketHook/orgApacheCommons/lang3/package.html: -------------------------------------------------------------------------------- 1 | 17 | 18 | 19 | Provides highly reusable static utility methods, chiefly concerned 20 | with adding value to the {@link java.lang} classes. 21 | @since 1.0 22 |

Most of these classes are immutable and thus thread-safe. 23 | However Charset is not currently guaranteed thread-safe under all circumstances.

24 | 25 | 26 | -------------------------------------------------------------------------------- /app/src/main/java/com/softsec/mobsec/dae/apimonitor/hook/apis/httphook/virjarSocketHook/orgApacheCommons/lang3/reflect/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 22 | 23 | 24 | 25 | Accumulates common high-level uses of the java.lang.reflect APIs. 26 | @since 3.0 27 |

These classes are immutable, and therefore thread-safe.

28 | 29 | 30 | -------------------------------------------------------------------------------- /app/src/main/java/com/softsec/mobsec/dae/apimonitor/hook/apis/httphook/virjarSocketHook/orgApacheCommons/lang3/tuple/package.html: -------------------------------------------------------------------------------- 1 | 17 | 18 | 19 | Tuple classes, starting with a Pair class in version 3.0. 20 | @since 3.0 21 | 22 | 23 | -------------------------------------------------------------------------------- /app/src/main/java/com/softsec/mobsec/dae/apimonitor/hook/hookUtils/Hook.java: -------------------------------------------------------------------------------- 1 | package com.softsec.mobsec.dae.apimonitor.hook.hookUtils; 2 | 3 | import de.robv.android.xposed.callbacks.XC_LoadPackage; 4 | 5 | public abstract class Hook { 6 | 7 | // protected Logger logger = new Logger(); 8 | // protected MethodHookHandler methodHookImpl = new MethodHookHandler(); 9 | 10 | public abstract void initAllHooks(final XC_LoadPackage.LoadPackageParam packageParam); 11 | 12 | 13 | 14 | } 15 | -------------------------------------------------------------------------------- /app/src/main/java/com/softsec/mobsec/dae/apimonitor/hook/hookUtils/MethodHookHandler.java: -------------------------------------------------------------------------------- 1 | package com.softsec.mobsec.dae.apimonitor.hook.hookUtils; 2 | 3 | import java.lang.reflect.Member; 4 | 5 | import de.robv.android.xposed.XposedBridge; 6 | 7 | public class MethodHookHandler { 8 | 9 | public static void hookMethod(Member method, MethodHookCallBack callback) { 10 | // TODO Auto-generated method stub 11 | XposedBridge.hookMethod(method, callback); 12 | } 13 | 14 | public static void hookAllConstructors(Class clazz, MethodHookCallBack callBack){ 15 | XposedBridge.hookAllConstructors(clazz, callBack); 16 | } 17 | 18 | public static void hookAllMethods(Class clazz, String methodName, MethodHookCallBack callBack){ 19 | XposedBridge.hookAllMethods(clazz, methodName, callBack); 20 | } 21 | 22 | 23 | } -------------------------------------------------------------------------------- /app/src/main/java/com/softsec/mobsec/dae/apimonitor/tools/ConsoleTool.kt: -------------------------------------------------------------------------------- 1 | package com.softsec.mobsec.dae.apimonitor.tools 2 | 3 | import org.apache.commons.cli.* 4 | import kotlin.system.exitProcess 5 | 6 | 7 | class ConsoleTool { 8 | 9 | companion object { 10 | @JvmStatic 11 | fun main(args: Array) { 12 | println("test") 13 | val options = Options() 14 | options.addOption("v", "version", false, "show current version") 15 | options.addOption("h", "help", false, "show this message") 16 | 17 | val parser: CommandLineParser = DefaultParser() 18 | val formatter = HelpFormatter() 19 | val cmd: CommandLine 20 | 21 | cmd = try { 22 | parser.parse(options, args) 23 | } catch (e: ParseException) { 24 | System.err.println(e.message) 25 | formatter.printHelp("ConsoleTool", options) 26 | exitProcess(1) 27 | } 28 | 29 | if (cmd.hasOption("help")) { 30 | formatter.printHelp("ConsoleTool", options) 31 | return 32 | } 33 | if (cmd.hasOption("version")) { 34 | println("1.0") 35 | return 36 | } 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /app/src/main/java/com/softsec/mobsec/dae/apimonitor/ui/RecordContentActivity.kt: -------------------------------------------------------------------------------- 1 | package com.softsec.mobsec.dae.apimonitor.ui 2 | 3 | import android.os.Bundle 4 | import android.support.v7.app.AppCompatActivity 5 | import com.google.gson.GsonBuilder 6 | import com.google.gson.JsonParser 7 | import com.softsec.mobsec.dae.apimonitor.R 8 | import com.softsec.mobsec.dae.apimonitor.util.Config 9 | import kotlinx.android.synthetic.main.activity_content_record.* 10 | import java.io.BufferedReader 11 | import java.io.File 12 | import java.io.FileReader 13 | 14 | class RecordContentActivity : AppCompatActivity() { 15 | 16 | override fun onCreate(savedInstanceState: Bundle?) { 17 | super.onCreate(savedInstanceState) 18 | setContentView(R.layout.activity_content_record) 19 | val logAbsolutePath = intent.getStringExtra(Config.INTENT_RESULTCONTENT_LOGPATH) 20 | readLogFile(logAbsolutePath) 21 | } 22 | 23 | private fun readLogFile(path : String) { 24 | val logFile = File(path) 25 | tv_record_filename.text = logFile.name 26 | val br = BufferedReader(FileReader(logFile)) 27 | val sb = StringBuffer() 28 | var line : String 29 | while (true) { 30 | line = br.readLine() ?: break 31 | sb.append(line) 32 | } 33 | tv_record_content.text = toPrettyFormat(sb.toString()) 34 | } 35 | 36 | private fun toPrettyFormat(json : String) : String { 37 | val jo = JsonParser.parseString(json) 38 | return GsonBuilder().setPrettyPrinting().create().toJson(jo) 39 | } 40 | } -------------------------------------------------------------------------------- /app/src/main/java/com/softsec/mobsec/dae/apimonitor/util/CrashHandler.kt: -------------------------------------------------------------------------------- 1 | package com.softsec.mobsec.dae.apimonitor.util 2 | 3 | import android.annotation.SuppressLint 4 | import java.io.File 5 | import java.lang.StringBuilder 6 | import java.text.SimpleDateFormat 7 | import java.util.* 8 | 9 | object CrashHandler : Thread.UncaughtExceptionHandler { 10 | 11 | private val defaultHandler = Thread.getDefaultUncaughtExceptionHandler() 12 | @SuppressLint("SimpleDateFormat") 13 | private val daySDF = SimpleDateFormat("yyyy-MM-dd") 14 | @SuppressLint("SimpleDateFormat") 15 | private val secondSDF = SimpleDateFormat("HH:mm:ss") 16 | 17 | fun init() { 18 | Thread.setDefaultUncaughtExceptionHandler(this) 19 | } 20 | 21 | override fun uncaughtException(thread: Thread, throwable: Throwable) { 22 | val exceptionLogDir = File(Config.PATH_EXCEPTION_LOG) 23 | if(!exceptionLogDir.exists()) { 24 | exceptionLogDir.mkdirs() 25 | } 26 | FileUtil.writeToFile("${secondSDF.format(Date())}-${thread}, ${formatThrowable(throwable)}", 27 | "${Config.PATH_EXCEPTION_LOG}${daySDF.format(Date())}.log") 28 | defaultHandler?.uncaughtException(thread, throwable) 29 | } 30 | 31 | private fun formatThrowable(throwable: Throwable): String { 32 | val sb = StringBuilder(); 33 | sb.append(throwable.message).append('\n') 34 | for(st in throwable.stackTrace) { 35 | sb.append(st.className).append("->").append(st.methodName).append("[${st.lineNumber}]") 36 | .append("\n") 37 | } 38 | return sb.toString() 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /app/src/main/java/com/softsec/mobsec/dae/apimonitor/util/DataUtil.kt: -------------------------------------------------------------------------------- 1 | package com.softsec.mobsec.dae.apimonitor.util 2 | 3 | import android.graphics.drawable.Drawable 4 | 5 | data class AppInfo constructor(val appName: String, val pkgName: String, val appIcon: Drawable, var isChecked: Boolean, var firstInstallTime: Long) 6 | 7 | data class RecordInfo constructor(val appName: String, val pkgName: String, val appIcon: Drawable, val logAbsolutePath: String, val isTesting: Boolean, val logDate: String) -------------------------------------------------------------------------------- /app/src/main/java/com/softsec/mobsec/dae/apimonitor/util/FileUtil.java: -------------------------------------------------------------------------------- 1 | package com.softsec.mobsec.dae.apimonitor.util; 2 | 3 | import android.annotation.SuppressLint; 4 | 5 | import com.softsec.mobsec.dae.apimonitor.hook.hookUtils.Logger; 6 | 7 | import java.io.File; 8 | import java.io.FileOutputStream; 9 | import java.io.OutputStreamWriter; 10 | 11 | /** 12 | * @author qinmu997 13 | */ 14 | public class FileUtil { 15 | @SuppressLint("SetWorldReadable") 16 | public static void fixSharedPreference() { 17 | File folder = new File(Config.PATH_DAEAM_INTERNAL); 18 | folder.setExecutable(true, false); 19 | 20 | String mPrefFile = Config.PATH_DAEAM_INTERNAL + Config.PATH_SP + Config.SP_NAME + ".xml"; 21 | (new File(mPrefFile)).setReadable(true, false); 22 | } 23 | 24 | @SuppressLint({"SetWorldReadable", "SetWorldWritable"}) 25 | public static void writeToFile(String log, String absolutePath) { 26 | 27 | try { 28 | File file = new File(absolutePath); 29 | 30 | boolean f = false; 31 | 32 | if (!file.exists()) { 33 | 34 | File path = new File(String.valueOf(file.getParentFile())); 35 | path.setReadable(true, false); 36 | path.setExecutable(true, false); 37 | path.setWritable(true, false); 38 | 39 | path.mkdirs(); 40 | path.setReadable(true, false); 41 | path.setExecutable(true, false); 42 | path.setWritable(true, false); 43 | 44 | file.createNewFile(); 45 | 46 | file.setReadable(true, false); 47 | file.setExecutable(true, false); 48 | file.setWritable(true, false); 49 | 50 | f = true; 51 | } 52 | 53 | FileOutputStream fos = new FileOutputStream(file, true); 54 | OutputStreamWriter osw = new OutputStreamWriter(fos); 55 | 56 | if(f) { 57 | osw.write("{"); 58 | if(log.startsWith(",")) { 59 | log = log.substring(1); 60 | } 61 | } 62 | 63 | osw.write(log); 64 | osw.close(); 65 | fos.close(); 66 | } catch (Exception e) { 67 | Logger.logError(e); 68 | } 69 | } 70 | } 71 | 72 | -------------------------------------------------------------------------------- /app/src/main/java/com/softsec/mobsec/dae/apimonitor/util/HttpUtil.kt: -------------------------------------------------------------------------------- 1 | package com.softsec.mobsec.dae.apimonitor.util 2 | 3 | import okhttp3.Callback 4 | import okhttp3.OkHttpClient 5 | import okhttp3.Request 6 | import okhttp3.RequestBody 7 | 8 | class HttpUtil { 9 | 10 | 11 | 12 | companion object { 13 | fun sendGetRequest(address: String, callback: Callback) { 14 | OkHttpClient().newCall(Request.Builder().url(address).build()).enqueue(callback) 15 | } 16 | 17 | fun sendPostRequest(address: String, body: RequestBody, callback: Callback) { 18 | OkHttpClient().newCall(Request.Builder().post(body).url(address).build()).enqueue(callback) 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /app/src/main/java/com/softsec/mobsec/dae/apimonitor/util/ResultParser.kt: -------------------------------------------------------------------------------- 1 | package com.softsec.mobsec.dae.apimonitor.util 2 | 3 | class ResultParser { 4 | 5 | } -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 12 | 13 | 19 | 22 | 25 | 26 | 27 | 28 | 34 | 35 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/android.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xingyueren-qinmu/ApiMonitor/bc6ce1b72fbaa7d82141ee795c993e3f4cfe9a2b/app/src/main/res/drawable/android.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_chooseapp.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 10 | 18 | 19 | 24 | 25 | 26 | 32 | 33 |