Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,740,049 Members 39,842 Now Online
XDA Developers Android and Mobile Development Forum

[How-To][LS970] Enable DIAG mode without Service Code(MSL)

Tip us?
 
autoprime
Old
(Last edited by autoprime; 12th January 2014 at 12:16 AM.)
#1  
autoprime's Avatar
Recognized Contributor / Recognized Developer - OP
Thanks Meter 4403
Posts: 1,566
Join Date: Jun 2010

 
DONATE TO ME
Default [How-To][LS970] Enable DIAG mode without Service Code(MSL)

*NO PROMPT WHEN YOU HIT ##DIAG#? THIS INFO IS NOT FOR YOU (BUT STILL WORKS)*

*updated thread to add AOSP scripts*

On newer LS970's there is a MSL block on ##DIAG# mode. Normally you can hit ##DIAG# and flip the toggle. On recent phones you are given a "Service Code" prompt before we can toggle anything. Once DIAG mode is achieved we can connect the phone to a Windows computer to write a PRL or flash our phones to other carriers or read our MSL. See the tutorial here for how-to on that. The tutorial I have linked assumes your Optimus G does not have this MSL block... so replace step 2 with the information in this thread. That sums up this entire thread.. this thread is another way for step 2 in that tutorial.

You can get around this block with a simple command in terminal. (You must have root!) It may help to set "charge only" mode first and not MTP. Be sure to have the LG drivers installed before doing any of this.


su
echo 1 > /sys/devices/platform/lg_diag_cmd/diag_enable


If your phone was plugged into the computer already.. unplug it and plug it back in. You will now be in DIAG mode.
Your Windows Device Manager should look like this...





If you wanted to script this, I suggest script manager from the play store then using the widgets to add a shortcut to the homescreen. Open app, menu button > new script and write the script from below. Before launching the script.. be sure to toggle the SU button in the app, then hit save. And when making a shortcut you may have to try twice. You'll see what I mean when you get there. You do not have to unplug your phone if using the script. If it does not toggle diag for some reason, try running it again. I've never had to try more than twice.



STOCK ENABLE
Code:
Select Code
#!/system/bin/sh

echo 0 > /sys/class/android_usb/android0/enable
echo 1 > /sys/devices/platform/lg_diag_cmd/diag_enable
echo 1 > /sys/class/android_usb/android0/enable
STOCK DISABLE
Code:
Select Code
#!/system/bin/sh

echo 0 > /sys/class/android_usb/android0/enable
echo 0 > /sys/devices/platform/lg_diag_cmd/diag_enable
echo 1 > /sys/class/android_usb/android0/enable
AOSP ENABLE
Code:
Select Code
#!/system/bin/sh

stop adbd
echo 0 > /sys/class/android_usb/android0/enable
echo 1004 > /sys/class/android_usb/android0/idVendor
echo 631B > /sys/class/android_usb/android0/idProduct
echo 239 > /sys/class/android_usb/android0/bDeviceClass
echo 2 > /sys/class/android_usb/android0/bDeviceSubClass
echo 1 > /sys/class/android_usb/android0/bDeviceProtocol
echo tty > /sys/class/android_usb/android0/f_acm/acm_transports
echo diag,diag_mdm > /sys/class/android_usb/android0/f_diag/clients
echo acm,diag,mtp,adb > /sys/class/android_usb/android0/functions
echo 1 > /sys/class/android_usb/android0/enable
start adbd



Thanks to MikeEx and everyone else in IRC that helped me look at files and test my script. I did not have my MSL and was unable to toggle anything.. making the script blind.. and eventually found something much easier than what I was previously trying.
The Following 13 Users Say Thank You to autoprime For This Useful Post: [ Click to Expand ]
 
megamaster2
Old
#2  
Senior Member
Thanks Meter 58
Posts: 524
Join Date: Nov 2012
Please excuse my noobness, but could someone explain what DIAG mode is and the benefits? Thanks!
The Following User Says Thank You to megamaster2 For This Useful Post: [ Click to Expand ]
 
autoprime
Old
(Last edited by autoprime; 16th December 2012 at 03:49 AM.)
#3  
autoprime's Avatar
Recognized Contributor / Recognized Developer - OP
Thanks Meter 4403
Posts: 1,566
Join Date: Jun 2010

 
DONATE TO ME
Quote:
Originally Posted by megamaster2 View Post
Please excuse my noobness, but could someone explain what DIAG mode is and the benefits? Thanks!
Diag mode allows you to connect to special CDMA apps on your windows pc. These apps let you do things like flash a new prl to your phone, flash your phone to different CDMA carriers, repair your data profile, backup your EFS etc etc. Lets you do fun stuffs. Apps that you might connect to are DFS Tool, CDMA Workshop and QPST(google em).

The Following 2 Users Say Thank You to autoprime For This Useful Post: [ Click to Expand ]
 
megamaster2
Old
#4  
Senior Member
Thanks Meter 58
Posts: 524
Join Date: Nov 2012
I really need to get a windows laptop again! Thanks for that info I might flash a PRL so I can roam since I get really crappy coverage where I go to school :/
 
autoprime
Old
#5  
autoprime's Avatar
Recognized Contributor / Recognized Developer - OP
Thanks Meter 4403
Posts: 1,566
Join Date: Jun 2010

 
DONATE TO ME
Quote:
Originally Posted by megamaster2 View Post
I really need to get a windows laptop again! Thanks for that info I might flash a PRL so I can roam since I get really crappy coverage where I go to school :/
Windows can be installed inside a VM on just about any linux computer... and many macs. I do everything on a macbook pro
 
megamaster2
Old
#6  
Senior Member
Thanks Meter 58
Posts: 524
Join Date: Nov 2012
Quote:
Originally Posted by autoprime View Post
Windows can be installed inside a VM on just about any linux computer... and many macs. I do everything on a macbook pro
I do have VMWare Fusion and Parallels but much of what I needed would fail to work. But I'm giving my brother my Mac and buying a windows 8. Maybe until then I'll start using those VMs again! Thanks!
 
elliwigy
Old
#7  
elliwigy's Avatar
Senior Member
Thanks Meter 658
Posts: 2,069
Join Date: Mar 2011
so if im correct.. dialing ##diag# and does NOT promot for MSL/SPC then i dont need spc to flash prl to my phone correct? mine lets me toggle with no issues and no prompts for spc.. so which app wont ask for spc to write prl to phone?

Sent from my LS-970 using xda app-developers app
 
autoprime
Old
#8  
autoprime's Avatar
Recognized Contributor / Recognized Developer - OP
Thanks Meter 4403
Posts: 1,566
Join Date: Jun 2010

 
DONATE TO ME
Quote:
Originally Posted by elliwigy View Post
so if im correct.. dialing ##diag# and does NOT promot for MSL/SPC then i dont need spc to flash prl to my phone correct? mine lets me toggle with no issues and no prompts for spc.. so which app wont ask for spc to write prl to phone?

Sent from my LS-970 using xda app-developers app
ZV8 required spc for diag.. but it seems theyve removed it now.

you need spc to write prl. my first post in the thread links to method of obtaining spc.
 
wbbjason
Old
#9  
wbbjason's Avatar
Junior Member
Thanks Meter 0
Posts: 29
Join Date: Apr 2013
Location: MD
Is there a script similar to this one that can be used with cmd on a Windows PC?
 
autoprime
Old
#10  
autoprime's Avatar
Recognized Contributor / Recognized Developer - OP
Thanks Meter 4403
Posts: 1,566
Join Date: Jun 2010

 
DONATE TO ME
Quote:
Originally Posted by wbbjason View Post
Is there a script similar to this one that can be used with cmd on a Windows PC?
no, command has to be run on the device itself.

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes