All Products
Search
Document Center

API details

Last Updated: Sep 23, 2021

This topic describes the Mobile Security Armor (MSA) API for mobile applications.

Obtain the token of an uploaded file

Request - GetFileTokenForUploadToMsaRequest

Parameter Type Description
appId String The application associated with the request.
workspaceId String The workspace to which the application belongs.
tenantId String The tenant to which the application belongs.
onexFlag Boolean The value is fixed to true.

Return value - GetFileTokenForUploadToMsaResponse

  1. {
  2. "resultContent":{
  3. "content":{
  4. "accessid":"LTAI7z7XPfKU8gs5",
  5. "dir":"mds/tempFileForOnex/ONEXE9B092D/test/PUQYHL/8b574cb7-3596-403f-a0e9-208660fc2081/",
  6. "expire":"1584327372",
  7. "host":"https://mcube-test.oss-cn-hangzhou.aliyuncs.com",
  8. "policy":"QwM2YtYTBlOS0yMDg2NjBmYzIwODEvIl1dfQ==",
  9. "signature":"kisfP5YhbPtmES8+w="
  10. },
  11. "resultMsg":"",
  12. "success":true
  13. },
  14. "requestId":"8BAA3288-662E-422C-9960-2EEBFC08369F",
  15. "resultCode":"OK"
  16. }

Return value Description

Parameter Type Description
requestId String The ID of the request.
resultCode String If OK is returned, the request is successful. If other codes are returned, the API request failed.
ResultContent.Content Object The returned object. For more information about the meanings of the fields in the object, see the following table.

The following table lists the fields contained in the returned object and describes the meanings of the fields.

Parameter Type Description
resultMsg String The value returned if the query failed.
success Boolean Indicates whether the query is successful.

Instructs MSA to start processing applications that are uploaded to OSS

Request - UploadUserAppToMsaRequest

Parameter Type Description
appId String The application associated with the request.
workspaceId String The workspace to which the application belongs.
tenantId String The tenant to which the application belongs.
fileUrl String The URL of the uploaded APK or AAB.

Return value - UploadUserAppToMsaResponse

  1. {
  2. "resultContent":{
  3. "data":{
  4. "id": 12345,
  5. "enhanceTaskId": 12345,
  6. "progress": 10,
  7. "status": 0
  8. },
  9. "resultMsg":"",
  10. "success":true
  11. },
  12. "requestId":"637D5BE0-0111-4C53-BCEE-473CFFA0DBAD",
  13. "resultCode":"OK"
  14. }

Return value description

Parameter Type Description
requestId String The ID of the request.
resultCode String If OK is returned, the request is successful. If other results are returned, the API request failed.
resultContent Object The returned object. For more information about the meanings of the fields in the object, see the following table.

The following table lists the fields contained in the returned object and describes the meanings of the fields.

Parameter Type Description
data.id String The ID of the upload task. If reinforcement is in progress, you need to query the ID by initiating a polling task.
data.enhanceTaskId String The reinforcement task ID returned after upload is complete. This ID is used to start an reinforcement task.
data.status Integer The status of the upload task. Valid values: –1: failed. 0: processing. 1: uploaded
resultMsg String The value returned if the query failed.
success Boolean Indicates whether the query is successful.

Queries the processing status of the uploaded application

Request - GetUserAppUploadProcessInMsaRequest

Parameter Type Description
appId String The application associated with the request.
workspaceId String The workspace to which the application belongs.
tenantId String The tenant to which the application belongs.
id Long The ID of the upload task.

Return value - GetUserAppUploadProcessInMsaResponse

  1. {
  2. "resultContent":{
  3. "data":{
  4. "id": 12345,
  5. "enhanceTaskId": 12345,
  6. "progress": 10,
  7. "status": 0
  8. },
  9. "resultMsg":"",
  10. "success":true
  11. },
  12. "requestId":"637D5BE0-0111-4C53-BCEE-473CFFA0DBAD",
  13. "resultCode":"OK"
  14. }

Return value description

Parameter Type Description
requestId String The ID of the request.
resultCode String If OK is returned, the request is successful. If other results are returned, the API request failed.
resultContent Object The returned object. For more information about the meanings of the fields in the object, see the following table.

The following table lists the fields contained in the returned object and describes the meanings of the fields.

Parameter Type Description
data.id String The ID of the upload task. If enhancement is in progress, you need to query the ID by initiating a polling task.
data.enhanceTaskId String A enhancement task ID that is returned after upload is complete. This ID is used to start a enhancement task.
data.status Integer The status of the upload task. Valid values: –1: failed. 0: processing. 1: uploaded
resultMsg String The value returned if the query failed.
success Boolean Indicates whether the query is successful.

Start a reinforcement task

Request - StartUserAppAsyncEnhanceInMsaRequest

Parameter Type Description
appId String The application associated with the request.
workspaceId String The workspace to which the application belongs.
tenantId String The tenant to which the application belongs.
id Long The ID of the reinforcement task.
taskType String The type of the task. Valid values: shell: adds shells. enhance_shell: uses Java2C. ````
classes String The core classes that you want to reinforce by using Java2C. We recommend that you add critical core classes only. You can separate the classes by commas (,). For example, set the value to com.a.a,com.b.b. If you specify this parameter, ensure that taskType is set to enhance_shell. However, this parameter is not applicable to few classes. If you set this field for these classes, reinforcement may fail.
totalSwitch Boolean The total switch that specifies whether to enable the task. To use the switches subordinate to the total switch, you must set this parameter to true.
javaHook Integer The anti-hooking technique on the Java layer. Valid values: 0: killself. 1: warning
memoryDump Integer The anti-memory dump protection technique. Valid values: 0: killself. 1: warning
emulatorEnvironment Integer The anti-emulation technique. Valid values: 0: killself. 1: warning
nativeHook Integer The anti-hooking technique on the native layer. Valid values: 0: killself. 1: warning
dalvikDebugger Integer The anti-debugging technique on the Java layer. Valid values: 0: killself. 1: warning
nativeDebugger Integer The anti-debugging technique on the native layer and the rooting technique. Valid values: 0: killself. 1: warning

Return value - StartUserAppAsyncEnhanceInMsaResponse

  1. {
  2. "resultContent":{
  3. "data":{
  4. "afterMd5": "aaaaaaaa",
  5. "afterSize": 1000,
  6. "appCode": "ONEXxxxx",
  7. "appPackage": "com.example.app",
  8. "beforeMd5": "bbbbbb",
  9. "id": 1,
  10. "label": "Alipay",
  11. "progress": 0,
  12. "status": 2,
  13. "taskType": "shell",
  14. "versionCode": 1,
  15. "versionName": "1.0.0",
  16. "enhancedClasses": ["aaa", "bbb"]
  17. },
  18. "resultMsg":"",
  19. "success":true
  20. },
  21. "requestId":"F9C681F2-6377-488D-865B-1144E0CE69D2",
  22. "resultCode":"OK"
  23. }

Return value description

Parameter Type Description
requestId String The ID of the request.
resultCode String If OK is returned, the request is successful. If other results are returned, the API request failed.
resultContent Object The returned object. For more information about the meanings of the fields in the object, see the following table.

The following table lists the fields contained in the returned object and describes the meanings of the fields.

Parameter Type Description
resultMsg String The value returned if the query failed.
success Boolean Indicates whether the query is successful.
data.afterMd5 String The MD5 checksum of the reinforced APK or AAB.
data.afterSize Long The size of the reinforced APK or AAB.
data.id Long The ID of the reinforcement task. This ID is used for subsequent polling.
data.label String The labels of the APK or AAB. The value is the same as that of the label field of the APK or AAB.
data.progress Integer The progress of the reinforcement process. Valid values: 0 to 100
data.status Integer The status of the reinforcement task. Valid values: 0: not started. 1: task submitted. 2: reinforcing. 3: reinforced. 4.reinforcement failed
data.taskType String The type of the reinforcement task.
data.enhancedClasses String The class selected for Java2C.

Queries the progress of the reinforcement task

Request - GetUserAppEnhanceProcessInMsaRequest

Parameter Type Description
appId String The application associated with the request.
workspaceId String The workspace to which the application belongs.
tenantId String The tenant to which the application belongs.
id Long The ID of the reinforcement task.

Return value - GetUserAppEnhanceProcessInMsaResponse

  1. {
  2. "resultContent":{
  3. "data":{
  4. "afterMd5": "aaaaaaaa",
  5. "afterSize": 1000,
  6. "appCode": "ONEXxxxx",
  7. "appPackage": "com.example.app",
  8. "beforeMd5": "bbbbbb",
  9. "id": 1,
  10. "label": "Alipay",
  11. "progress": 0,
  12. "status": 2,
  13. "taskType": "shell",
  14. "versionCode": 1,
  15. "versionName": "1.0.0",
  16. "enhancedClasses": ["aaa", "bbb"]
  17. },
  18. "resultMsg":"",
  19. "success":true
  20. },
  21. "requestId":"F9C681F2-6377-488D-865B-1144E0CE69D2",
  22. "resultCode":"OK"
  23. }

Return value description

Parameter Type Description
requestId String The ID of the request.
resultCode String If OK is returned, the request is successful. If other results are returned, the API request failed.
resultContent Object The returned object. For more information about the meanings of the fields in the object, see the following table.

The following table lists the fields contained in the returned object and describes the meanings of the fields.

Parameter Type Description
resultMsg String The value returned if the query failed.
success Boolean Indicates whether the query is successful.
data.afterMd5 String The MD5 checksum of the reinforced APK or AAB.
data.afterSize Long The size of the reinforced APK or AAB.
data.id Long The ID of the reinforcement task. This ID is used for subsequent polling.
data.label String The labels of the APK or AAB. The value is the same as that of the label field of the APK or AAB.
data.progress Integer The progress of the reinforcement process. Valid values: 0 to 100
data.status Integer The status of the reinforcement task. Valid values: 0: not started. 1: task submitted. 2: reinforcing. 3: reinforced. 4. reinforcement failed
data.taskType String The type of the reinforcement task.
data.enhancedClasses String The class selected for Java2C.

Queries the download URL of the reinforced product

Request - GetUserAppDonwloadUrlInMsaRequest

Parameter Type Description
appId String The application associated with the request.
workspaceId String The workspace to which the application belongs.
tenantId String The tenant to which the application belongs.
taskId String The ID of the enhancement task.

Return value - GetUserAppDonwloadUrlInMsaResponse

  1. {
  2. "resultContent":{
  3. "data": { "url": "https://xxxx"},
  4. "resultMsg":"",
  5. "success":false
  6. },
  7. "requestId":"8F76783A-8070-4182-895D-14E5D66F8BA3",
  8. "resultCode":"OK"
  9. }

Return value description

Parameter Type Description
requestId String The ID of the request.
resultCode String If OK is returned, the request is successful. If other results are returned, the API request failed.
checkRsaKeyResult Object The returned object. For more information about the meanings of the fields in the object, see the following table.

The following table lists the fields contained in the returned object and describes the meanings of the fields.

Parameter Type Description
data.url String The download URL of the APK or AAB.
data.filename String The file name of the APK or AAB.
resultMsg String The value returned if the query failed.
success Boolean Indicates whether the query is successful.

Queries the enhancement log

Request - GetLogUrlInMsaRequest

Parameter Type Description
appId String The application associated with the request.
workspaceId String The workspace to which the application belongs.
tenantId String The tenant to which the application belongs.
taskId String The ID of the enhancement task.

Return value - GetLogUrlInMsaResponse

  1. {
  2. "resultContent":{
  3. "data": { "url": "https://xxxx"},
  4. "resultMsg":"",
  5. "success":false
  6. },
  7. "requestId":"8F76783A-8070-4182-895D-14E5D66F8BA3",
  8. "resultCode":"OK"
  9. }

Return value description

Parameter Type Description
requestId String The ID of the request.
resultCode String If OK is returned, the request is successful. If other results are returned, the API request failed.
resultContent Object The returned object. For more information about the meanings of the fields in the object, see the following table.

The following table lists the fields contained in the returned object and describes the meanings of the fields.

Parameter Type Description
data String The download URL of the log.
resultMsg String The value returned if the query failed.
success Boolean Indicates whether the query is successful.