openstf / stf

Control and manage Android devices from your browser.
https://openstf.io
Other
13.4k stars 2.8k forks source link

ZTE Max Pro 981, Android 6.0.1 (MetroPCS) #614

Open vbanthia-zz opened 7 years ago

vbanthia-zz commented 7 years ago

What is the issue or idea you have? Client requests to minicap, minitouch & STFService.apk servers are not reaching.

STF Logs

INF/device:resources:service 82034 [d7664f2c] Checking whether we need to install STFService
INF/device:resources:service 82034 [d7664f2c] Running version check
INF/device:resources:service 82034 [d7664f2c] STFService up to date
INF/device:plugins:service 82034 [d7664f2c] Launching agent
INF/device:plugins:service 82034 [d7664f2c] Agent says: "Listening on @stfagent"
INF/provider 81986 [*] Providing 1 of 2 device(s); waiting for "d7664f2c"
FTL/device 82034 [d7664f2c] Setup had an error TimeoutError: operation timed out
    at afterTimeout (/Users/vishal/Devel/vbanthia/stf/node_modules/adbkit/node_modules/bluebird/js/main/timers.js:11:15)
    at Timeout.timeoutTimeout (/Users/vishal/Devel/vbanthia/stf/node_modules/adbkit/node_modules/bluebird/js/main/timers.js:53:9)
    at ontimeout (timers.js:380:14)
    at tryOnTimeout (timers.js:244:5)
    at Timer.listOnTimeout (timers.js:214:5)
FTL/util:lifecycle 82034 [d7664f2c] Shutting down due to fatal error
INF/provider 81986 [*] Cleaning up device worker "d7664f2c"
ERR/provider 81986 [*] Device worker "d7664f2c" died with code 1
INF/provider 81986 [*] Restarting device worker "d7664f2c"

Debugging attemps

# In minicap
./run.sh autosize

# New shell
adb forward tcp:1313 localabstract:minicap

nc -v localhost 1313

Output for ZTE Max

nc: connectx to localhost port 1313 (tcp) failed: Connection refused
found 0 associations
found 1 connections:
     1: flags=82<CONNECTED,PREFERRED>
    outif lo0
    src 127.0.0.1 port 63139
    dst 127.0.0.1 port 1313
    rank info not available
    TCP aux info available

Connection to localhost port 1313 [tcp/bmc_patroldb] succeeded!

Minicap logs for ZTE Max

 adb shell LD_LIBRARY_PATH=/data/local/tmp/minicap-devel /data/local/tmp/minicap-devel/minicap -P 1080x1920@1080x1920/0
PID: 14777
INFO: Using projection 1080x1920@1080x1920/0
INFO: (external/MY_minicap/src/minicap_23.cpp:240) Creating SurfaceComposerClient
INFO: (external/MY_minicap/src/minicap_23.cpp:243) Performing SurfaceComposerClient init check
INFO: (external/MY_minicap/src/minicap_23.cpp:250) Creating virtual display
INFO: (external/MY_minicap/src/minicap_23.cpp:256) Creating buffer queue
INFO: (external/MY_minicap/src/minicap_23.cpp:261) Creating CPU consumer
INFO: (external/MY_minicap/src/minicap_23.cpp:265) Creating frame waiter
INFO: (external/MY_minicap/src/minicap_23.cpp:269) Publishing virtual display
INFO: (jni/minicap/JpgEncoder.cpp:64) Allocating 6268932 bytes for JPG encoder

Output for working device

nc: connectx to localhost port 1313 (tcp) failed: Connection refused
found 0 associations
found 1 connections:
     1: flags=82<CONNECTED,PREFERRED>
    outif lo0
    src 127.0.0.1 port 63150
    dst 127.0.0.1 port 1313
    rank info not available
    TCP aux info available

Connection to localhost port 1313 [tcp/bmc_patroldb] succeeded!
�
 8�8�|����JFIF��C

% , #&')*)-0-(0%()(��C

Minicap logs for working device

INFO: Using projection 1080x1920@1080x1920/0
INFO: (external/MY_minicap/src/minicap_22.cpp:247) Creating SurfaceComposerClient
INFO: (external/MY_minicap/src/minicap_22.cpp:250) Performing SurfaceComposerClient init check
INFO: (external/MY_minicap/src/minicap_22.cpp:257) Creating virtual display
INFO: (external/MY_minicap/src/minicap_22.cpp:263) Creating buffer queue
INFO: (external/MY_minicap/src/minicap_22.cpp:268) Creating CPU consumer
INFO: (external/MY_minicap/src/minicap_22.cpp:272) Creating frame waiter
INFO: (external/MY_minicap/src/minicap_22.cpp:276) Publishing virtual display
INFO: (jni/minicap/JpgEncoder.cpp:64) Allocating 6268932 bytes for JPG encoder

INFO: (jni/minicap/minicap.cpp:448) New client connection
INFO: (jni/minicap/minicap.cpp:516) Closing client connection

As can be seen in minicap logs, minicap is not receiving requests. It may be a firewall issue created by the carrier in order to control Tethering. Could not verify this since iptables access is not given to shell user.

I also tried adb reverse and this is working fine. I can access web app running on Mac OS from android browser using adb reverse port forwarding.

Does it only happen on a specific device? Please run adb devices -l and paste the corresponding row. Yes, device specific

List of devices attached
d7664f2c               device usb:339869696X product:P895T20_MPCS model:Z981 device:urd

Please run stf doctor and paste the output here.

INF/cli:doctor 80323 [*] OS Arch: x64
INF/cli:doctor 80323 [*] OS Platform: darwin
INF/cli:doctor 80323 [*] OS Platform: 16.4.0
INF/cli:doctor 80323 [*] Using Node 6.10.2
INF/cli:doctor 80323 [*] Using ZeroMQ 4.2.2
INF/cli:doctor 80323 [*] Using GraphicsMagick 1.3.25
INF/cli:doctor 80323 [*] Using ADB 1.0.39
INF/cli:doctor 80323 [*] Using ProtoBuf 3.2.0
INF/cli:doctor 80323 [*] Using RethinkDB 2.3.5
sorccu commented 7 years ago

So it's a MetroPCS phone. I strongly believe that this has the same issue as Alcatel Onetouch Pixi Glitz from Tracfone. The symptoms were the same. I managed to root the device and pull the adb binary from it at the time, and confirmed that it had been modified to not accept any socket connections using localabstract, tcp, jdwp or track-jdwp. Notably localfilesystem was not present, although mount permissions may have prevented those from working anyway - I did not check.

omertarikkoc commented 6 years ago

Any updates on this issue?

sorccu commented 6 years ago

MetroPCS phones are heavily customized. I’m not sure if it’s worth the effort. You could help us out, though, either by donating a device or investigating the issue and reporting your findings here.

omertarikkoc commented 6 years ago

How can I donate a device?

omertarikkoc commented 6 years ago

Also, what is the cheapest device that I can use with this software?

sorccu commented 6 years ago

Sorry for the late response. If you are interested in donating a device, you can email me at simo @ the name of this github org .io.

I've hooked up a ~$25 Chinese device into OpenSTF and it worked fine, though the device was obviously quite slow. Anything non-MetroPCS should work.