These days idle nothing, just looked under the fire of the heat repair, indeed has a hot fix on the Android native a very embarrassing problem, before the h5,android in the user experience is an advantage, but too complex version update, so that users annoying (this deep experience ah, Before the project in addition to a bug on the release of an update, or force update, I if the customer I am the dog), well, no more said, we have to start the bus ready to go
This is Tinker's Wiki:https://github.com/tencent/tinker/wiki (there is nothing to understand is inside WikiWiki).
This is Tinker's Demo:https://github.com/tencent/tinker.
Integrated tinker very easy to follow the old wet steps of the departure (if there is a rollover please forgive me)
1. Download the official demo of Tinker from Git and we'll start with the demo from his tinker-sample-android.
2. Import it into as, the general direct import comes in is unable to run, he will error, what is wrong, what is Tinkerid, from the above wiki can see the meaning of these parameters, If the build.gradle inside those configuration parameters can be found in the above wiki, this tinkerid my understanding is to encrypt and decrypt the same matching relationship, verify the benchmark APK package is not the same as the patch package Tinkerid
3. This tinkerid can use git version number, also can use Versionname to define, this demo inside he uses his git version number, so directly to come we run must have a problem, We need to manually modify this (if you have git, you can use Git version to define it, if you want to use the same as Versionname), if you modify the Build.gradle inside the Def gitsha () method I use GIT version number
4. We're almost ready to start the real run. We can begin by running the Gradle inside the assembledebug to generate an apk file, we'll install the APK on the phone as a release apk, which is the end of the installation.
5 Now this project suddenly appeared problem, I want to modify him to add a button how to do it, do not have to send version, too scary a little thing to release the version, the customer also use an egg, good use of tinker will not have to worry about this problem we have to start the whole bar.
Will we just
I have compiled many times here, in general you should only have one,. The name of the APK and the name of the. txt file are copied down into the build.gradle to replace the path of Tinkeroldapkpath and Tinkerapplyresourcepath powertrain you want to copy, so that you specify the package to be replaced by the hot update.
After the completion of this step is basically nothing to change, is a few operational problems, basically hard not to pour all the old drivers, come to our next departure (there is no way to this step of the driver has commented on the review I give you push 2).
6, old apk things are finished, now to engage in the apk that we want to fix, now I want to add a button in just that interface, and so on to see the card miracle is to witness this brush out the Update button.
7. The interface also changed almost to see the effect, look at the effect before we have 2 steps to slow down, first we have to take our newly changed interface Gradle inside the execution of the next Tinkerpatchdebug
Put this pathc_signed_7zip.apk patch into our memory card root directory, you can directly put this apk into our root directory, you can also perform ADB push./app/build/outputs/tinkerpatch/debug /patch_signed_7zip.apk/storage/sdcard0/command to put our patch pack into the SD card root directory.
End: The next step is to witness the miracle by clicking on the app that we started to install before the fix
Click Load patch to load our patch pack (in general, we send the patch to the backstage buddies, then let the backstage buddies send us to download it using the patch pack), and if there is a toast pop-up patch success, please restart process, That means the patch pack has been loaded successfully, so you can click Kill self or turn off the screen to see a miracle.
Android Step-by-step teach you integrated Tinker (hot fix)