1. Mainstream hot repair is QQ, and Ali Hundred Chuan
2. I recommend the use of Ali hundred Sichuan Reason first: The team in the nail has a special customer service two, for the novice is very convenient
3. Operation procedure: Ali hundred Chuan's API documentation very detailed I only say some pits:
1 "The following initialization can only be placed in oncreat () in other files does not work
private void Inithotfix () {
String appversion;
try {
appversion = This.getpackagemanager (). Getpackageinfo (This.getpackagename (), 0). Versionname;
} catch (Exception e) {
appversion = "1.0.0";
}
Initialize best placed in front of Attachbasecontext, initialize directly inside the application class, do not encapsulate to other classes
Sophixmanager.getinstance (). SetContext (This)
. Setappversion (appversion)
. Setaeskey (NULL)
. Setsecretmetadata (APPID, Appsecret, Rsasecret)
. Setenabledebug (True)
. Setpatchloadstatusstub (New Patchloadstatuslistener () {
@Override
public void onLoad (final int mode, final int code, final String info, final int handlepatchversion) {
String msg = new StringBuilder (""). Append ("mode:"). Append (Mode)
. Append ("code:"). Append (Code)
. Append ("info:"). Append (Info)
. Append ("Handlepatchversion:"). Append (handlepatchversion). toString ();
LOG.D (TAG, "oncreate://... "+ msg.tostring ());
if (Msgdisplaylistener! = null) {
Msgdisplaylistener.handle (msg);
} else {
Cachemsg.append ("\ n"). Append (msg);
}
Code parameter
Patch Load Callback Notification
if (code = = patchstatus.code_load_success) {
Indicates a successful patch load
} else if (code = = Patchstatus.code_load_relaunch) {
Indicates that a restart is required for the new patch to take effect. The developer can prompt the user or the forced restart;
Recommendation: Users can listen to the background events, and then call killprocesssafely suicide, in order to speed up the application of patches, see 1.3.2.3
} else {
Other error messages, see Patchstatus class description
}
}
}). Initialize ();
/
Sophixmanager.getinstance (). Queryandloadnewpatch ();
}
2. Use the patch tool to package Mr. into a jar package to regenerate into a log log or log to empty,
3. Test for patching if prompt for Package name error Check Step 1
Summary of Android hot fixes (mainly Ali-chuan)