├── README.md ├── README_ZH.md ├── SafetyDetect-AppsCheck-Android-Sample ├── LICENSE ├── README.md ├── README_ZH.md ├── app │ ├── build.gradle │ ├── proguard-rules.pro │ └── src │ │ ├── androidTest │ │ └── java │ │ │ └── com │ │ │ └── huawei │ │ │ └── hms │ │ │ └── sysintegrity │ │ │ └── ExampleInstrumentedTest.java │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ │ └── com │ │ │ │ └── huawei │ │ │ │ └── hms │ │ │ │ └── safetydetect │ │ │ │ └── sample │ │ │ │ ├── MainActivity.java │ │ │ │ ├── MaliciousAppsDataListAdapter.java │ │ │ │ └── SafetyDetectAppsCheckAPIFragment.java │ │ └── res │ │ │ ├── drawable-v24 │ │ │ └── ic_launcher_foreground.xml │ │ │ ├── drawable │ │ │ ├── btn_bg_round.xml │ │ │ ├── btn_round_corner_normal.xml │ │ │ ├── btn_round_corner_small.xml │ │ │ ├── btn_round_green.xml │ │ │ ├── btn_round_normal.xml │ │ │ ├── btn_round_processing.xml │ │ │ ├── btn_round_red.xml │ │ │ ├── btn_round_yellow.xml │ │ │ ├── ic_launcher_background.xml │ │ │ ├── tab_menu_appscheck.xml │ │ │ ├── tab_menu_bg.xml │ │ │ └── tab_menu_sysintegrity.xml │ │ │ ├── layout │ │ │ ├── activity_main.xml │ │ │ ├── fg_appscheck.xml │ │ │ ├── fg_content.xml │ │ │ └── item_list_app.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 │ │ │ ├── dimens.xml │ │ │ ├── strings.xml │ │ │ └── styles.xml │ │ └── test │ │ └── java │ │ └── com │ │ └── huawei │ │ └── safetydetectsample │ │ └── ExampleUnitTest.java ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle ├── SafetyDetect-SysIntegrity-Sample ├── SafetyDetect-SysIntegrity-Android-Sample │ ├── LICENSE │ ├── README.md │ ├── README_ZH.md │ ├── app │ │ ├── build.gradle │ │ ├── proguard-rules.pro │ │ └── src │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ └── com │ │ │ │ └── huawei │ │ │ │ └── hms │ │ │ │ └── safetydetect │ │ │ │ └── sample │ │ │ │ ├── MainActivity.java │ │ │ │ └── SafetyDetectSysIntegrityAPIFragment.java │ │ │ └── res │ │ │ ├── drawable-v24 │ │ │ └── ic_launcher_foreground.xml │ │ │ ├── drawable │ │ │ ├── btn_bg_round.xml │ │ │ ├── btn_round_corner_normal.xml │ │ │ ├── btn_round_corner_small.xml │ │ │ ├── btn_round_green.xml │ │ │ ├── btn_round_normal.xml │ │ │ ├── btn_round_processing.xml │ │ │ ├── btn_round_red.xml │ │ │ ├── btn_round_yellow.xml │ │ │ ├── ic_launcher_background.xml │ │ │ ├── tab_menu_bg.xml │ │ │ └── tab_menu_sysintegrity.xml │ │ │ ├── layout │ │ │ ├── activity_main.xml │ │ │ ├── fg_content.xml │ │ │ └── fg_sysintegrity.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 │ │ │ ├── dimens.xml │ │ │ ├── strings.xml │ │ │ └── styles.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ └── settings.gradle └── SafetyDetect-SysIntegrity-Server-Sample │ ├── LICENSE │ ├── README.md │ ├── README_ZH.md │ ├── Third Party Open Source Software Notice.docx │ ├── pom.xml │ └── src │ └── main │ └── java │ └── com │ └── huawei │ └── hms │ └── safetydetect │ └── sample │ └── sysintegrity │ ├── Main.java │ ├── entity │ └── Jws.java │ └── utils │ └── VerifySignatureUtil.java ├── SafetyDetect-URLCheck-Android-Sample ├── LICENSE ├── README.md ├── README_ZH.md ├── app │ ├── build.gradle │ ├── proguard-rules.pro │ └── src │ │ ├── androidTest │ │ └── java │ │ │ └── com │ │ │ └── huawei │ │ │ └── hms │ │ │ └── sysintegrity │ │ │ └── ExampleInstrumentedTest.java │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ │ └── com │ │ │ │ └── huawei │ │ │ │ └── hms │ │ │ │ └── safetydetect │ │ │ │ └── sample │ │ │ │ ├── MainActivity.java │ │ │ │ └── SafetyDetectUrlCheckAPIFragment.java │ │ └── res │ │ │ ├── drawable-v24 │ │ │ └── ic_launcher_foreground.xml │ │ │ ├── drawable │ │ │ ├── btn_bg_round.xml │ │ │ ├── btn_round_corner_normal.xml │ │ │ ├── btn_round_corner_small.xml │ │ │ ├── btn_round_green.xml │ │ │ ├── btn_round_normal.xml │ │ │ ├── btn_round_processing.xml │ │ │ ├── btn_round_red.xml │ │ │ ├── btn_round_yellow.xml │ │ │ ├── ic_launcher_background.xml │ │ │ ├── tab_menu_appscheck.xml │ │ │ ├── tab_menu_bg.xml │ │ │ └── tab_menu_sysintegrity.xml │ │ │ ├── layout │ │ │ ├── activity_main.xml │ │ │ ├── fg_content.xml │ │ │ └── fg_urlcheck.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 │ │ │ ├── dimens.xml │ │ │ ├── stringArray.xml │ │ │ ├── strings.xml │ │ │ └── styles.xml │ │ └── test │ │ └── java │ │ └── com │ │ └── huawei │ │ └── safetydetectsample │ │ └── ExampleUnitTest.java ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle ├── SafetyDetect-UserDetect-Sample ├── SafetyDetect-UserDetect-Android-Sample │ ├── LICENSE │ ├── README.md │ ├── README_ZH.md │ ├── app │ │ ├── build.gradle │ │ ├── proguard-rules.pro │ │ └── src │ │ │ ├── androidTest │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── huawei │ │ │ │ └── hms │ │ │ │ └── sysintegrity │ │ │ │ └── ExampleInstrumentedTest.java │ │ │ ├── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── huawei │ │ │ │ │ └── hms │ │ │ │ │ └── safetydetect │ │ │ │ │ └── sample │ │ │ │ │ ├── MainActivity.java │ │ │ │ │ └── SafetyDetectUserDetectAPIFragment.java │ │ │ └── res │ │ │ │ ├── drawable-v24 │ │ │ │ └── ic_launcher_foreground.xml │ │ │ │ ├── drawable │ │ │ │ ├── btn_bg_round.xml │ │ │ │ ├── btn_round_corner_normal.xml │ │ │ │ ├── btn_round_corner_small.xml │ │ │ │ ├── btn_round_green.xml │ │ │ │ ├── btn_round_normal.xml │ │ │ │ ├── btn_round_processing.xml │ │ │ │ ├── btn_round_red.xml │ │ │ │ ├── btn_round_yellow.xml │ │ │ │ ├── ic_launcher_background.xml │ │ │ │ ├── tab_menu_appscheck.xml │ │ │ │ ├── tab_menu_bg.xml │ │ │ │ └── tab_menu_sysintegrity.xml │ │ │ │ ├── layout │ │ │ │ ├── activity_main.xml │ │ │ │ ├── fg_content.xml │ │ │ │ └── fg_userdetect.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 │ │ │ │ ├── dimens.xml │ │ │ │ ├── strings.xml │ │ │ │ └── styles.xml │ │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── huawei │ │ │ └── safetydetectsample │ │ │ └── ExampleUnitTest.java │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ └── settings.gradle └── SafetyDetect-UserDetect-Server-Sample │ ├── LICENSE │ ├── README.md │ ├── README_ZH.md │ ├── Third Party Open Source Software Notice.docx │ ├── pom.xml │ └── src │ └── main │ ├── java │ └── com │ │ └── huawei │ │ └── safetydetect │ │ └── userdetect │ │ ├── UserDetectApplication.java │ │ ├── controller │ │ └── UserDetectController.java │ │ └── service │ │ ├── UserDetectService.java │ │ └── impl │ │ └── UserDetectServiceImpl.java │ └── resources │ ├── application.properties │ └── logback.xml ├── SafetyDetect-WifiDetect-Android-Sample ├── LICENSE ├── README.md ├── README_ZH.md ├── app │ ├── build.gradle │ ├── proguard-rules.pro │ └── src │ │ ├── androidTest │ │ └── java │ │ │ └── com │ │ │ └── huawei │ │ │ └── hms │ │ │ └── sysintegrity │ │ │ └── ExampleInstrumentedTest.java │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ │ └── com │ │ │ │ └── huawei │ │ │ │ └── hms │ │ │ │ └── safetydetect │ │ │ │ └── sample │ │ │ │ ├── MainActivity.java │ │ │ │ └── SafetyDetectWifiDetectAPIFragment.java │ │ └── res │ │ │ ├── drawable-v24 │ │ │ └── ic_launcher_foreground.xml │ │ │ ├── drawable │ │ │ ├── btn_bg_round.xml │ │ │ ├── btn_round_corner_normal.xml │ │ │ ├── btn_round_corner_small.xml │ │ │ ├── btn_round_green.xml │ │ │ ├── btn_round_normal.xml │ │ │ ├── btn_round_processing.xml │ │ │ ├── btn_round_red.xml │ │ │ ├── btn_round_yellow.xml │ │ │ ├── ic_launcher_background.xml │ │ │ ├── tab_menu_bg.xml │ │ │ ├── tab_menu_sysintegrity.xml │ │ │ └── tab_menu_wifidetect.xml │ │ │ ├── layout │ │ │ ├── activity_main.xml │ │ │ ├── fg_content.xml │ │ │ └── fg_wifidetect.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 │ │ │ ├── dimens.xml │ │ │ ├── strings.xml │ │ │ └── styles.xml │ │ └── test │ │ └── java │ │ └── com │ │ └── huawei │ │ └── safetydetectsample │ │ └── ExampleUnitTest.java ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle └── safetydetect-android-sample ├── LICENSE ├── README.md ├── README_ZH.md ├── app ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── huawei │ │ └── hms │ │ └── sysintegrity │ │ └── ExampleInstrumentedTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── huawei │ │ │ └── hms │ │ │ └── safetydetect │ │ │ └── sample │ │ │ ├── HarmfulAppsDataListAdapter.java │ │ │ ├── MainActivity.java │ │ │ ├── MaliciousAppsDataListAdapter.java │ │ │ ├── SafetyDetectAppsCheckAPIFragment.java │ │ │ ├── SafetyDetectSysIntegrityAPIFragment.java │ │ │ ├── SafetyDetectUrlCheckAPIFragment.java │ │ │ ├── SafetyDetectUserDetectAPIFragment.java │ │ │ └── SafetyDetectWifiDetectAPIFragment.java │ └── res │ │ ├── drawable-v24 │ │ └── ic_launcher_foreground.xml │ │ ├── drawable │ │ ├── btn_bg_round.xml │ │ ├── btn_round_corner_normal.xml │ │ ├── btn_round_corner_small.xml │ │ ├── btn_round_green.xml │ │ ├── btn_round_normal.xml │ │ ├── btn_round_processing.xml │ │ ├── btn_round_red.xml │ │ ├── btn_round_yellow.xml │ │ ├── ic_launcher_background.xml │ │ ├── tab_menu_appscheck.xml │ │ ├── tab_menu_bg.xml │ │ ├── tab_menu_sysintegrity.xml │ │ ├── tab_menu_urlcheck.xml │ │ └── tab_menu_userdetect.xml │ │ ├── layout │ │ ├── activity_main.xml │ │ ├── fg_appscheck.xml │ │ ├── fg_content.xml │ │ ├── fg_sysintegrity.xml │ │ ├── fg_urlcheck.xml │ │ ├── fg_userdetect.xml │ │ ├── fg_wifidetect.xml │ │ └── item_list_app.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 │ │ ├── dimens.xml │ │ ├── stringArray.xml │ │ ├── strings.xml │ │ └── styles.xml │ └── test │ └── java │ └── com │ └── huawei │ └── safetydetectsample │ └── ExampleUnitTest.java ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle /SafetyDetect-AppsCheck-Android-Sample/README.md: -------------------------------------------------------------------------------- 1 | # SafetyDetect AppsCheck Sample 2 | English | [中文](https://github.com/HMS-Core/hms-safetydetect-demo-android/blob/master/SafetyDetect-AppsCheck-Android-Sample/README_ZH.md) 3 | 4 | 5 | ## Table of Contents 6 | 7 | * [Introduction](#introduction) 8 | * [Getting Started](#getting-started) 9 | * [Supported Environments](#supported-environments) 10 | * [License](#license) 11 | 12 | 13 | ## Introduction 14 | SafetyDetect AppsCheck Sample provides many sample programs for your reference or usage. 15 | The following describes packages of SafetyDetect AppsCheck sample code. 16 | 17 | sample: Sample code packages. 18 | 19 | 20 | ## Getting Started 21 | You should create an app in AppGallery Connect, and obtain the file of agconnect-services.json and add to the project. 22 | You should also generate a signing certificate fingerprint and add the certificate file to the project, and add configuration to build.gradle. 23 | https://developer.huawei.com/consumer/en/doc/development/HMS-Guides/SafetyDetectDevelopment 24 | 25 | ## Supported Environments 26 | Java 1.7 or a later version is recommended. 27 | 28 | ## License 29 | SafetyDetect AppsCheck Sample is licensed under the [Apache License, version 2.0](http://www.apache.org/licenses/LICENSE-2.0). 30 | -------------------------------------------------------------------------------- /SafetyDetect-AppsCheck-Android-Sample/README_ZH.md: -------------------------------------------------------------------------------- 1 | # SafetyDetect AppsCheck Sample 2 | [English](https://github.com/HMS-Core/hms-safetydetect-demo-android/blob/master/SafetyDetect-AppsCheck-Android-Sample/README.md) | 中文 3 | 4 | 5 | ## 目录 6 | 7 | * [介绍](#介绍) 8 | * [运行步骤](#运行步骤) 9 | * [支持的环境](#支持的环境) 10 | * [许可证](#许可证) 11 | 12 | 13 | ## 介绍 14 | SafetyDetect Sample 提供了SafetyDetect AppsCheck 特性示例程序供您参考或使用。 15 | 16 | ## 运行步骤 17 | 您应该在AppGallery Connect中创建一个应用程序,获取agconnect-services.json并添加到项目中。您还应该生成签名证书指纹并将证书文件添加到项目中,并将配置添加到build.gradle中。 18 | 更多信息可以访问: 19 | https://developer.huawei.com/consumer/en/doc/development/HMS-Guides/SafetyDetectDevelopment 20 | 21 | ## 支持的环境 22 | Java 1.7 及更高。 23 | 24 | ## 许可证 25 | 此代码示例已获得 [Apache License, version 2.0](http://www.apache.org/licenses/LICENSE-2.0). 26 | 27 | -------------------------------------------------------------------------------- /SafetyDetect-AppsCheck-Android-Sample/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | apply plugin: 'com.huawei.agconnect' 3 | 4 | configurations.all { 5 | // check for updates every build 6 | resolutionStrategy.cacheChangingModulesFor 0, 'seconds' 7 | } 8 | android { 9 | signingConfigs { 10 | config { 11 | storeFile file('XXXXXXX') 12 | keyAlias = 'XXXXXXX' 13 | storePassword 'XXXXXX' 14 | keyPassword 'XXXXXX' 15 | } 16 | } 17 | compileSdkVersion 28 18 | buildToolsVersion "28.0.3" 19 | defaultConfig { 20 | applicationId "com.huawei.hms.safetydetect.sample" 21 | minSdkVersion 19 22 | targetSdkVersion 26 23 | versionCode 1 24 | versionName "1.0" 25 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 26 | } 27 | buildTypes { 28 | debug { 29 | signingConfig signingConfigs.config 30 | debuggable true 31 | } 32 | release { 33 | minifyEnabled true 34 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 35 | signingConfig signingConfigs.config 36 | debuggable true 37 | } 38 | } 39 | android.applicationVariants.all { variant -> 40 | variant.outputs.all { 41 | outputFileName = "SafetyDetectAppsCheckSample-${variant.buildType.name}" + '.apk' 42 | } 43 | } 44 | } 45 | 46 | dependencies { 47 | implementation fileTree(dir: 'libs', include: ['*.jar']) 48 | implementation 'androidx.appcompat:appcompat:1.1.0' 49 | implementation 'androidx.constraintlayout:constraintlayout:1.1.3' 50 | testImplementation 'junit:junit:4.12' 51 | androidTestImplementation 'androidx.test:runner:1.2.0' 52 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' 53 | 54 | // For details about the version, see https://developer.huawei.com/consumer/cn/doc/development/Security-Guides/version-change-history-0000001050156329. 55 | implementation 'com.huawei.hms:safetydetect:xxx' 56 | } 57 | -------------------------------------------------------------------------------- /SafetyDetect-AppsCheck-Android-Sample/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 | -ignorewarning 23 | 24 | -keepattributes *Annotation* 25 | -keepattributes Exceptions 26 | -keepattributes InnerClasses 27 | -keepattributes Signature 28 | -keepattributes SourceFile,LineNumberTable 29 | 30 | -keep class com.huawei.hianalytics.**{*;} 31 | -keep class com.huawei.updatesdk.**{*;} 32 | -keep class com.huawei.hms.**{*;} 33 | -------------------------------------------------------------------------------- /SafetyDetect-AppsCheck-Android-Sample/app/src/androidTest/java/com/huawei/hms/sysintegrity/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020. Huawei Technologies Co., Ltd. All rights reserved. 3 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.huawei.hms.sysintegrity; 18 | 19 | /** 20 | * Instrumented test, which will execute on an Android device. 21 | * 22 | * @see Testing documentation 23 | */ 24 | /*@RunWith(AndroidJUnit4.class) 25 | public class ExampleInstrumentedTest { 26 | @Test 27 | public void useAppContext() { 28 | // Context of the app under test. 29 | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); 30 | 31 | assertEquals("com.huawei.hms.safetydetectsample", appContext.getPackageName()); 32 | } 33 | }*/ 34 | -------------------------------------------------------------------------------- /SafetyDetect-AppsCheck-Android-Sample/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /SafetyDetect-AppsCheck-Android-Sample/app/src/main/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 12 | 13 | 19 | 22 | 25 | 26 | 27 | 28 | 34 | 35 | -------------------------------------------------------------------------------- /SafetyDetect-AppsCheck-Android-Sample/app/src/main/res/drawable/btn_bg_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | -------------------------------------------------------------------------------- /SafetyDetect-AppsCheck-Android-Sample/app/src/main/res/drawable/btn_round_corner_normal.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | 10 | 15 | -------------------------------------------------------------------------------- /SafetyDetect-AppsCheck-Android-Sample/app/src/main/res/drawable/btn_round_corner_small.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /SafetyDetect-AppsCheck-Android-Sample/app/src/main/res/drawable/btn_round_green.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /SafetyDetect-AppsCheck-Android-Sample/app/src/main/res/drawable/btn_round_normal.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /SafetyDetect-AppsCheck-Android-Sample/app/src/main/res/drawable/btn_round_processing.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /SafetyDetect-AppsCheck-Android-Sample/app/src/main/res/drawable/btn_round_red.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /SafetyDetect-AppsCheck-Android-Sample/app/src/main/res/drawable/btn_round_yellow.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /SafetyDetect-AppsCheck-Android-Sample/app/src/main/res/drawable/tab_menu_appscheck.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /SafetyDetect-AppsCheck-Android-Sample/app/src/main/res/drawable/tab_menu_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /SafetyDetect-AppsCheck-Android-Sample/app/src/main/res/drawable/tab_menu_sysintegrity.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /SafetyDetect-AppsCheck-Android-Sample/app/src/main/res/layout/fg_content.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 14 | 15 | -------------------------------------------------------------------------------- /SafetyDetect-AppsCheck-Android-Sample/app/src/main/res/layout/item_list_app.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 17 | 18 | 23 | -------------------------------------------------------------------------------- /SafetyDetect-AppsCheck-Android-Sample/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /SafetyDetect-AppsCheck-Android-Sample/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /SafetyDetect-AppsCheck-Android-Sample/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HMS-Core/hms-safetydetect-demo-android/23c6efa6f0a7fa0bfd5d59f86a6bbd12bd2fec88/SafetyDetect-AppsCheck-Android-Sample/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /SafetyDetect-AppsCheck-Android-Sample/app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HMS-Core/hms-safetydetect-demo-android/23c6efa6f0a7fa0bfd5d59f86a6bbd12bd2fec88/SafetyDetect-AppsCheck-Android-Sample/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /SafetyDetect-AppsCheck-Android-Sample/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HMS-Core/hms-safetydetect-demo-android/23c6efa6f0a7fa0bfd5d59f86a6bbd12bd2fec88/SafetyDetect-AppsCheck-Android-Sample/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /SafetyDetect-AppsCheck-Android-Sample/app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HMS-Core/hms-safetydetect-demo-android/23c6efa6f0a7fa0bfd5d59f86a6bbd12bd2fec88/SafetyDetect-AppsCheck-Android-Sample/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /SafetyDetect-AppsCheck-Android-Sample/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HMS-Core/hms-safetydetect-demo-android/23c6efa6f0a7fa0bfd5d59f86a6bbd12bd2fec88/SafetyDetect-AppsCheck-Android-Sample/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /SafetyDetect-AppsCheck-Android-Sample/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HMS-Core/hms-safetydetect-demo-android/23c6efa6f0a7fa0bfd5d59f86a6bbd12bd2fec88/SafetyDetect-AppsCheck-Android-Sample/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /SafetyDetect-AppsCheck-Android-Sample/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HMS-Core/hms-safetydetect-demo-android/23c6efa6f0a7fa0bfd5d59f86a6bbd12bd2fec88/SafetyDetect-AppsCheck-Android-Sample/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /SafetyDetect-AppsCheck-Android-Sample/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HMS-Core/hms-safetydetect-demo-android/23c6efa6f0a7fa0bfd5d59f86a6bbd12bd2fec88/SafetyDetect-AppsCheck-Android-Sample/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /SafetyDetect-AppsCheck-Android-Sample/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HMS-Core/hms-safetydetect-demo-android/23c6efa6f0a7fa0bfd5d59f86a6bbd12bd2fec88/SafetyDetect-AppsCheck-Android-Sample/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /SafetyDetect-AppsCheck-Android-Sample/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HMS-Core/hms-safetydetect-demo-android/23c6efa6f0a7fa0bfd5d59f86a6bbd12bd2fec88/SafetyDetect-AppsCheck-Android-Sample/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /SafetyDetect-AppsCheck-Android-Sample/app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #008577 4 | #00574B 5 | #D81B60 6 | 7 | #009688 8 | #009688 9 | #009F91 10 | #4CAF50 11 | #54BF58 12 | #FF1E63 13 | #FC216A 14 | #F1B706 15 | #FFC107 16 | 17 | #8BC34A 18 | 19 | #1743A000 20 | 21 | #009688 22 | #009F91 23 | #009F91 24 | #009688 25 | #4C4C4C 26 | #F4F6F6 27 | #EFECEC 28 | #DADADA 29 | #00FFFFFF 30 | 31 | -------------------------------------------------------------------------------- /SafetyDetect-AppsCheck-Android-Sample/app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 240dp 4 | 40dp 5 | 14sp 6 | 20sp 7 | 20sp 8 | 18sp 9 | 16dp 10 | 16dp 11 | 12sp 12 | -------------------------------------------------------------------------------- /SafetyDetect-AppsCheck-Android-Sample/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /SafetyDetect-AppsCheck-Android-Sample/app/src/test/java/com/huawei/safetydetectsample/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020. Huawei Technologies Co., Ltd. All rights reserved. 3 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.huawei.safetydetectsample; 18 | 19 | import org.junit.Test; 20 | 21 | import static org.junit.Assert.*; 22 | 23 | /** 24 | * Example local unit test, which will execute on the development machine (host). 25 | * 26 | * @see Testing documentation 27 | */ 28 | public class ExampleUnitTest { 29 | @Test 30 | public void addition_isCorrect() { 31 | assertEquals(4, 2 + 2); 32 | } 33 | } -------------------------------------------------------------------------------- /SafetyDetect-AppsCheck-Android-Sample/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | repositories { 5 | maven { url 'https://developer.huawei.com/repo/' } 6 | google() 7 | jcenter() 8 | } 9 | dependencies { 10 | classpath 'com.android.tools.build:gradle:3.6.3' 11 | classpath 'com.huawei.agconnect:agcp:1.0.0.300' 12 | // NOTE: Do not place your application dependencies here; they belong 13 | // in the individual module build.gradle files 14 | } 15 | } 16 | 17 | allprojects { 18 | repositories { 19 | maven { url 'https://developer.huawei.com/repo/' } 20 | google() 21 | jcenter() 22 | } 23 | } 24 | 25 | task clean(type: Delete) { 26 | delete rootProject.buildDir 27 | } 28 | 29 | -------------------------------------------------------------------------------- /SafetyDetect-AppsCheck-Android-Sample/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | # IDE (e.g. Android Studio) users: 3 | # Gradle settings configured through the IDE *will override* 4 | # any settings specified in this file. 5 | # For more details on how to configure your build environment visit 6 | # http://www.gradle.org/docs/current/userguide/build_environment.html 7 | # Specifies the JVM arguments used for the daemon process. 8 | # The setting is particularly useful for tweaking memory settings. 9 | org.gradle.jvmargs=-Xmx1536m 10 | # When configured, Gradle will run in incubating parallel mode. 11 | # This option should only be used with decoupled projects. More details, visit 12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 13 | # org.gradle.parallel=true 14 | # AndroidX package structure to make it clearer which packages are bundled with the 15 | # Android operating system, and which are packaged with your app's APK 16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn 17 | android.useAndroidX=true 18 | # Automatically convert third-party libraries to use AndroidX 19 | android.enableJetifier=true 20 | 21 | -------------------------------------------------------------------------------- /SafetyDetect-AppsCheck-Android-Sample/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HMS-Core/hms-safetydetect-demo-android/23c6efa6f0a7fa0bfd5d59f86a6bbd12bd2fec88/SafetyDetect-AppsCheck-Android-Sample/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /SafetyDetect-AppsCheck-Android-Sample/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Oct 28 14:59:14 CST 2019 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip 7 | -------------------------------------------------------------------------------- /SafetyDetect-AppsCheck-Android-Sample/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | rootProject.name='safety-detect-android-sample' 3 | -------------------------------------------------------------------------------- /SafetyDetect-SysIntegrity-Sample/SafetyDetect-SysIntegrity-Android-Sample/README.md: -------------------------------------------------------------------------------- 1 | # SafetyDetect SysIntegrity Sample 2 | English | [中文](https://github.com/HMS-Core/hms-safetydetect-demo-android/blob/master/SafetyDetect-SysIntegrity-Sample/SafetyDetect-SysIntegrity-Android-Sample/README_ZH.md) 3 | 4 | 5 | ## Table of Contents 6 | 7 | * [Introduction](#introduction) 8 | * [Getting Started](#getting-started) 9 | * [Supported Environments](#supported-environments) 10 | * [License](#license) 11 | 12 | 13 | ## Introduction 14 | SafetyDetect SysIntegrity Sample provides many sample programs for your reference or usage. 15 | The following describes packages of SafetyDetect SysIntegrity sample code. 16 | 17 | sample:Sample code packages. 18 | 19 | ## Getting Started 20 | You should create an app in AppGallery Connect, and obtain the file of agconnect-services.json and add to the project. 21 | You should also generate a signing certificate fingerprint and add the certificate file to the project, and add configuration to build.gradle. 22 | https://developer.huawei.com/consumer/en/doc/development/HMS-Guides/SafetyDetectDevelopment 23 | 24 | ## Supported Environments 25 | Java 1.7 or a later version is recommended. 26 | 27 | ## License 28 | SafetyDetect SysIntegrity Sample is licensed under the [Apache License, version 2.0](http://www.apache.org/licenses/LICENSE-2.0). 29 | 30 | -------------------------------------------------------------------------------- /SafetyDetect-SysIntegrity-Sample/SafetyDetect-SysIntegrity-Android-Sample/README_ZH.md: -------------------------------------------------------------------------------- 1 | # SafetyDetect SysIntegrity Sample 2 | [English](https://github.com/HMS-Core/hms-safetydetect-demo-android/blob/master/SafetyDetect-SysIntegrity-Sample/SafetyDetect-SysIntegrity-Android-Sample/README.md) | 中文 3 | 4 | 5 | ## 目录 6 | 7 | * [介绍](#介绍) 8 | * [运行步骤](#运行步骤) 9 | * [支持的环境](#支持的环境) 10 | * [许可证](#许可证) 11 | 12 | 13 | ## 介绍 14 | SafetyDetect Sample 提供了SafetyDetect SysIntegrity 特性示例程序供您参考或使用。 15 | 16 | ## 运行步骤 17 | 您应该在AppGallery Connect中创建一个应用程序,获取agconnect-services.json并添加到项目中。您还应该生成签名证书指纹并将证书文件添加到项目中,并将配置添加到build.gradle中。 18 | 更多信息可以访问: 19 | https://developer.huawei.com/consumer/en/doc/development/HMS-Guides/SafetyDetectDevelopment 20 | 21 | ## 支持的环境 22 | Java 1.7 及更高。 23 | 24 | ## 许可证 25 | 此代码示例已获得 [Apache License, version 2.0](http://www.apache.org/licenses/LICENSE-2.0). 26 | 27 | -------------------------------------------------------------------------------- /SafetyDetect-SysIntegrity-Sample/SafetyDetect-SysIntegrity-Android-Sample/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 | -ignorewarning 23 | 24 | -keepattributes *Annotation* 25 | -keepattributes Exceptions 26 | -keepattributes InnerClasses 27 | -keepattributes Signature 28 | -keepattributes SourceFile,LineNumberTable 29 | 30 | -keep class com.huawei.hianalytics.**{*;} 31 | -keep class com.huawei.updatesdk.**{*;} 32 | -keep class com.huawei.hms.**{*;} 33 | -------------------------------------------------------------------------------- /SafetyDetect-SysIntegrity-Sample/SafetyDetect-SysIntegrity-Android-Sample/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /SafetyDetect-SysIntegrity-Sample/SafetyDetect-SysIntegrity-Android-Sample/app/src/main/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 12 | 13 | 19 | 22 | 25 | 26 | 27 | 28 | 34 | 35 | -------------------------------------------------------------------------------- /SafetyDetect-SysIntegrity-Sample/SafetyDetect-SysIntegrity-Android-Sample/app/src/main/res/drawable/btn_bg_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | -------------------------------------------------------------------------------- /SafetyDetect-SysIntegrity-Sample/SafetyDetect-SysIntegrity-Android-Sample/app/src/main/res/drawable/btn_round_corner_normal.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | 10 | 15 | -------------------------------------------------------------------------------- /SafetyDetect-SysIntegrity-Sample/SafetyDetect-SysIntegrity-Android-Sample/app/src/main/res/drawable/btn_round_corner_small.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /SafetyDetect-SysIntegrity-Sample/SafetyDetect-SysIntegrity-Android-Sample/app/src/main/res/drawable/btn_round_green.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /SafetyDetect-SysIntegrity-Sample/SafetyDetect-SysIntegrity-Android-Sample/app/src/main/res/drawable/btn_round_normal.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /SafetyDetect-SysIntegrity-Sample/SafetyDetect-SysIntegrity-Android-Sample/app/src/main/res/drawable/btn_round_processing.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /SafetyDetect-SysIntegrity-Sample/SafetyDetect-SysIntegrity-Android-Sample/app/src/main/res/drawable/btn_round_red.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /SafetyDetect-SysIntegrity-Sample/SafetyDetect-SysIntegrity-Android-Sample/app/src/main/res/drawable/btn_round_yellow.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /SafetyDetect-SysIntegrity-Sample/SafetyDetect-SysIntegrity-Android-Sample/app/src/main/res/drawable/tab_menu_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /SafetyDetect-SysIntegrity-Sample/SafetyDetect-SysIntegrity-Android-Sample/app/src/main/res/drawable/tab_menu_sysintegrity.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /SafetyDetect-SysIntegrity-Sample/SafetyDetect-SysIntegrity-Android-Sample/app/src/main/res/layout/fg_content.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 14 | 15 | -------------------------------------------------------------------------------- /SafetyDetect-SysIntegrity-Sample/SafetyDetect-SysIntegrity-Android-Sample/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /SafetyDetect-SysIntegrity-Sample/SafetyDetect-SysIntegrity-Android-Sample/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /SafetyDetect-SysIntegrity-Sample/SafetyDetect-SysIntegrity-Android-Sample/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HMS-Core/hms-safetydetect-demo-android/23c6efa6f0a7fa0bfd5d59f86a6bbd12bd2fec88/SafetyDetect-SysIntegrity-Sample/SafetyDetect-SysIntegrity-Android-Sample/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /SafetyDetect-SysIntegrity-Sample/SafetyDetect-SysIntegrity-Android-Sample/app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HMS-Core/hms-safetydetect-demo-android/23c6efa6f0a7fa0bfd5d59f86a6bbd12bd2fec88/SafetyDetect-SysIntegrity-Sample/SafetyDetect-SysIntegrity-Android-Sample/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /SafetyDetect-SysIntegrity-Sample/SafetyDetect-SysIntegrity-Android-Sample/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HMS-Core/hms-safetydetect-demo-android/23c6efa6f0a7fa0bfd5d59f86a6bbd12bd2fec88/SafetyDetect-SysIntegrity-Sample/SafetyDetect-SysIntegrity-Android-Sample/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /SafetyDetect-SysIntegrity-Sample/SafetyDetect-SysIntegrity-Android-Sample/app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HMS-Core/hms-safetydetect-demo-android/23c6efa6f0a7fa0bfd5d59f86a6bbd12bd2fec88/SafetyDetect-SysIntegrity-Sample/SafetyDetect-SysIntegrity-Android-Sample/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /SafetyDetect-SysIntegrity-Sample/SafetyDetect-SysIntegrity-Android-Sample/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HMS-Core/hms-safetydetect-demo-android/23c6efa6f0a7fa0bfd5d59f86a6bbd12bd2fec88/SafetyDetect-SysIntegrity-Sample/SafetyDetect-SysIntegrity-Android-Sample/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /SafetyDetect-SysIntegrity-Sample/SafetyDetect-SysIntegrity-Android-Sample/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HMS-Core/hms-safetydetect-demo-android/23c6efa6f0a7fa0bfd5d59f86a6bbd12bd2fec88/SafetyDetect-SysIntegrity-Sample/SafetyDetect-SysIntegrity-Android-Sample/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /SafetyDetect-SysIntegrity-Sample/SafetyDetect-SysIntegrity-Android-Sample/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HMS-Core/hms-safetydetect-demo-android/23c6efa6f0a7fa0bfd5d59f86a6bbd12bd2fec88/SafetyDetect-SysIntegrity-Sample/SafetyDetect-SysIntegrity-Android-Sample/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /SafetyDetect-SysIntegrity-Sample/SafetyDetect-SysIntegrity-Android-Sample/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HMS-Core/hms-safetydetect-demo-android/23c6efa6f0a7fa0bfd5d59f86a6bbd12bd2fec88/SafetyDetect-SysIntegrity-Sample/SafetyDetect-SysIntegrity-Android-Sample/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /SafetyDetect-SysIntegrity-Sample/SafetyDetect-SysIntegrity-Android-Sample/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HMS-Core/hms-safetydetect-demo-android/23c6efa6f0a7fa0bfd5d59f86a6bbd12bd2fec88/SafetyDetect-SysIntegrity-Sample/SafetyDetect-SysIntegrity-Android-Sample/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /SafetyDetect-SysIntegrity-Sample/SafetyDetect-SysIntegrity-Android-Sample/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HMS-Core/hms-safetydetect-demo-android/23c6efa6f0a7fa0bfd5d59f86a6bbd12bd2fec88/SafetyDetect-SysIntegrity-Sample/SafetyDetect-SysIntegrity-Android-Sample/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /SafetyDetect-SysIntegrity-Sample/SafetyDetect-SysIntegrity-Android-Sample/app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #008577 4 | #00574B 5 | #D81B60 6 | 7 | #009688 8 | #009688 9 | #009F91 10 | #4CAF50 11 | #54BF58 12 | #FF1E63 13 | #FC216A 14 | #F1B706 15 | #FFC107 16 | 17 | #8BC34A 18 | 19 | #1743A000 20 | 21 | #009688 22 | #009F91 23 | #009F91 24 | #009688 25 | #4C4C4C 26 | #F4F6F6 27 | #EFECEC 28 | #DADADA 29 | #00FFFFFF 30 | 31 | -------------------------------------------------------------------------------- /SafetyDetect-SysIntegrity-Sample/SafetyDetect-SysIntegrity-Android-Sample/app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 240dp 4 | 40dp 5 | 14sp 6 | 20sp 7 | 20sp 8 | 18sp 9 | 16dp 10 | 16dp 11 | 12sp 12 | -------------------------------------------------------------------------------- /SafetyDetect-SysIntegrity-Sample/SafetyDetect-SysIntegrity-Android-Sample/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | HMSSafetyDetectSample 3 | 4 | Main 5 | start 6 | 7 | 8 | SysIntegrity 9 | SysIntegrity 10 | Run detection 11 | Detecting 12 | Rerun detection 13 | 14 | Click the button below to detect system integrity. 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /SafetyDetect-SysIntegrity-Sample/SafetyDetect-SysIntegrity-Android-Sample/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /SafetyDetect-SysIntegrity-Sample/SafetyDetect-SysIntegrity-Android-Sample/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | repositories { 5 | maven { url 'https://developer.huawei.com/repo/' } 6 | google() 7 | jcenter() 8 | } 9 | dependencies { 10 | classpath 'com.android.tools.build:gradle:3.6.3' 11 | classpath 'com.huawei.agconnect:agcp:1.0.0.300' 12 | // NOTE: Do not place your application dependencies here; they belong 13 | // in the individual module build.gradle files 14 | } 15 | } 16 | 17 | allprojects { 18 | repositories { 19 | 20 | maven { url 'https://developer.huawei.com/repo/' } 21 | google() 22 | jcenter() 23 | } 24 | } 25 | 26 | task clean(type: Delete) { 27 | delete rootProject.buildDir 28 | } 29 | 30 | -------------------------------------------------------------------------------- /SafetyDetect-SysIntegrity-Sample/SafetyDetect-SysIntegrity-Android-Sample/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | # IDE (e.g. Android Studio) users: 3 | # Gradle settings configured through the IDE *will override* 4 | # any settings specified in this file. 5 | # For more details on how to configure your build environment visit 6 | # http://www.gradle.org/docs/current/userguide/build_environment.html 7 | # Specifies the JVM arguments used for the daemon process. 8 | # The setting is particularly useful for tweaking memory settings. 9 | org.gradle.jvmargs=-Xmx1536m 10 | # When configured, Gradle will run in incubating parallel mode. 11 | # This option should only be used with decoupled projects. More details, visit 12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 13 | # org.gradle.parallel=true 14 | # AndroidX package structure to make it clearer which packages are bundled with the 15 | # Android operating system, and which are packaged with your app's APK 16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn 17 | android.useAndroidX=true 18 | # Automatically convert third-party libraries to use AndroidX 19 | android.enableJetifier=true 20 | 21 | -------------------------------------------------------------------------------- /SafetyDetect-SysIntegrity-Sample/SafetyDetect-SysIntegrity-Android-Sample/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HMS-Core/hms-safetydetect-demo-android/23c6efa6f0a7fa0bfd5d59f86a6bbd12bd2fec88/SafetyDetect-SysIntegrity-Sample/SafetyDetect-SysIntegrity-Android-Sample/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /SafetyDetect-SysIntegrity-Sample/SafetyDetect-SysIntegrity-Android-Sample/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Oct 28 14:59:14 CST 2019 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip 7 | -------------------------------------------------------------------------------- /SafetyDetect-SysIntegrity-Sample/SafetyDetect-SysIntegrity-Android-Sample/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | rootProject.name='safety-detect-android-sample' 3 | -------------------------------------------------------------------------------- /SafetyDetect-SysIntegrity-Sample/SafetyDetect-SysIntegrity-Server-Sample/README_ZH.md: -------------------------------------------------------------------------------- 1 | # SafetyDetect SysIntegrity Server Sample 2 | 3 | [English](https://github.com/HMS-Core/hms-safetydetect-demo-android/blob/master/SafetyDetect-SysIntegrity-Sample/SafetyDetect-SysIntegrity-Server-Sample/README.md) | 中文 4 | 5 | ## 目录 6 | 7 | * [介绍](#介绍) 8 | * [运行步骤](#运行步骤) 9 | * [支持环境](#支持环境) 10 | * [示例代码](#示例代码) 11 | * [许可证](#许可证) 12 | 13 | 14 | ## 介绍 15 | SafetyDetect SysIntegrity Server Sample 提供了在服务端验证结果的示例代码。 16 | ## 运行步骤 17 | 在运行SafetyDetect SysIntegrity Server Sample之前,请检查是否安装Java以及Maven。 18 | 19 | ## 支持环境 20 | Java 1.7 及以上 21 | 22 | ## 示例代码 23 | 24 | 1. 解析JWS,获取header,payload,signature。 25 | 2. 从header中获取证书链,使用HUAWEI CBG root证书对其进行验证。 26 | 3. 校验证书链中的叶证书域名,域名:sysintegrity.platform.hicloud.com。 27 | 4. 从signature中获取签名,校验其签名。 28 | 5. 从payload中获取完整性验证结果,格式和样例摘录如下: 29 | ```json 30 | { 31 | "advice":"RESTORE_TO_FACTORY_ROM", 32 | "apkCertificateDigestSha256":[ 33 | "yT5JtXRgeIgXssx1gQTsMA9GzM9ER4xAgCsCC69Fz3I=" 34 | ], 35 | "apkDigestSha256":"6Ihk8Wcv1MLm0O5KUCEVYCI/0KWzAHn9DyN38R3WYu8=", 36 | "apkPackageName":"com.huawei.hms.safetydetectsample", 37 | "basicIntegrity":false, 38 | "nonce":"R2Rra24fVm5xa2Mg", 39 | "timestampMs":1571708929141 40 | } 41 | ``` 42 | 更多信息请访问 43 | https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/SafetyDetectSysIntegrityDevelopment 44 | 45 | ## 许可证 46 | 此代码已获得 [Apache License, version 2.0](http://www.apache.org/licenses/LICENSE-2.0). 47 | 48 | -------------------------------------------------------------------------------- /SafetyDetect-SysIntegrity-Sample/SafetyDetect-SysIntegrity-Server-Sample/Third Party Open Source Software Notice.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HMS-Core/hms-safetydetect-demo-android/23c6efa6f0a7fa0bfd5d59f86a6bbd12bd2fec88/SafetyDetect-SysIntegrity-Sample/SafetyDetect-SysIntegrity-Server-Sample/Third Party Open Source Software Notice.docx -------------------------------------------------------------------------------- /SafetyDetect-SysIntegrity-Sample/SafetyDetect-SysIntegrity-Server-Sample/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | com.huawei.hms.safetydetect.sample 8 | safety-detect-server-sample 9 | 1.0-SNAPSHOT 10 | 11 | 12 | 1.8 13 | 1.8 14 | 15 | 16 | 17 | 18 | com.alibaba 19 | fastjson 20 | 1.2.62 21 | 22 | 23 | org.apache.httpcomponents 24 | httpclient 25 | 4.5.7 26 | 27 | 28 | 29 | 30 | 31 | 32 | org.apache.maven.plugins 33 | maven-compiler-plugin 34 | 3.6.1 35 | 36 | 1.8 37 | 1.8 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /SafetyDetect-SysIntegrity-Sample/SafetyDetect-SysIntegrity-Server-Sample/src/main/java/com/huawei/hms/safetydetect/sample/sysintegrity/Main.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020. Huawei Technologies Co., Ltd. All rights reserved. 3 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | 18 | package com.huawei.hms.safetydetect.sample.sysintegrity; 19 | 20 | import com.huawei.hms.safetydetect.sample.sysintegrity.entity.Jws; 21 | import com.huawei.hms.safetydetect.sample.sysintegrity.utils.VerifySignatureUtil; 22 | 23 | import java.security.NoSuchAlgorithmException; 24 | import java.util.Scanner; 25 | 26 | /** 27 | * Description: Main Entry 28 | * 29 | */ 30 | public class Main { 31 | 32 | public static void main(String[] args) 33 | throws NoSuchAlgorithmException { 34 | System.out.println("Paste your jws here:"); 35 | Scanner scanner = new Scanner(System.in); 36 | String jwsStr = scanner.nextLine(); 37 | //todo Please download cbg root cert from https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/SafetyDetectSysIntegrityDevelopment 38 | System.out.println("Input your certPath here:"); 39 | String filepath = scanner.nextLine(); 40 | scanner.close(); 41 | 42 | Jws jws = new Jws(jwsStr); 43 | boolean verify = VerifySignatureUtil.verifySignature(jws,filepath); 44 | 45 | if (verify) { 46 | System.out.println(jws.getPayload().toString()); 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /SafetyDetect-URLCheck-Android-Sample/README.md: -------------------------------------------------------------------------------- 1 | # SafetyDetect URLCheck Sample 2 | English | [中文](https://github.com/HMS-Core/hms-safetydetect-demo-android/blob/master/SafetyDetect-URLCheck-Android-Sample/README_ZH.md) 3 | 4 | ## Table of Contents 5 | 6 | * [Introduction](#introduction) 7 | * [Getting Started](#getting-started) 8 | * [Supported Environments](#supported-environments) 9 | * [License](#license) 10 | 11 | 12 | ## Introduction 13 | SafetyDetect URLCheck Sample provides many sample programs for your reference or usage. 14 | The following describes packages of SafetyDetect URLCheck sample code. 15 | 16 | sample: Sample code packages. 17 | 18 | 19 | ## Getting Started 20 | You should create an app in AppGallery Connect, and obtain the file of agconnect-services.json and add to the project. 21 | You should also generate a signing certificate fingerprint and add the certificate file to the project, and add configuration to build.gradle. 22 | https://developer.huawei.com/consumer/en/doc/development/HMS-Guides/SafetyDetectDevelopment 23 | 24 | ## Supported Environments 25 | Java 1.7 or a later version is recommended. 26 | 27 | ## License 28 | SafetyDetect URLCheck Sample is licensed under the [Apache License, version 2.0](http://www.apache.org/licenses/LICENSE-2.0). 29 | -------------------------------------------------------------------------------- /SafetyDetect-URLCheck-Android-Sample/README_ZH.md: -------------------------------------------------------------------------------- 1 | # SafetyDetect URLCheck Sample 2 | [English](https://github.com/HMS-Core/hms-safetydetect-demo-android/blob/master/SafetyDetect-URLCheck-Android-Sample/README.md) | 中文 3 | 4 | 5 | ## 目录 6 | 7 | * [介绍](#介绍) 8 | * [运行步骤](#运行步骤) 9 | * [支持的环境](#支持的环境) 10 | * [许可证](#许可证) 11 | 12 | 13 | ## 介绍 14 | SafetyDetect Sample 提供了SafetyDetect URLCheck 特性示例程序供您参考或使用。 15 | 16 | ## 运行步骤 17 | 您应该在AppGallery Connect中创建一个应用程序,获取agconnect-services.json并添加到项目中。您还应该生成签名证书指纹并将证书文件添加到项目中,并将配置添加到build.gradle中。 18 | 更多信息可以访问: 19 | https://developer.huawei.com/consumer/en/doc/development/HMS-Guides/SafetyDetectDevelopment 20 | 21 | ## 支持的环境 22 | Java 1.7 及更高。 23 | 24 | ## 许可证 25 | 此代码示例已获得 [Apache License, version 2.0](http://www.apache.org/licenses/LICENSE-2.0). 26 | 27 | -------------------------------------------------------------------------------- /SafetyDetect-URLCheck-Android-Sample/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 | -ignorewarning 23 | 24 | -keepattributes *Annotation* 25 | -keepattributes Exceptions 26 | -keepattributes InnerClasses 27 | -keepattributes Signature 28 | -keepattributes SourceFile,LineNumberTable 29 | 30 | -keep class com.huawei.hianalytics.**{*;} 31 | -keep class com.huawei.updatesdk.**{*;} 32 | -keep class com.huawei.hms.**{*;} 33 | -------------------------------------------------------------------------------- /SafetyDetect-URLCheck-Android-Sample/app/src/androidTest/java/com/huawei/hms/sysintegrity/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020. Huawei Technologies Co., Ltd. All rights reserved. 3 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.huawei.hms.sysintegrity; 18 | 19 | /** 20 | * Instrumented test, which will execute on an Android device. 21 | * 22 | * @see Testing documentation 23 | */ 24 | /*@RunWith(AndroidJUnit4.class) 25 | public class ExampleInstrumentedTest { 26 | @Test 27 | public void useAppContext() { 28 | // Context of the app under test. 29 | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); 30 | 31 | assertEquals("com.huawei.hms.safetydetectsample", appContext.getPackageName()); 32 | } 33 | }*/ 34 | -------------------------------------------------------------------------------- /SafetyDetect-URLCheck-Android-Sample/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /SafetyDetect-URLCheck-Android-Sample/app/src/main/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 12 | 13 | 19 | 22 | 25 | 26 | 27 | 28 | 34 | 35 | -------------------------------------------------------------------------------- /SafetyDetect-URLCheck-Android-Sample/app/src/main/res/drawable/btn_bg_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | -------------------------------------------------------------------------------- /SafetyDetect-URLCheck-Android-Sample/app/src/main/res/drawable/btn_round_corner_normal.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | 10 | 15 | -------------------------------------------------------------------------------- /SafetyDetect-URLCheck-Android-Sample/app/src/main/res/drawable/btn_round_corner_small.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /SafetyDetect-URLCheck-Android-Sample/app/src/main/res/drawable/btn_round_green.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /SafetyDetect-URLCheck-Android-Sample/app/src/main/res/drawable/btn_round_normal.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /SafetyDetect-URLCheck-Android-Sample/app/src/main/res/drawable/btn_round_processing.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /SafetyDetect-URLCheck-Android-Sample/app/src/main/res/drawable/btn_round_red.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /SafetyDetect-URLCheck-Android-Sample/app/src/main/res/drawable/btn_round_yellow.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /SafetyDetect-URLCheck-Android-Sample/app/src/main/res/drawable/tab_menu_appscheck.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /SafetyDetect-URLCheck-Android-Sample/app/src/main/res/drawable/tab_menu_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /SafetyDetect-URLCheck-Android-Sample/app/src/main/res/drawable/tab_menu_sysintegrity.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /SafetyDetect-URLCheck-Android-Sample/app/src/main/res/layout/fg_content.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 14 | 15 | -------------------------------------------------------------------------------- /SafetyDetect-URLCheck-Android-Sample/app/src/main/res/layout/fg_urlcheck.xml: -------------------------------------------------------------------------------- 1 | 12 | 13 | 17 | 18 | 24 | 25 | 26 | 32 | 33 |