All Products
Search
Document Center

Mobile Platform as a Service:Usage notes

Last Updated:Dec 20, 2023

This topic describes the open interfaces that are used to secure mobile application.

Obtain the upload token

Request- GetFileTokenForUploadToMsaRequest

Parameter

Type

Description

appId

String

The app to which the instance belongs.

workspaceId

String

The workspace to which the instance belongs.

tenantId

String

The tenant to which the instance belongs.

onexFlag

Boolean

The fixed value is true.

Return Value- GetFileTokenForUploadToMsaResponse

{
    "resultContent":{
        "content":{
            "accessid":"LTAI7z7XPfKU****",
            "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 values

Return value name

Parameter

Description

requestId

String

The ID that identifies the request.

resultCode

String

Normally, the code returned by the request is OK. If other conditions exist, the API request is abnormal.

ResultContent.Content

Object

The specific object returned. The following table describes the specific meanings.

The returned object contains the following fields:

Parameter

Type

Description

resultMsg

String

The return value after the query fails.

success

Boolean

Indicates whether the request was successful. Valid values:

Notify MSA to start processing applications that have been uploaded to OSS

Request- UploadUserAppToMsaRequest

Parameter

Type

Description

appId

String

The app to which the instance belongs.

workspaceId

String

The workspace to which the instance belongs.

tenantId

String

The tenant to which the instance belongs.

fileUrl

String

The URL of the uploaded APK/ABB.

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 values

Return value name

Parameter

Description

requestId

String

The ID that identifies the request.

resultCode

String

Normally, the code returned by the request is OK. If other conditions exist, the API request is abnormal.

resultContent

Object

The specific object returned. The following table describes the specific meanings.

The returned object contains the following fields:

Parameter

Type

Description

data.id

Integer

The ID of the upload task. If the reinforcement is not complete, a polling check is required.

data.enhanceTaskId

Integer

After the upload is complete, a reinforcement task ID is returned. This ID is used to start the reinforcement task.

data.progress

Integer

Progress of reinforcement, range 0 - 100.

data.status

Integer

The upload status. A value of -1 indicates that the upload failed. A value of 0 indicates that the upload is in process. A value of 1 indicates that the upload is successful.

resultMsg

String

The return value after the query fails.

success

Boolean

Indicates whether the request was successful. Valid values:

Query processing upload application status

Request- GetUserAppUploadProcessInMsaRequest

Parameter

Type

Description

appId

String

The app to which the instance belongs.

workspaceId

String

The workspace to which the instance belongs.

tenantId

String

The tenant to which the instance belongs.

id

Long

The ID of the upload task.

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 values

Return value name

Parameter

Description

requestId

String

The ID that identifies the request.

resultCode

String

Normally, the code returned by the request is OK. If other conditions exist, the API request is abnormal.

resultContent

Object

The specific object returned. The following table describes the specific meanings.

The returned object contains the following fields:

Parameter

Type

Description

data.id

String

The ID of the upload task. If the reinforcement is not complete, a polling check is required.

data.enhanceTaskId

String

After the upload is complete, a reinforcement task ID is returned. This ID is used to start the reinforcement task.

data.status

Integer

The upload status. A value of -1 indicates that the upload failed. A value of 0 indicates that the upload is in process. A value of 1 indicates that the upload is successful.

resultMsg

String

The return value after the query fails.

success

Boolean

Indicates whether the request was successful. Valid values:

Start a hardening task

Request- StartUserAppAsyncEnhanceInMsaRequest

Parameter

Type

Description

appId

String

The app to which the instance belongs.

workspaceId

String

The workspace to which the instance belongs.

tenantId

String

The tenant to which the instance belongs.

id

Long

The ID of the reinforcement task.

taskType

String

Task type, there are two kinds of shell and enhance_shell, the shell is shell, enhance_shell with Java2C use.

useAShield

boolean

true to start the new hardening tool chain hardening task. If not passed or false is passed, the hardening task of the old hardening tool chain will be started.

classes

String

To set the core classes that require Java2C reinforcement, only the key core classes should be added and separated by English commas (,). If com.a.a,com.b.b, if this value is set, the taskType needs to be enhance_shell. If individual classes do not adapt to the reinforcement, the reinforcement may fail.

totalSwitch

boolean

The main switch, set to true, the following switches take effect.

javaHook

Integer

The anti-Java hook. The value 0 is Killself. The value 1 is Warning.

memoryDump

Integer

The anti-memory dump capability. 0 indicates Killself. 1 indicates Warning.

emulatorEnvironment

Integer

The anti-simulator capability. 0 indicates Killself. 1 indicates Warning.

nativeHook

Integer

The anti-native hook. The value 0 is Killself. The value 1 is Warning.

dalvikDebugger

Integer

The anti-Java debugging capability. The value 0 is Killself and the value 1 is Warning.

nativeDebugger

Integer

Anti-Native Debugging and Root Capability. 0 indicates Killself and 1 indicates Warning.

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 values

Return value name

Parameter

Description

requestId

String

The ID that identifies the request.

resultCode

String

Normally, the code returned by the request is OK. If other conditions exist, the API request is abnormal.

resultContent

Object

The specific object returned. The following table describes the specific meanings.

The returned object contains the following fields:

Parameter

Type

Description

resultMsg

String

The return value after the query fails.

success

Boolean

Indicates whether the request was successful. Valid values:

data.afterMd5

String

MD5 of APK/ABB after hardening.

data.afterSize

Long

The size of the APK/ABB after hardening.

data.id

Long

The ID of the hardening task, which is used for polling calls later.

data.label

String

The label field of the APK/ABB.

data.progress

Integer

Progress of reinforcement, range 0 - 100.

data.status

Integer

The status of the reinforcement task: 0 Not started, 1 Submitted, 2 Reinforcing, 3 Reinforcement succeeded, 4 Reinforcement failed.

data.taskType

String

The type of the reinforcement task.

data.enhancedClasses

String[]

The class selected by Java2C.

Query the progress of a reinforcement task

Request- GetUserAppEnhanceProcessInMsaRequest

Parameter

Type

Description

appId

String

The app to which the instance belongs.

workspaceId

String

The workspace to which the instance belongs.

tenantId

String

The tenant to which the instance belongs.

id

Long

The ID of the reinforcement 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 values

Return value name

Parameter

Description

requestId

String

The ID that identifies the request.

resultCode

String

Normally, the code returned by the request is OK. If other conditions exist, the API request is abnormal.

resultContent

Object

The specific object returned. The following table describes the specific meanings.

The returned object contains the following fields:

Parameter

Type

Description

resultMsg

String

The return value after the query fails.

success

Boolean

Indicates whether the request was successful. Valid values:

data.afterMd5

String

MD5 of APK/ABB after hardening.

data.afterSize

Long

The size of the APK/ABB after hardening.

data.id

Long

The ID of the hardening task, which is used for polling calls later.

data.label

String

The label field of the APK/ABB.

data.progress

Integer

Progress of reinforcement, range 0 - 100.

data.status

Integer

The status of the reinforcement task: 0 Not started, 1 Submitted, 2 Reinforcing, 3 Reinforcement succeeded, 4 Reinforcement failed.

data.taskType

String

The type of the reinforcement task.

data.enhancedClasses

String[]

The class selected by Java2C.

Query the download link of the product after reinforcement

Request- GetUserAppDownloadUrlInMsaRequest

Parameter

Type

Description

appId

String

The app to which the instance belongs.

workspaceId

String

The workspace to which the instance belongs.

tenantId

String

The tenant to which the instance belongs.

taskId

String

The ID of the reinforcement task.

Return Value- GetUserAppDownloadUrlInMsaResponse

{
    "resultContent":{
        "data": { "url": "https://xxxx"},
        "resultMsg":"",
        "success":false
    },
    "requestId":"8F76783A-8070-4182-895D-14E5D66F8BA3",
    "resultCode":"OK"
}

Return values

Return value name

Parameter

Description

requestId

String

The ID that identifies the request.

resultCode

String

Normally, the code returned by the request is OK. If other conditions exist, the API request is abnormal.

checkRsaKeyResult

Object

The specific object returned. The following table describes the specific meanings.

The returned object contains the following fields:

Parameter

Type

Description

data.url

String

APK/ABB download link.

data.filename

String

APK/ABB file name.

resultMsg

String

The return value after the query fails.

success

Boolean

Indicates whether the request was successful. Valid values:

Query reinforcement logs

Request- GetLogUrlInMsaRequest

Parameter

Type

Description

appId

String

The app to which the instance belongs.

workspaceId

String

The workspace to which the instance belongs.

tenantId

String

The tenant to which the instance belongs.

taskId

String

The ID of the reinforcement task.

Return Value- GetLogUrlInMsaResponse

{
    "resultContent":{
        "data": { "url": "https://xxxx"},
        "resultMsg":"",
        "success":false
    },
    "requestId":"8F76783A-8070-4182-895D-14E5D66F8BA3",
    "resultCode":"OK"
}

Return values

Return value name

Parameter

Description

requestId

String

The ID that identifies the request.

resultCode

String

Normally, the code returned by the request is OK. If other conditions exist, the API request is abnormal.

resultContent

Object

The specific object returned. The following table describes the specific meanings.

The returned object contains the following fields:

Parameter

Type

Description

data

String

The log download link.

resultMsg

String

The return value after the query fails.

success

Boolean

Indicates whether the request was successful. Valid values: