Diag mode in Sony Xperia M4 - General Questions and Answers

I work hard to turn on diag mode in Sony Xperia M4 to connect it to QPST or CDMA. I tried many things I've found on the Internet, but still it isn't working. Windows should see new COM Port in Device Manager, but nothing appears, just phone and adb driver. I don't know if I should try harder if there is something that can be done or I'm just wasting my time because diag mode is locked and nothing can be done. Phone is rooted. tried:
https://forum.xda-developers.com/cr...ad-progress-please-leave-im-updating-t2871269
*#*#8778#*#*
adb shell su setprop persist.usb.eng 1
setprop sys.usb.config diag,adb
setprop sys.usb.config rndis, diag
setprop usb.rndis.enable 1
setprop sys.usb.config acm,diag,mtp,adb
echo diag > /sys/class/android_usb/android0/f_diag/clients
echo diag,adb,serial > /sys/class/android_usb/android0/functions
##3424#
*#*#717717#*#*
**#0808#
Nothing worked to make com port appear. One thing is interesting that after setprop persist.usb.eng 1 and debugging on - even phone and adb is not visible to windows.

Related

[Q] Trying to establish adb connection

Hi all.
I'm attempting to root my phone via ZergRush's one click root. However I am on linux and i do not have a usb cable.
I downloaded the android-sdk for linux and have set up ftp/ssh on my Zte score. The problem is whenever I try to adb connect 10.10.0.25 adb does not connect with the device. I can ping my phone from my computer so it's reachable. If I try adb connect 10.10.0.25:2121 (FTP PORT) or 2222 (SSH PORT) it connect but outputs: "Device offline" and I can't run any successful commands.
I heard ssh tunneling is possible and would like to know if anybody knew the exact steps. I've tried:
# ssh [email protected] -p 2222 -R 5555:localhost:5037
and
# ssh -NR 5555:localhost:5037 [email protected] -p 2222
The latter connects through ssh but adb doesn't connect through the tunnel. The former outputs "Connection closed by remote host"
I checked the open ports on my phone and noticed 5555 isn't open so that means i must open it with setprop service.adb.tcp.port 5555 which I tried but still doesn't work. The command does go through though.
Appearantly, setprop didn't work as getprop service.adb.tcp.port 5555 outputs nothing.
Is there any way I can enable adbd to listen on my phone? I got a ssh and ftp shell up and running w/o root.
/mnt/sdcard $ getprop | grep adb
[persist.service.adb.enable]: [1]
[persist.radio.adb_log_on]: [0]
[persist.adb.trace_mask]: [1]
[init.svc.adbd]: [running]
It doesn't show service.adb.tcp.port so I can't set it. Is there a way for me to create this key? Help will be much appreciated! =)
EDIT:
Is there a way for me to chmod without root or adb? I tried chmod 777 exploit but it outputs permission denied. I'm going to see if I can change permissions some other way.
Anyone?
No luck googling for an answer.
Should I just wait and get a data usb cable?

How to stop and start android to get access to frame-buffer

You most likely need root access for this, and it's best to make two scripts.
This also needs to be done via ADB or some kind of script launcher that does not depend on Android to be running.
The idea for these is to allow full unencumbered access to the tablet/phone frame-buffer, so that you can do things like run Xorg directly on the hardware.
I have tested this on ALL my rooted devices via ADB, and it works!
PLEASE NOTE!
The second script will RESTART android even if it is running! Use with care!
I didn't take the time to write the code to check the property to see if android is already running!
Code:
file: /system/xbin/stopandroid
#!/system/bin/sh
setprop ctl.stop media
setprop ctl.stop zygote
sleep 1
setprop ctl.stop bootanim
sleep 1
setprop ctl.stop media
setprop ctl.stop zygote
sleep 1
setprop ctl.stop bootanim
exit 0
file: /system/xbin/restartandroid
#! /system/bin/sh
setprop ctl.stop media
setprop ctl.stop zygote
setprop ctl.stop bootanim
setprop ctl.start bootanim
setprop ctl.start zygote
setprop ctl.start media
exit 0
THANK YOU!!!
But seriously, thank you. I have been working on a project and it has been a pain to do because I have not found an appropriate way to shutdown the android user interface. Thank you
I know this is an old thread but just in case someone find it usefull I drop this here: There are already two built-in commands for starting/stopping Zygote and all it's relatives:
Code:
stop
To restart all again
Code:
start
It's that easy
Besides being more simple, the only difference I see compared with your method is your method keeps surfaceflinger service running and the simpler method keeps mediaserver service running. But both can be handled by "setprop ctl.*" to suit your needs.
I hope it helps

[Q] 4.3 update (touchwiz) - no codes work anymore - how do I QPST now?

original firmware had a number of hidden codes that you put into dialer and it does stuff. None of them work anymore. Particularly the ones I care about are:
*#22745927 to enable hidden menu.
*#7284# to switch the UART and USB from PDA to MODEM (so that I could program PRL with QPST)
*#0*# hardware test
Are there alternatives?..
No.
Sent from my Last Ever Samsung Device.
0331 said:
No.
Sent from my Last Ever Samsung Device.
Click to expand...
Click to collapse
On the older firmwares there was an IOTHiddenMenu activity which you could invoke using
Code:
am start com.android.hiddenmenu/com.android.hiddenmenu.IOTHiddenMenu
command, but that doesn't work on 4.3
I know in AOSP there was a notion to turn into QPST mode by writing to kernel pseudo-files...
Engineers got to somehow be able to reprogram these phones, there's no way Samsung disabled this completely
I dug out some old scripts for AOSP, which seem to work. Device was accessible in QPST-programmable mode after them:
Code:
#/system/bin/sh
# sets DIAG mode
echo 0 > /sys/class/android_usb/android0/enable
echo 04E8 > /sys/class/android_usb/android0/idVendor
echo 6860 > /sys/class/android_usb/android0/idProduct
echo diag > /sys/class/android_usb/android0/f_diag/clients
echo 1 > /sys/class/android_usb/android0/f_acm/instances
echo diag,acm,adb > /sys/class/android_usb/android0/functions
cat /sys/class/android_usb/android0/functions
echo 1 > /sys/class/android_usb/android0/enable
start adbd
setprop sys.usb.state sys.usb.config
and to go back to MTP:
Code:
#/system/bin/sh
# sets default USB mode
echo 0 > /sys/class/android_usb/android0/enable
echo 04E8 > /sys/class/android_usb/android0/idVendor
echo 6860 > /sys/class/android_usb/android0/idProduct
echo 1 > /sys/class/android_usb/android0/f_acm/instances
echo mtp,acm,adb > /sys/class/android_usb/android0/functions
echo 1 > /sys/class/android_usb/android0/enable
start adbd
setprop sys.usb.state sys.usb.config

Open diag failed

I it possible to enter the diag mode of the Pocophone without rooting?
*#*#717717#*#* shows a toast notification: "open diag failed".
coolboy744 said:
I it possible to enter the diag mode of the Pocophone without rooting?
*#*#717717#*#* shows a toast notification: "open diag failed".
Click to expand...
Click to collapse
Are you talking about CIT mode (engineering mode in Android)? If so: https://c.mi.com/thread-2188758-1-0.html
coolboy744 said:
I it possible to enter the diag mode of the Pocophone without rooting?
*#*#717717#*#* shows a toast notification: "open diag failed".
Click to expand...
Click to collapse
No. As of MIUI 10, Qualcomm HS-USB Diag 901D was blocked through that method and won't work without root access for obvious security reasons. use the Terminal or adb method with the command:
Code:
setprop sys.usb.config diag,adb
To disable it, use command:
Code:
setprop sys.usb.config mtp,adb
Alin45 said:
Are you talking about CIT mode (engineering mode in Android)? If so: https://c.mi.com/thread-2188758-1-0.html
Click to expand...
Click to collapse
No i am talking about How to Qualcomm Diagnostic Mode (Diag Port)
Slim K said:
No. As of MIUI 10, Qualcomm HS-USB Diag 901D was blocked through that method and won't work without root access for obvious security reasons. use the Terminal or adb method with the command:
Code:
setprop sys.usb.config diag,adb
To disable it, use command:
Code:
setprop sys.usb.config mtp,adb
Click to expand...
Click to collapse
so there is no option without root. thanks for reply.
>adb shell
sweet:/ $ setprop sys.usb.config diag,adb
Failed to set property 'sys.usb.config' to 'diag,adb'.
See dmesg for error reason.
For poco you need to enter two commands:
adb shell
su
setprop persist.vendor.usb.config diag,diag_mdm,qdss,qdss_mdm,serial_cdev,dpl,rmnet,adb
setprop sys.usb.config diag,diag_mdm,qdss,qdss_mdm,serial_cdev,dpl,rmnet,adb

Set MTP as default for USB on Android 7.1.2 / LineageOS 14.1 on SM-T280

Hey,
I'm running LineageOS 14.1 (Android 7.1.2) on an SM-T280. It's also rooted.
Whenever I reboot and connect USB, it only enables adb and charges. I want it to enable adb and mtp by default.
I know about the setting in the developer options, but this also is not persistent.
How do I enable MTP by default?
In Android's system file build.prop add MTP as default USB-mode
Code:
persist.sys.usb.config=mtp,adb
xXx yYy said:
In Android's system file build.prop add MTP as default USB-mode
Code:
persist.sys.usb.config=mtp,adb
Click to expand...
Click to collapse
Tried, does not work. When I reboot I get this:
Code:
gtexswifi:/ # cat /system/build.prop | grep usb
persist.sys.usb.config=mtp,adb
sys.usb.gser.count=8
sys.usb.config=mtp,adb
persist.sys.usb.config=mtp,adb
sys.usb.configfs=1
gtexswifi:/ # getprop | grep usb
[persist.sys.usb.config]: [adb]
[sys.usb.config]: [adb]
[sys.usb.configfs]: [0]
[sys.usb.ffs.ready]: [1]
[sys.usb.gser.count]: [8]
[sys.usb.state]: [adb]
gtexswifi:/ # ls /data/property/ | grep usb
persist.sys.usb.config
gtexswifi:/ # cat /data/property/persist.sys.usb.config
adb
Of course I also tried setprop persist.sys.usb.config "mtp,adb" which modifies /data/property/persist.sys.usb.config but this is reset on reboot.
I've found many websites that say it is simply not possible on Nougat :/
I also found https://forum.xda-developers.com/t/app-root-r-3-3-marshmallow-mtp-enabler.3263467/ but I don't want to install an app :/ I'm curious how it does it.
When I setprop sys.usb.config "mtp,adb" while the device is running, usb disconnects and reconnects, but there is still no MTP available.
Also tried
Bash:
echo 0 > /sys/class/android_usb/android0/enable
echo mtp,adb > /sys/class/android_usb/android0/functions
echo 1 > /sys/class/android_usb/android0/enable
The device disconnects and reconnects from USB but only with adb enabled and
Code:
gtexswifi:/ # cat /sys/class/android_usb/android0/functions
ffs
afterwards
Source: https://books.google.de/books?id=0cuQAwAAQBAJ&pg=PA64&lpg=PA64&dq="android_usb/android0/enable"+mtp
Okay, I wen't through the effort to recompile the kernel and patch the init ramdisks /default.prop with
Code:
persist.sys.usb.config=adb,mtp
sys.usb.config=adb,mtp
Didn't help...
Any other ideas?

Categories

Resources