Real-time Publishing FAQ

更新时间:
复制 MD 格式

iOS client

Hotpatching error codes

The following table describes the error codes.

Error code

Description

300

Unknown error

301

The local patch file is empty. Check if the patch file was downloaded successfully or if the file path is correct during local testing.

302

.js file parsing error. Check if the .js file converted from Objective-C is correct.

303

The local patch file is empty. Check if the patch file was downloaded successfully or if the file path is correct during local testing.

304

Patch file decryption failed. Check if the Security Guard signature verification image yw_1222.jpg is correct.

305

Patch file decompression failed. Retry the operation.

306

Patch file MD5 check failed. Confirm that the published patch file is in the encrypted .js format.

Why does the patch not take effect when I locally test the .js file converted from Objective-C?

Check the error message returned by the method call in the following code. If the message is not nil, use the error codes above to troubleshoot the issue.

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

If no error is reported in the previous step, check if the .js file syntax is correct. For more information, see Objective-C to JS syntax.

Why does the patch not take effect when I locally test the encrypted .zip file?

  1. Check if the RSA asymmetric key encryption information in the project is correct. You can verify this by checking if the value of `ret` is 0, as shown in the following image.

    eee

  2. Ensure that the Security Guard image in the project is correct and matches the meta.config file in the project. If you are unsure, regenerate the Security Guard image and update the hotpatching .zip file.

  3. Ensure that you are testing the encrypted .zip file.

    zip

  4. Check the error message returned by the method call in the following code. If the message is not nil, use the error codes above to troubleshoot the issue.

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

After I deliver the encrypted .js file from the publishing platform, why does the patch not take effect on the client?

  1. After encrypting the original .js file, locally verify that the patch in the .zip file takes effect.

  2. When you upload a new patch task in the console, ensure that the patch package uploaded to the publishing platform is the encrypted .js file.

    资源包

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

    Version

  4. In the Xcode console, check if the gateway returns 1000 for alipay.client.getUnionResource to ensure that the network request is successful. If the gateway does not return 1000, troubleshoot the issue. For more information, see Mobile Gateway > Client-side programming > FAQ. qqq

  5. After the network request is successful, check the local sandbox path to see if the patch package has been delivered. If .zip and .sig files are generated in the directory, the client has received the script from the publishing platform. The patch will take effect after you restart the application.

    path

Android client

RPC-related calls cause an Apache HTTP-related crash after hotpatching.

Import the Apache HTTP client using the method described on the official Android website. Do not import the HTTP client by importing a JAR package or using `gradle implementation/compile`. Otherwise, this may disrupt the class loading order.

Hotpatching for whitelisted inner classes

References to inner classes require fully qualified names. If you must patch an inner class, the easiest way is to decompile it into smali. The smali filename is the name of the inner class.

RPC call issues

If an exception occurs when you call a resource through an RPC request, troubleshoot the issue. For more information, see Security Guard result code descriptions.