Alibaba middle Taiwan department is in urgent need of Java technology experts at P7 level. If you are interested, please send your resume to [email protected] or send me a letter.
You are welcome to post your current center hit rate in the comments section.
If you are familiar with Android barrier-free services and have the time and energy to implement a plug-in based on Android barrier-free services, you do not need to connect ADB to your computer.
I didn’t expect to have so much knowledge about how I imported projects. The main problems are:
- How do I import projects?
- Why not upload wechat_jump_hack.iml?
Click here for a detailed tutorial
Program control SIMS automatically jump, almost every time hit the center point.
To better illustrate how it works, I’ll post a video I just recorded. V.youku.com/v_show/id_X…
If it doesn’t look like this video, be sure to read the “tips” section carefully.
Attach GitHub address: github.com/burningcl/w… Welcome to share your ideas with me. Cracking process, a total of 3 hours, constantly adjust the algorithm and parameters, so the code is messy, please forgive me.
2018/01/04 optimization
According to the feedback of my classmates, I spent 20 minutes during my lunch break today to optimize the algorithm.
-
Improve bottle recognition rate.
Because the color of bottle is similar, a new algorithm is implemented for bottle cap recognition. The effect is as follows:
-
Improve the calculation of the next step when a special box appears.
Special box, such as phonograph, its dynamic effect time is very long, and very large, to the next recognition of interference. Therefore, the algorithm is improved to reduce the influence of interference. The effect is as follows:
-
The hacktest.java file has been added. After everyone is running Hack. Java, wechat_jump_hack in/out/production/wechat_jump_hack/imgs/input/deposit screenshots file directory. After running Hack. Java, then run HackTest. Java, wechat_jump_hack in/out/production/wechat_jump_hack/imgs/screenshot of the output/input is generated in a directory location markers.
- Red dots represent player positions;
- The green dot represents the boundary point of the next box;
- The blue dot is the center of the next box;
If you feel like you’re not doing it right, run the hacktest. Java file to see if the mark position is correct. If accurate, adjust the bounce factor yourself. It is not possible for me to use the bounce coefficient for all devices.
-
Add statistics for hit centers
screenshot, file: /Users/chenliang/SkylineProjects/wechat_jump_hack_1/out/production/wechat_jump_hack_1/imgs/input/1092.png 438, 364 pos, x: 404, y: 1104 find myPos, succ, (404, 1104) 191, 217, 194 232, 258, 266 top, x: 732, y: 803 true left, x: 599, y: 880 right, x: 868, y: 880 whitePoint: 752, 715, 887, 866 find whitePoint, succ, (733, 876), centerHit: 901, total: 1093 find nextCenter, succ, (733, 876) distance: 554 /Users/chenliang/Library/Android/sdk/platform-tools/adb shell input swipe 400 400 400 400 554 Copy the code
According to my results, the probability of hitting the center point is about 82 to 85 percent. Because wechat is also improving, the difficulty of hitting the center point is also increasing
-
The final grade cannot be submitted
1. Effect display
Two. Implementation principle
Specific identification of the algorithm, I now do not have time to summarize (later have time I can go to summarize), we can first look at the source code. Part of the source parameters are in the author’s mobile phone debugging (resolution 1080), you can according to their own mobile phone, modify accordingly.
The main steps
-
Identify player position
As shown in the white hollow squares below:
-
Identify the location of the target square
Identify the uppermost vertex, the leftmost point, and the rightmost point, as shown in the red solid square below, to calculate the center point:
-
Identify the location of the center dot of the target square
If you hit the center point the previous time, there will be an indication of the next center point (a white dot).
process
- Screenshots via ADB;
- Save screenshots to your computer via ADB;
- Identify player position;
- Identify target square position;
- Identify the location of the target square center dot;
- If step 5 is successful, take the center point of step 5 as the position of the next step; Otherwise, take the center point of step 4 as the position of the next step;
- Calculate the player’s position and the next position, multiply by a certain coefficient, get the long press time;
- With ADB, trigger long press;
Three. Operating conditions
- Prepare Java runtime and compilation environment, using Java8 or above, IDE recommended using Intellij;
- Install the Android SDK.
- Clone project with git tool at github.com/burningcl/w… ;
- Use the IDE (I used Intellij) to import the project;
- Get an Android phone ready with developer mode on;
- Please confirm that ADB is connected to your mobile phone. PNG (No such file or directory) file cannot be found. If the ADB connection fails, the system displays “find myPos, fail”. If you’re connected to multiple Android devices, it’s best to switch to just one;
- Open the developer option, find the switch that says “USB Debug (security Settings) allows USB debug to change permissions or simulate clicks” (this is true on muI, and should be true on other phones as well), and turn it on; If this permission is not granted, the bounce cannot be triggered normally;
- Modify the com. Skyline. Wxjumphack. ADB_PATH Hack, it changed to your own, the ADB’s position;
- Open wechat, open jump jump game, and click Start;
- Run the main method in hack.java and watch it jump automatically.
Four. Warm tips
- Some students reported that the program failed to find the file or “find myPos, fail”. Please confirm that ADB is connected to your mobile phone. If the ADB connection fails, the screenshot and pull screenshot will fail.
- Some students reported that the position has been calculated, but there is no trigger bounce. Open developer options, find the switch that says “USB Debug (security Settings) allows USB debug to change permissions or simulate clicks” (this is true on muI, and should be true on other phones as well), and turn it on.
- This small game, Tencent seems to have added some interference effect later, will interfere with location calculation. Later can be optimized.
- Because it only took me three hours to crack it, and most of that time was spent optimizing the recognition algorithm. In the code, there are a lot of magic values and stuff, and the code is messy. If you want to read it, please forgive me.
- For location calculations, run the main methods in myPosFinder. Java and nextCenterFinder. Java and observe the generated file to see if the location of the markers is correct.