This overview outlines the development and adoption of Huawei HarmonyOS and the associated security solution Safety Detect, highlighting some limitations with the approach. As regulations such as the EU DMA force the use of alternative app stores, the dependence of Huawei security features on the use of the Huawei AppGallery app store and ecosystem will also prove to be problematic for developers. We also compare and contrast Huawei HarmonyOS Safety Detect with the comprehensive mobile security offered by Approov.
HarmonyOS was launched in 2019 – initially as an OS for IoT devices, but later adapted to run on smartphones and other hardware. Huawei intends that the OS will offer a unified experience across wearables, tablet computers, smartphones, and smart TVs.
HarmonyOS 2.0 was launched in September 2020 and rolled out during 2021. In 2022, Huawei launched HarmonyOS 3 providing an improved experience across multiple devices such as smartphones, tablets, printers, cars and TVs. Release 4 came in 2023.
Initially HarmonyOS was compatible with Android but in early 2024 Huawei launched HarmonyOS Next, claiming that the whole stack is now Android-free and includes a kernel that can outperform Android.
Ecosystem adoption will of course be critical and this seems to also be on track. Huawei says it is in the process of training millions of developers and claims to have secured thousands of native apps to run on the OS, including some of the most popular apps in China.
Huawei has also created an "open" version of HarmonyOS Next so that third parties can use the OS to power their own devices. If this is successful, it could create a viable alternative to the Android/iOS duopoly.
Huawei's revived smartphone range is positioned as a patriotic alternative for Chinese buyers and is achieving significant penetration in China. It is also getting significant traction in other markets and HarmonyOS is already the third largest mobile operating system in terms of market share.
It is increasingly looking like support of HarmonyOS will be a requirement for any app developers who have global ambitions.
There are two fundamental problems with mobile apps: The first is that they can be reverse engineered, even if attempts have been made to obfuscate code. The second is that they run in a client environment which is neither owned nor controlled by the app owner.
This means that unless steps are taken, apps themselves can be analyzed, understood, cloned or copied, and the environments they run in can be hacked, rooted, instrumented and manipulated to interfere with the operation of an app.
Using these attack surfaces, hackers can directly intercept or tamper with data transferred between the app and its servers, intercept or manipulate financial transactions, or simply interfere with or stop the operation of the service.
Manipulated apps can be repackaged and redistributed with malware. Repackaged apps can be turned into automated tools (i.e. bots) to be used to attack APIs and backend servers. Secrets can also be lifted from apps then used in scripts to create bots. Bad actors use these techniques to carry out brute-force attacks, exploiting API vulnerabilities to steal data, or mount DDoS attacks.
So it's no surprise that trying to prevent apps and devices from being tampered with must be at the heart of any security strategy designed to protect mobile apps. However, this is only a fraction of the whole story, as we discuss below. App and device attestation are an essential piece of the puzzle but not sufficient in themselves.
Different services are available to provide app attestation. Huawei provides some app attestation and client integrity checks via Safety Detect. Approov provides an end-to-end mobile app security solution which includes app and device integrity checking. The rest of this paper compares the two solutions.
Huawei's Safety Detect was officially launched in 2019 as part of Huawei Mobile Services (HMS) Core, designed to provide a range of security features to app developers. Huawei’s device checking SysIntegrity closely resembles Android SafetyNet, both in terms of the API and the attestation process.
The launch timeline includes several updates and enhancements over the years:
In parallel, including an app in the Huawei AppGallery requires developers to undertake a comprehensive validation with Huawei which checks for malware, malicious code and other issues before the app is accepted for release.
HMS Core Safety Detect Kit is intended to provide safety features which allow developers to focus on app development. It is a multi-feature security detection service which uses the Trusted Execution Environment (TEE) on Huawei phones.
Separately, if your app needs to be released to AppGallery, it must pass a series of validation tests which inspect for malware and other threats. Huawei uses signing information such as the digital certificate (in .cer format) and profile (in .p7b format) to ensure app integrity. certificate and release profile to sign the app before releasing it.
Currently, Safety Detect offers four features: SysIntegrity (system integrity check), UserDetect (fake user detection), AppsCheck (app security check), and URLCheck (malicious URL check).
SysIntegrity
SysIntegrity can check whether the user’s device is rooted, unlocked, or has escalated privileges, and thus help developers evaluate whether to restrict their apps’ behavior to avoid information leakage or financial loss of the user during user actions such as making an online payment or sending an email. The TEE allows apps with SysIntegrity integrated to be run in an isolated environment.
UserDetect
UserDetect can identify fake users based on screen touch and sensor behavior, as well as prevent batch registration, credential stuffing attacks, bonus hunting, and content crawlers through the use of CAPTCHA.
AppsCheck
AppsCheck is intended as anti virus protection. It can obtain a list of malicious apps on the user’s device. The developer can then evaluate the risks and either warn the user about such risks or prompt the user to exit the app.
URLCheck
Intended to provide users with a secure Internet browsing experience, URLCheck allows apps to quickly check whether a URL that a user wants to visit is a malicious one.
There is a fifth API Wifi Detect which is intended to detect possible attacks from malicious Wi-Fi to your app but this is currently only available in mainland China.
You integrate the Core HMS SDK into your app and set up API calls in your app code for each of the services - SysIntegrity, AppsCheck, URLCheck and UserDetect. Your application interprets the returned result and decides what action to take.
Safety Detect is limited to the Huawei ecosystem. In addition, it does not provide runtime app attestation and we will also see in the next section that there are some limitations in the way that Huawei Harmony Safety Detect checks device integrity. In order to be effective, it must be part of a broader security effort.
If we use, for example, the OWASP MASVS (Mobile Application Security Verification Standard) framework in order to assess end-to-end mobile app security, Huawei Harmony Safety Detect partially addresses the guidelines in the category MASVS-RESILIENCE which is only one of seven categories in the guidelines. MASVS-RESILIENCE aims to ensure that the app is running on a trusted platform, prevent tampering at runtime and ensure the integrity of the app’s intended functionality.
In particular these are two other things you will need to take care of:
Now we understand the scope, let's look specifically at the app attestation and device integrity checks provided by Huawei and compare them with Approov Mobile Security.
As with Google PlayIntegrity, details of the inner workings are not disclosed and information on how to interpret the results is limited. This lack of granularity and visibility over what is checked could be an issue.
Huawei HarmonyOS Safety Detect provides a suite of security features for mobile apps, particularly within the Huawei ecosystem. However, its limitations in integration, regional applicability, dependency on Huawei infrastructure, potential privacy concerns, performance impact, and occasional detection inaccuracies must be carefully considered and addressed by developers to ensure robust and reliable app security.
Approov Mobile App Protection ensures that all mobile API traffic does indeed come from a genuine and untampered mobile app, running in a safe environment. Doing this blocks all scripts, bots and modified or repackaged mobile apps from abusing an API. Approov supports any apps running on Android, iOS, WatchOS and HarmonyOS, providing comprehensive and powerful security with easy and consistent management across all supported platforms.