Guía de operación Java WeChat Jump, señalando donde sea que elija.
The idea in this article is to control the operation of the mobile phone through adb, write a jframe to cover the mobile phone screen through java, use the mouse to obtain the starting point and end point of the jump, and obtain the relationship (linear relationship) between the distance of the jump and the pressing time (linear relationship), and then use adb to operate the pressing time according to the calculated results (a third-party tool is also needed here to transmit the screen to the computer in real time y sobrescribe el jframe en la pantalla en la computadora).
El código es muy corto, como sigue:
salto de paquete; import java.awt.flowlayout; import java.awt.event.mouseadapter; import java.awt.event.mouseevent; import javax.swing.jframe; import javax.swing.jlabel; @supresswarnings ("serial") Jumpjump de clase pública extiende jfriends {private jlabel etiqueta; bandera booleana = falso; int x0, y0, x1, y1; public JumpJump () {super ("WeChat Jump"); // Crea una nueva ventana this.setUndeCorated (verdadero); this.SetOpacity (0.7f); this.setsize (320,580); // establecer this.setVisible (true); // visible // this.dispose (); this.setLocationRelativeto (nulo); this.tofront (); this.setLayout (nuevo FlowLayout (FlowLayout.Center)); this.setDefaultCloseOperation (jframe.exit_on_close); Jlabel etiqueta = new JLabel ("clic derecho"); this.add (etiqueta); this.AddMousElistener (new Mouseadapter () {public void MouseClicked (MouseEvent E) {if (e.getButton () == MouseEvent.Button3) {// 3 representa a la derecha if (! flag) {x0 = e.getx (); y0 = e.getyy (); string banner = "The Coordates of the Coordates of the Current de The Current The TheMouse Are" The Mouse "son" + el "Mouse" + The Current's "son" + el "mouse" + el "Mouse" + The Current's "son" + el "mouse" + el "MOUSE" SON "SON" SON "SOUNTER DEL CONTRADO DE LA CONTRADA DE LA CONTRADA DEL CURTIO DE LA CURRIEN + "," y0; Labor.settext (Math.Ceil (DIS)*4.8+""); (Excepción e1) {e1.printStackTrace (); } public static void main (string [] args) {new JumpJump (); }}El siguiente código establece transparencia:
this.setUndeCorated (verdadero); this.SetOpacity (0.7f);
X0 y0 es la coordenada del punto en que el mouse hace clic por primera vez, y X1 y1 es la segunda coordenada. Se determina por Flag, ya sea el primer o segundo clic.
Este párrafo es un código para controlar las operaciones CMD, por lo que no tiene que escribirlo en CMD cada vez:
String cmd = "ADB Shell Input Touchsen Swipe 170 187 170 187"+Math.round (dis*4.6); Runtime run = runtime.getRuntime (); intente {proceso pr = run.exec (cmd); System.out.println (CMD); pr.waitfor (); } catch (excepción e1) {e1.printstackTrace (); System.out.println (E1); }Los coeficientes aquí deben ajustarse por sí mismos a través de pruebas continuas, es decir, el último coeficiente 4.6 se puede ajustar por sí mismo:
String cmd = "ADB Shell Input Touchsen Swipe 170 187 170 187"+Math.round (dis*4.6);
El método de operación es muy simple. Haga clic derecho en la posición actual de la pieza de ajedrez una vez, y luego haga clic con el botón derecho en la posición de aterrizaje nuevamente.
Para obtener más contenido, puede consultar el tema especial "Jump on WeChat" para aprender.
Lo anterior es todo el contenido de este artículo. Espero que sea útil para el aprendizaje de todos y espero que todos apoyen más a Wulin.com.