Lists the APIs for mobile application security hardening, including file upload, hardening task management, and artifact download.
Get an upload file token
Request - GetFileTokenForUploadToMsaRequest
|
Parameter Name |
Type |
Description |
|
appId |
String |
The associated app. |
|
workspaceId |
String |
Associated workspace |
|
tenantId |
String |
Associated tenant. |
|
onexFlag |
Boolean |
Set the value to |
Return value - GetFileTokenForUploadToMsaResponse
{
"resultContent":{
"content":{
"accessid":"LTAI****************",
"dir":"mds/tempFileForOnex/ONEXE9B092D/test/PUQYHL/8b574cb7-3596-403f-a0e9-208660fc2081/",
"expire":"1584327372",
"host":"https://mcube-test.oss-cn-hangzhou.aliyuncs.com",
"policy":"QwM2YtYTBlOS0yMDg2NjBmYzIwODEvIl1dfQ==",
"signature":"kisfP5YhbPtmES8+w="
},
"resultMsg":"",
"success":true
},
"requestId":"8BAA3288-662E-422C-9960-2EEBFC08369F",
"resultCode":"OK"
}
Return value description
|
Return value name |
Type |
Description |
|
requestId |
String |
Request ID. |
|
resultCode |
String |
Returns |
|
ResultContent.Content |
Object |
The returned object, described in the following table. |
The object contains the following fields:
|
Name |
Type |
Description |
|
resultMsg |
String |
Error message on failure. |
|
success |
Boolean |
Whether the query succeeded. |
Notify MSA to process an application uploaded to OSS
Request - UploadUserAppToMsaRequest
|
Parameter Name |
Type |
Description |
|
appId |
String |
The app that owns the file. |
|
workspaceId |
String |
Associated workspace. |
|
tenantId |
String |
Associated tenant. |
|
fileUrl |
String |
URL of the uploaded file. |
|
useYShield |
Boolean |
Set this parameter to |
Return value - UploadUserAppToMsaResponse
{
"resultContent":{
"data":{
"id": 12345,
"enhanceTaskId": 12345,
"progress": 10,
"status": 0
},
"resultMsg":"",
"success":true
},
"requestId":"637D5BE0-0111-4C53-BCEE-473CFFA0DBAD",
"resultCode":"OK"
}
Return value description
|
Return value name |
Type |
Description |
|
requestId |
String |
Request ID. |
|
resultCode |
String |
Returns |
|
resultContent |
Object |
The returned object, described in the following table. |
The object contains the following fields:
|
Name |
Type |
Description |
|
data.id |
Integer |
Upload task ID. Poll this to check status if hardening is not complete. |
|
data.enhanceTaskId |
Integer |
Hardening task ID returned after upload. Use this to start the hardening task. |
|
data.progress |
Integer |
Hardening progress, ranging from 0 to 100. |
|
data.status |
Integer |
Upload status.
|
|
resultMsg |
String |
Error message on failure. |
|
success |
Boolean |
Whether the query succeeded. |
Query the status of an application upload
Request - GetUserAppUploadProcessInMsaRequest
|
Parameter Name |
Type |
Description |
|
appId |
String |
The app that owns the file. |
|
workspaceId |
String |
Associated workspace. |
|
tenantId |
String |
Associated tenant. |
|
id |
Long |
Upload task ID. |
Return value - GetUserAppUploadProcessInMsaResponse
{
"resultContent":{
"data":{
"id": 12345,
"enhanceTaskId": 12345,
"progress": 10,
"status": 0
},
"resultMsg":"",
"success":true
},
"requestId":"637D5BE0-0111-4C53-BCEE-473CFFA0DBAD",
"resultCode":"OK"
}
Return value description
|
Return value name |
Type |
Description |
|
requestId |
String |
Request ID. |
|
resultCode |
String |
Returns |
|
resultContent |
Object |
The returned object, described in the following table. |
The object contains the following fields:
|
Name |
Type |
Description |
|
data.id |
String |
Upload task ID. Poll this to check status if hardening is not complete. |
|
data.enhanceTaskId |
String |
Hardening task ID returned after upload. Use this to start the hardening task. |
|
data.status |
Integer |
Upload status.
|
|
resultMsg |
String |
Error message on failure. |
|
success |
Boolean |
Whether the query succeeded. |
Start a hardening task
Request - StartUserAppAsyncEnhanceInMsaRequest
Android
Standard
|
Name |
Type |
Description |
|
appId |
String |
The app that owns the file. |
|
workspaceId |
String |
Associated workspace. |
|
tenantId |
String |
Associated tenant. |
|
id |
Long |
The ID of the hardening task. |
|
taskType |
String |
The task type. Valid values are |
|
useAShield |
boolean |
Set the value to true to start a hardening task that uses the new toolchain. If you do not set this parameter or set it to false, the old toolchain is used. |
|
classes |
String |
The core classes that require Java2C hardening. Add only key core classes and separate them with commas (,), for example, |
|
totalSwitch |
boolean |
The master switch. The following switches take effect only when this parameter is set to |
|
javaHook |
Integer |
The anti-Java hook capability. `0` indicates KillSelf and `1` indicates Warning. |
|
memoryDump |
Integer |
The anti-memory dump capability. `0` indicates KillSelf and `1` indicates Warning. |
|
emulatorEnvironment |
Integer |
The anti-emulator capability. `0` indicates KillSelf and `1` indicates Warning. |
|
nativeHook |
Integer |
The anti-native hook capability. `0` indicates KillSelf and `1` indicates Warning. |
|
dalvikDebugger |
Integer |
The anti-Java debugging capability. `0` indicates KillSelf and `1` indicates Warning. |
|
nativeDebugger |
Integer |
The anti-native debugging and anti-root capabilities. `0` indicates KillSelf and `1` indicates Warning. |
Professional
|
Name |
Type |
Description |
Example |
|
appId |
String |
The app that owns the file. |
|
|
workspaceId |
String |
The workspace where the resource is located. |
|
|
tenantId |
String |
Associated tenant. |
|
|
id |
Long |
The ID of the hardening task. |
|
|
useYShield |
boolean |
Set this parameter to |
|
|
newShieldConfig |
JSONString |
The security hardening parameters for Android Professional Edition. The following parameters are all hardening parameters. |
{\"anti_dual\":1,\"antirepack\":{\"include\":\"E10ADC3949BA59ABBE56E057F20F883E\\n698D51A19D8A121CE581499D7B701668\"}} |
|
antiHookFramework |
int |
Protection against hook frameworks. |
1: Enabled. Other values: Disabled. |
|
antiroot |
int |
Protection against rooting. |
1: Enabled. Other values: Disabled. |
|
antiemulator |
int |
Protection against emulators. |
1: Enabled. Other values: Disabled. |
|
antidbg |
int |
Protection against dynamic debugging. |
1: Enabled. Other values: Disabled. |
|
antidump |
int |
Protection against memory dumping. |
1: Enabled. Other values: Disabled. |
|
antirepack |
String |
Protection against repackaging. Whitelist format: Signature MD5. Use `\n` to separate multiple signature values. |
{\"include\":\"E10ADC3949BA59ABBE56E057F20F883E\n698D51A19D8A121CE581499D7B701668\"} |
|
anti_dual |
int |
Protection against running multiple instances. |
1: Enabled. Other values: Disabled. |
iOS
Installation package hardening
|
Name |
Type |
Description |
Example |
|
appId |
String |
The app that owns the file. |
|
|
workspaceId |
String |
Associated workspace. |
|
|
tenantId |
String |
Associated tenant. |
|
|
id |
Long |
The ID of the hardening task. |
|
|
useYShield |
boolean |
Set this parameter to |
|
|
newShieldConfig |
JSONString |
The security hardening parameters for iOS installation packages. The following parameters are all hardening parameters. |
{\"-iosAntiRoot\":1,\"-iosAntiProxy\":1} |
|
-iosAntiRoot |
int |
Protection against jailbreaking. |
1: Enabled. Other values: Disabled. |
|
-iosAntiRepack |
int |
Protection against repackaging. |
1: Enabled. Other values: Disabled. |
|
-iosAntiProxy |
int |
Protection against proxies. |
1: Enabled. Other values: Disabled. |
|
-iosAntiDual |
int |
Protection against running multiple instances. |
1: Enabled. Other values: Disabled. |
|
-iosAntiInject |
int |
Protection against injection. |
1: Enabled. Other values: Disabled. |
|
-iosAntiHook |
int |
Protection against hooks. |
1: Enabled. Other values: Disabled. |
|
-iosStringEnc |
int |
String encryption. This feature must be enabled together with ustring-only encryption. |
1: Enabled. Other values: Disabled. |
|
-ustring |
int |
Ustring-only encryption. This feature must be enabled together with string encryption. |
1: Enabled. Other values: Disabled. |
|
-iosAntiDebug |
int |
Protection against dynamic debugging. |
1: Enabled. Other values: Disabled. |
|
-iosScreenShield |
int |
Screen capture protection, which includes anti-screen recording, anti-screenshot, and anti-screen mirroring. |
1: Enabled. Other values: Disabled. |
HarmonyOS
|
Name |
Type |
Description |
Example |
|
appId |
String |
The app that owns the file. |
|
|
workspaceId |
String |
Associated workspace. |
|
|
tenantId |
String |
Associated tenant. |
|
|
id |
Long |
The ID of the hardening task. |
|
|
useYShield |
boolean |
Set this parameter to |
|
|
newShieldConfig |
JSONString |
The security hardening parameters for HarmonyOS installation packages. The following parameters are all hardening parameters. |
{\"obfuse\":{\"include\":\".*entryclass.*\",\"exclude\":\".*methodname.*\"},\"strencrypt\":{\"include\":\".*entry.*\",\"exclude\":\".*name.*\"}} |
|
obfuse |
String |
Code obfuscation.
|
{\"obfuse\":{\"include\":\".*entryclass.*\",\"exclude\":\".*methodname.*\"}} |
|
strencrypt |
String |
String encryption.
|
{\"strencrypt\":{\"include\":\".*entry.*\",\"exclude\":\".*name.*\"}} |
Return value - StartUserAppAsyncEnhanceInMsaResponse
{
"resultContent":{
"data":{
"afterMd5": "aaaaaaaa",
"afterSize": 1000,
"appCode": "ONEXxxxx",
"appPackage": "com.example.app",
"beforeMd5": "bbbbbb",
"id": 1,
"label": "Alipay",
"progress": 0,
"status": 2,
"taskType": "shell",
"versionCode": 1,
"versionName": "1.0.0",
"enhancedClasses": ["aaa", "bbb"]
},
"resultMsg":"",
"success":true
},
"requestId":"F9C681F2-6377-488D-865B-1144E0CE69D2",
"resultCode":"OK"
}
Return value description
|
Return value name |
Type |
Description |
|
requestId |
String |
Request ID. |
|
resultCode |
String |
Returns OK on success; otherwise indicates an error. |
|
resultContent |
Object |
The returned object, described in the following table. |
The object contains the following fields:
|
Name |
Type |
Description |
|
resultMsg |
String |
Error message on failure. |
|
success |
Boolean |
Whether the query succeeded. |
|
data.afterMd5 |
String |
The MD5 hash of the file after hardening. |
|
data.afterSize |
Long |
The size of the file after hardening. |
|
data.id |
Long |
The ID of the hardening task. This ID is used for subsequent polling. |
|
data.label |
String |
The label field of the file. |
|
data.progress |
Integer |
Hardening progress, ranging from 0 to 100. |
|
data.status |
Integer |
The status of the hardening task. 0: Not started. 1: Submitted. 2: In progress. 3: Successful. 4: Failed. |
|
data.taskType |
String |
The type of the hardening task. |
|
data.enhancedClasses |
String[] |
The classes selected for Java2C. |
Query the progress of a hardening task
Request - GetUserAppEnhanceProcessInMsaRequest
|
Name |
Type |
Description |
|
appId |
String |
The app that owns the file. |
|
workspaceId |
String |
Associated workspace. |
|
tenantId |
String |
Associated tenant. |
|
id |
Long |
The ID of the hardening task. |
Return value - GetUserAppEnhanceProcessInMsaResponse
{
"resultContent":{
"data":{
"afterMd5": "aaaaaaaa",
"afterSize": 1000,
"appCode": "ONEXxxxx",
"appPackage": "com.example.app",
"beforeMd5": "bbbbbb",
"id": 1,
"label": "Alipay",
"progress": 0,
"status": 2,
"taskType": "shell",
"versionCode": 1,
"versionName": "1.0.0",
"enhancedClasses": ["aaa", "bbb"]
},
"resultMsg":"",
"success":true
},
"requestId":"F9C681F2-6377-488D-865B-1144E0CE69D2",
"resultCode":"OK"
}
Return value description
|
Return value name |
Type |
Description |
|
requestId |
String |
Request ID. |
|
resultCode |
String |
Returns OK on success; otherwise indicates an error. |
|
resultContent |
Object |
The returned object, described in the following table. |
The object contains the following fields:
|
Name |
Type |
Description |
|
resultMsg |
String |
Error message on failure. |
|
success |
Boolean |
Whether the query succeeded. |
|
data.afterMd5 |
String |
The MD5 hash of the file after hardening. |
|
data.afterSize |
Long |
The size of the file after hardening. |
|
data.id |
Long |
The ID of the hardening task. This ID is used for subsequent polling. |
|
data.label |
String |
The label field of the file. |
|
data.progress |
Integer |
Hardening progress, ranging from 0 to 100. |
|
data.status |
Integer |
The status of the hardening task. 0: Not started. 1: Submitted. 2: In progress. 3: Successful. 4: Failed. |
|
data.taskType |
String |
The type of the hardening task. |
|
data.enhancedClasses |
String[] |
The classes selected for Java2C. |
Query the download URL of the hardened artifact
Request - GetUserAppDownloadUrlInMsaRequest
|
Parameter Name |
Type |
Description |
|
appId |
String |
The app that owns the file. |
|
workspaceId |
String |
Associated workspace. |
|
tenantId |
String |
Associated tenant. |
|
taskId |
String |
The ID of the hardening task. |
Return value - GetUserAppDownloadUrlInMsaResponse
{
"resultContent":{
"data": { "url": "https://xxxx"},
"resultMsg":"",
"success":false
},
"requestId":"8F76783A-8070-4182-895D-14E5D66F8BA3",
"resultCode":"OK"
}
Return value description
|
Return value name |
Type |
Description |
|
requestId |
String |
Request ID. |
|
resultCode |
String |
Returns OK on success; otherwise indicates an error. |
|
checkRSAKeyResult |
Object |
The returned object, described in the following table. |
The object contains the following fields:
|
Name |
Type |
Description |
|
data.url |
String |
The download URL of the file. |
|
data.filename |
String |
The filename. |
|
resultMsg |
String |
Error message on failure. |
|
success |
Boolean |
Whether the query succeeded. |
Query hardening logs
Request - GetLogUrlInMsaRequest
|
Parameter Name |
Type |
Description |
|
appId |
String |
The app that owns the file. |
|
workspaceId |
String |
Associated workspace. |
|
tenantId |
String |
Associated tenant. |
|
taskId |
String |
The ID of the hardening task. |
Return value - GetLogUrlInMsaResponse
{
"resultContent":{
"data": { "url": "https://xxxx"},
"resultMsg":"",
"success":false
},
"requestId":"8F76783A-8070-4182-895D-14E5D66F8BA3",
"resultCode":"OK"
}
Return value description
|
Return value name |
Type |
Description |
|
requestId |
String |
Request ID. |
|
resultCode |
String |
Returns OK on success; otherwise indicates an error. |
|
resultContent |
Object |
The returned object, described in the following table. |
The object contains the following fields:
|
Name |
Type |
Description |
|
data |
String |
Download URL for the log. |
|
resultMsg |
String |
Error message on failure. |
|
success |
Boolean |
Whether the query succeeded. |