V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
moodasmood
V2EX  ›  Android

不想加班了,求救!

  •  
  •   moodasmood · May 14, 2019 · 11696 views
    This topic created in 2546 days ago, the information mentioned may be changed or developed.
    String commend = "screencap";
    Process p = Runtime.getRuntime().exec("su");
    DataOutputStream dos = new DataOutputStream(p.getOutputStream());
    DataInputStream dis = new DataInputStream(p.getInputStream());
    dos.writeBytes(commend + "\n");
    dos.flush();
    dos.writeBytes("exit\n");
    dos.flush();
    //I/System.out: ������������������ÿÿÿ
    System.out.println(dis.readLine());
    byte[] b=new byte[1000000];
    //b is empty
    dis.read(b);
    p.waitFor();
    

    安卓大佬有木有,顺手帮我解决这个问题,我就下班走人了。。这段代码 readLine 能拿到返回,但是却拿不到二进制数据,咋破?这个返回应该是当前屏幕的截屏数据。已经给 root 权限了

    xieguanglei
        1
    xieguanglei  
       May 14, 2019   ❤️ 1
    stack-ov2ex ……
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1090 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 23:55 · PVG 07:55 · LAX 16:55 · JFK 19:55
    ♥ Do have faith in what you're doing.