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 |
|
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 |
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 |
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?
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.
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.Ensure what you are testing is the encrypted
.zip
file.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?
Check if the
.zip
file fixes the problem locally after the original.js
file is encrypted.When creating a new patch task on the console, ensure the patch package uploaded to the release platform contains an encrypted
.js
file.The target version must be the same as value of the property
Product Version
shown in fileinfo.plist
in the project.In the Xcode console, check if the result returned from gateway for
alipay.client.getUnionResource
is 1000 to ensure successful network request.If the result returned from gateway is not 1000, continue to troubleshoot based on Mobile gateway > Client Programming > FAQ.
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.
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.