All Products
Search
Document Center

Mobile Platform as a Service:MDS FAQs

Last Updated:Jul 19, 2023

iOS client

Hotpatch error codes

The following table shows error codes and their meanings.

Error code Description
300 Unknown error
301 Local patch file is empty. Please check if the patch file was successfully downloaded, or if the file path is correct during local testing.
302 .js file parsing error. Please check if the .js file converted from OC is correct.
303 Local patch file is empty. Please check if the patch file was successfully downloaded, or if the file path is correct during local testing.
304 Decryption of the patch file failed. Please check if the Wireless Security Guard signature verification image yw_1222.jpg is correct.
305 Decompression of the patch file failed. Please try again.
306 MD5 checksum verification of the patch file failed. Please confirm if the released patch file is encrypted and in .js format.

Why doesn’t the patch take effect when I test the .js file converted from OC locally?

Check the error message returned by the invoked method shown in the following code. If it is not nil, troubleshoot according to the error codes shown in the preceding section.

NSString *jsFile = [[NSBundle mainBundle] pathForResource:@"Test" ofType:@"js"];
    NSError *errorJS = [MPDynamicInterface runWithResultDynamicLocalFile:jsFile];

If you found no error in the previous step, check if the syntax of the .js file is correct. You may refer to OC-to-JS conversion syntax.

Why doesn’t the patch take effect when I test the encrypted .zip file locally?

  1. Check if the RSA asymmetric encryption information in the project is correct. You can find it out by checking if value of ret in the following figure is 0.

    eee
  2. Ensure the Wireless Security Guard image in the project is correct and match meta.config in the project. If you cannot be sure, you may try generating the Wireless Security Guard image again and updating the .zip file of the hotpatch.

  3. Ensure what you are testing is the encrypted .zip file.

    zip
  4. Check the error message returned by the invoked method shown in the following code. If it is not nil, troubleshoot according to the error codes shown in the preceding section.

    NSString *jsZip = [[NSBundle mainBundle] pathForResource:@"Test" ofType:@"zip"];
     NSError *error = [MPDynamicInterface runWithResultDynamicLocalSecFile:jsZip];

Why doesn’t the patch take effect on the client after the release platform delivers the encrypted .js file?

  1. Check if the .zip file fixes the problem locally after the original .js file is encrypted.
  2. When creating a new patch task on the console, ensure the patch package uploaded to the release platform contains an encrypted .js file.

    resource package
  3. The target version must be the same as value of the property Product Version shown in file info.plist in the project.

    Version
  4. In the Xcode console, check if the result returned from gateway for alipay.client.getUnionResource is 1000 to ensure successful network request.

    qqq If the result returned from gateway is not 1000, continue to troubleshoot based on Mobile gateway > Client Programming > FAQ.

  5. After the network request has succeeded, check if the patch package has been delivered to the client in the local sandbox path. If both .zip and .sig files have been generated in the directory, it means that the client has received the script delivered from the release platform. The patch will take effect after you kill the process and restart the application.

    path

Android client

After hotpatch was applied, an invocation related to RPC caused a crash related to Apache HTTP.

Use the method given on Android official website to add Apache HTTP client. Never add the HTTP client by importing jar packages or using Gradle implementation/compilation. Otherwise, it may cause ClassLoader confusion.

Whitelist hotpatch for internal classes

To reference an internal class, you must use its fully qualified name. If you must fix an internal class, the easiest way is to decompile the class to smali, and the file name of smali is the class name of the internal class.

RPC request

If an error occurs when sending RPC request, refer to Security guard result codes for troubleshooting.