All Products
Search
Document Center

FAQ

Last Updated: Feb 04, 2021

iOS client

Hotpatch error codes

Solution: Find the error codes and their corresponding description in the following table.

Error codes Description
300 Unkown error
301 The local patch file is empty. Please check if the patch file is successfully downloaded, or check if the file path is correct in local testing.
302 .js file parsing error. Please check if the .js file converted from OC is correct.
303 The local patch file is empty. Please check if the patch file is successfully downloaded, or check if the file path for local testing is correct.
304 Failed to decrypt the patch file. Please check if the wireless guard signature verification figure yw_1222.jpg is correct.
305 Fialed to decrypt the patch file. Please try again.
306 The patch file failed to pass MD5 verification. Please check if the released patch file is an encrypted .js file.

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

Solution: Check the error message returned by the called method, as shown in the following figure. If it is not nil, troubleshoot according to the error codes mentioned above.

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

If there is no error in the previous step, check if the syntax of the .js file is correct, see OS-to-JS conversion syntax.

Why the patch doesn’t take effect when we test the encrypted .zip package locally?

Solution:

  1. Check if the RSA asymmetric encryption information in the project is correct. You can judge the correctness by checking if the ret value in the following figure is 0.

    eee

  2. Check if wireless security guard image in the project is correct and if it’s consistent with the meta.config file of the project. If you are not sure, try generating a new wireless security guard image, and updating the .zip file.
  3. Ensure that the tested .zip file has been encrypted.

    zip

  4. Check the error message returned by the called method, as shown in the following figure. If it is not nil, troubleshoot according to the error codes mentioned above.

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

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

Solution:

  1. Verify the .zip file locally to check if the patch takes effect after the original .js file is encrypted.
  2. When you upload new repair tasks on the console, ensure that the patch packages uploaded to the release platform are encrypted .js files.

  3. The target version must be consistent with the field Product Version in info.plist file of the project.

    Version

  4. In 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, see Mobile Gateway Service > Client programming > FAQ for further troubleshooting.

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

    path

Android client

Solution: Follow the method proposed on Android official website to introduce Apache HTTP client. It is forbidden to import HTTP client by importing Jar packages or Gradle implementation/compilation; otherwise, it may cause classloader confusion.

Whitelist hotpatch for internal classes

Fully qualified names are required for calling internal classes. To fix a 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.