Diagnose port (QXDM) - G1 Android Development

There is a command radiooptions we can run to enable QXDM, which should be the radio diagnose port. But don't know what's enabled, and where to read the diagnose messages. Please help...
It's interesting when run radiooptions with parameter 3, from /dev/smd0, we can read this line: [WCDMA] SDLOG Fail (no.-2)
And here is the radiooptions command help:
Usage: radiooptions [option] [extra_socket_args]
0 - RADIO_RESET,
1 - RADIO_OFF,
2 - UNSOL_NETWORK_STATE_CHANGE,
3 - QXDM_ENABLE,
4 - QXDM_DISABLE,
5 - RADIO_ON,
6 apn- SETUP_PDP apn,
7 - DEACTIVE_PDP,
8 number - DIAL_CALL number,
9 - ANSWER_CALL,
10 - END_CALL

blues said:
There is a command radiooptions we can run to enable QXDM, which should be the radio diagnose port. But don't know what's enabled, and where to read the diagnose messages. Please help...
It's interesting when run radiooptions with parameter 3, from /dev/smd0, we can read this line: [WCDMA] SDLOG Fail (no.-2)
And here is the radiooptions command help:
Usage: radiooptions [option] [extra_socket_args]
0 - RADIO_RESET,
1 - RADIO_OFF,
2 - UNSOL_NETWORK_STATE_CHANGE,
3 - QXDM_ENABLE,
4 - QXDM_DISABLE,
5 - RADIO_ON,
6 apn- SETUP_PDP apn,
7 - DEACTIVE_PDP,
8 number - DIAL_CALL number,
9 - ANSWER_CALL,
10 - END_CALL
Click to expand...
Click to collapse
Do you have an SD card in the phone?

Yes, I do have the 1G SD card come with the phone
Does it work for you?

Update:
Update: I noticed the sdcard is readonly when it is connected to my XP PC.
I have disconnected the usb storage. Now I can see sdcard is writable.
But still the QXDM is not working for me.

In Normal HTC CDMA Device Such Programmed are called automatically by just Pressing the Codes in Dialer of Phone
in CDMA
##3424# goes to PST ( Diagnostic Port ) but this command dont work in G1
When i dial this it says USSD Code Running but Flashes error " Connection problem or invalid MMI Code"
when i run
##778# ( ##pst# ) and dial it show " UNKNOWN APPLICATION "

Some of the G1 Source Pointing ## as Starting Code for Diagnostic Method
Code:
/* Example of how to route a call to another Application. */
58 if (POUND_POUND_SEARCH && number.startsWith("##")) {
59 Intent newIntent = new Intent(Intent.ACTION_SEARCH);
60 newIntent.putExtra(SearchManager.QUERY, number.substring(2));
61 newIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
62 context.startActivity(newIntent);
63 setResultData(null);
64 }

The Radio Option is defined in Following File of Android
http://git.source.android.com/?p=pl...2;hb=dbbb392e15b5ace6f19e76c49c80ea14292e8a4d
Which is
[platform/hardware/ril.git]/rild/radiooptions.c

are there any news on the diagnose port?
I'd love to be able to access some of the information using an app on the phone

I have looked at this app before. You can initiate calls, terminate calls and turn the radio on/off but the QXDM functions don't do anything. I have noticed that the Dalvik Debug Manager has an option to "dump radio state" when a device is connected, but it gives an error about a logfile that is missing. Perhaps this logfile is where QXDM messages are sent to.

You can type "logcat -b radio" to see the error msg too.
The app calls ril lib to send the AT commonds to the SMD0 port (shared memory channel between the application processor and radio processor). And the radio processor receives this AT commond, and if the software (AMSS?) runs on the radio chip (ARM9?) is configurated correctly, then it should produce the log.
Any one has the experince to reverse the firmware on the radio chip? I guess it is a simple switch we can turn it on if we knows the AMSS thing.

Any updates??

Check this out!
You may want to take a look at my post. This will virtually work with any device who's kernel source is released . http://forum.xda-developers.com/showthread.php?t=948360

Sorry to revive such an old post, but do your link doesn't work anymore. I need this info, thanks!

Related

[GUIDE] UK "3" USB Modem ZTE MF110/112 Working on ZT-180!

hey guys n gals, iv been reg'd a few days now n thought id make my first post a worth while one
Alot of the credit though must go to Christian Buchner for his initial guide of getting a ZTE usb modem working with vodafone over in Germany.
NOTE: BASED ON ZT-180 SLATE 0929 FIRMWARE (rooted)
To get your ZTE modem working you must be able to use adb confidently!
ok first things first, as Christian pointed out in his guide, if the Flash drive side of the modem is enabled, your slate wont recognise it, so our first job is to disable it.
*Nix Users - Im assuming you have a good knowledge of AT commands already and how to use them so just run
Code:
AT+ZCDRUN=8
Windows Users See Here hxxp://3g-modem.wetpaint.com/page/executing+AT-commands+under+Windows
and execute the above AT command
Right, so now our slate recognises our Modem, now lets get this rocking and get connected.
You will need to Pull the following files from your slate
note: some files may not exist so you will have to create them
/system/etc/ppp/peers/cdma
/system/etc/ppp/peers/cdma_h
/system/etc/ppp/peers/cdma~
/system/etc/ppp/options-3g
/system/etc/ppp/chat-3g-connect
/system/etc/ppp/chat-3g-disconnect
/system/etc/ppp/pap-secrets
/system/etc/ppp/chap-secrets
Now heres what goes in them...
/system/etc/ppp/peers/cdma
Code:
file /system/etc/ppp/options-3g
connect '/system/xbin/chat -v -f /system/etc/ppp/chat-3g-connect'
disconnect '/system/xbin/chat -v -f /system/etc/ppp/chat-3g-disconnect'
user three
/system/etc/ppp/peers/cdma_h
Code:
file /system/etc/ppp/options-3g
connect '/system/xbin/chat -v -f /system/etc/ppp/chat-3g-connect'
disconnect '/system/xbin/chat -v -f /system/etc/ppp/chat-3g-disconnect'
user three
/system/etc/ppp/peers/cdma~
Code:
file /system/etc/ppp/options-3g
connect '/system/xbin/chat -v -f /system/etc/ppp/chat-3g-connect'
disconnect '/system/xbin/chat -v -f /system/etc/ppp/chat-3g-disconnect'
user three
/system/etc/ppp/options-3g
Code:
/dev/ttyUSB3
921600
nolock
crtscts
modem
passive
novj
defaultroute
noipdefault
usepeerdns
noauth
hide-password
debug
nodetach
ipcp-accept-local
ipcp-accept-remote
/system/etc/ppp/chat-3g-connect
Code:
ABORT "BUSY"
ABORT "NO CARRIER"
ABORT "VOICE"
ABORT "NO DIALTONE"
ABORT "NO DIAL TONE"
ABORT "NO ANSWER"
ABORT "DELAYED"
ABORT "ERROR"
REPORT CONNECT
TIMEOUT 10
"" AT
OK AT+CGDCONT=1,"IP","3internet"
OK ATDT*99#
TIMEOUT 20
CONNECT ""
/system/etc/ppp/chat-3g-disconnect
Code:
ABORT "BUSY"
ABORT "ERROR"
ABORT "NO DIALTONE"
SAY "\nSending break to the modem\n"
"" "\K"
"" "\K"
"" "\K"
"" "\d\d+++\d\dATH"
SAY "\nPDP context detached\n"
/system/etc/ppp/pap-secrets
Code:
# client server secret IP addresses
three * three
/system/etc/ppp/chap-secrets
Code:
# client server secret IP addresses
three * three
Now Push all the files back into your slate and reboot.
Once you plug your modem in you will notice it show signal strength, however sometimes it requires you to set an APN up manually, but try a hard reset first if that fails, this is how to do it...
Settings > Wireless & Networks > Mobile Networks > Access Point Names
Name : Anything
APN : 3internet
Username : three
Password : three
Authentication Type : PAP or CHAP
and thats really all there is to it!
nitr0genics said:
hey guys n gals, iv been reg'd a few days now n thought id make my first post a worth while one
Hello !!! I received 180 ZT 1030 and have upgraded the firmware. Now I want to use ZTE 3G modem mf100 follow your instructions but still not on the internet. I live in Russia and the Beeline network using WCDMA. Looking forward to your help. Excuse my English . Thanks !!!
Click to expand...
Click to collapse
Hi nitr0genics,
I tried this with Frojo and it works perfect . Thank you for this also to all other experts.
(google translate, hope you understand )
Hi people
I read the surfstick from german provider 1und1 (ZTE MF110) to run in the ZT-180. Do any of you can experience the driver has to extract? i will use the stick in my gome flytouch2
thx
working on android
hello, does anyone know if this means that we can use the MF110 on any android device with froyo??
thanks
”You will need to Pull the following files from your slate
note: some files may not exist so you will have to create them
/system/etc/ppp/peers/cdma
/system/etc/ppp/peers/cdma_h
/system/etc/ppp/peers/cdma~
/system/etc/ppp/options-3g
/system/etc/ppp/chat-3g-connect
/system/etc/ppp/chat-3g-disconnect
/system/etc/ppp/pap-secrets
/system/etc/ppp/chap-secrets”
How can i make these files, because if iuse notepad those are no more executabiles ?

[Tutorial] How To Logcat

Here's how to use logcat:
There are two main ways to do a logcat, within android, and through adb.
Logcat within android can be done one of two ways, through a Logcat app:
Here are two good examples are either: aLogcat or Catlog
I prefer catlog, because in my opinion it has a little bit nicer UI. Both of these programs can dump their logs to a txt file, which is very useful for debugging. Or, you can do it in terminal emulator (same rules as running through adb(see below))
From Moscow Desire:
Moscow Desire said:
Just a little more info when doing logcat.
Remember, Logcat will run till you end the session. And it won't always create the file till you do so. It's possible you may not see the logfile for a minute or so.
Edit: For phones/tablets with internal storage & external sd:
(note that the location naming convention may be different depending on device)
Open your terminal app;
Type: logcat > /sdcard/logcat.txt (this should create it in internal memory on the tablet)
To send to ext sd card: logcat > /mnt/external_sd/logcat.txt
I use a tablet for example Phones may have a different naming convention.
MD
Click to expand...
Click to collapse
On the other hand, using adb to run logcat, in my opinion is much more useful, because you can start using it when android boots (i.e. once the boot animation appears.)
The code for logcat to output to a file is
Code:
adb logcat > name of problem.txt
you can also do
Code:
adb logcat -f name of problem.txt
how I prefer to do it is this way:
Code:
adb logcat -v long > name of problem.txt
with the -v flag & the long argument, it changes output to long style, which means every line of logcat will be on its own line (makes it a little neater, imo)
Note: When outputting to a file, you will see a newline, but nothing printed, this is normal. To stop logcat from writting to a file, you need to press ctrl+c.
Here's where using logcat (via adb makes life really easy)
Lets say you find a problem you're having after looking at a logcat.
For example:
When I was trying to use a different ramdisk, wifi wouldn't work so I got a logcat that's almost 1300 lines long (a lot of stuff happens in the background)
So if you are searching for an error in the logcat file (it's always e/ for error, f/ for fatal. Those are the two main things that will break a system.)
Code:
D/dalvikvm( 871): GC_CONCURRENT freed 472K, 6% free 10224K/10823K, paused 1ms+6ms
V/AmazonAppstore.DiskInspectorServiceImpl( 871): Available blocks: 21981, Block size: 4096, Free: 90034176, Threshold: 5242880, withinThreshold? true
D/AmazonAppstore.UpdateService( 871): Received action: null from intent: Intent { cmp=com.amazon.venezia/com.amazon.mas.client.framework.UpdateService }
W/AmazonAppstore.UpdateService( 871): Confused about why I'm running with this intent action: null from intent: Intent { cmp=com.amazon.venezia/com.amazon.mas.client.framework.UpdateService }
D/dalvikvm( 890): GC_CONCURRENT freed 175K, 4% free 9375K/9671K, paused 2ms+3ms
V/AmazonAppstore.ReferenceCounter( 871): Reference (MASLoggerDB) count has gone to 0. Closing referenced object.
E/WifiStateMachine( 203): Failed to reload STA firmware java.lang.IllegalStateException: Error communicating to native daemon
V/AmazonAppstore.UpdateService( 871): runUpdateCommand doInBackground started.
V/AmazonAppstore.UpdateService( 871): Running UpdateCommand: digitalLocker
V/AmazonAppstore.UpdateCommand( 871): Not updating key: digitalLocker from: 1334228488057
V/AmazonAppstore.UpdateService( 871): Finished UpdateCommand: digitalLocker
V/AmazonAppstore.UpdateService( 871): Running UpdateCommand: serviceConfig
V/AmazonAppstore.MASLoggerDB( 871): performLogMetric: Metric logged: ResponseTimeMetric [fullName=com.amazon.venezia.VeneziaApplication_onCreate, build=release-2.3, date=Wed Apr 11 13:10:55 CDT 2012, count=1, value=1601.0]
V/AmazonAppstore.MASLoggerDB( 871): onBackgroundTaskSucceeded: Metric logged: ResponseTimeMetric [fullName=com.amazon.venezia.VeneziaApplication_onCreate, build=release-2.3, date=Wed Apr 11 13:10:55 CDT 2012, count=1, value=1601.0]
W/CommandListener( 118): Failed to retrieve HW addr for eth0 (No such device)
D/CommandListener( 118): Setting iface cfg
D/NetworkManagementService( 203): rsp
D/NetworkManagementService( 203): flags
E/WifiStateMachine( 203): Unable to change interface settings: java.lang.IllegalStateException: Unable to communicate with native daemon to interface setcfg - com.android.server.NativeDaemonConnectorException: Cmd {interface setcfg eth0 0.0.0.0 0 [down]} failed with code 400 : {Failed to set address (No such device)}
W/PackageParser( 203): Unknown element under : supports-screen at /mnt/asec/com.android.aldiko-1/pkg.apk Binary XML file line #16
D/wpa_supplicant( 930): wpa_supplicant v0.8.x
D/wpa_supplicant( 930): random: Trying to read entropy from /dev/random
D/wpa_supplicant( 930): Initializing interface 'eth0' conf '/data/misc/wifi/wpa_supplicant.conf' driver 'wext' ctrl_interface 'N/A' bridge 'N/A'
D/wpa_supplicant( 930): Configuration file '/data/misc/wifi/wpa_supplicant.conf' -> '/data/misc/wifi/wpa_supplicant.conf'
D/wpa_supplicant( 930): Reading configuration file '/data/misc/wifi/wpa_supplicant.conf'
D/wpa_supplicant( 930): ctrl_interface='eth0'
D/wpa_supplicant( 930): update_config=1
D/wpa_supplicant( 930): Line: 4 - start of a new network block
D/wpa_supplicant( 930): key_mgmt: 0x4
(mind you, that's 29 lines out of 1300ish, just for example)
I then could do the following with logcat:
Code:
adb logcat WifiStateMachine:E *:S -v long > name of problem.txt
and this will only print out any errors associated with WifiStateMachine, and anything which is fatal, which makes it about a million times easier to figure out what's going on!
In WifiStateMachine:E, the :E = to look for Errors, the full list of options is as follows:
V — Verbose (lowest priority)
D — Debug
I — Info (default priority)
W — Warning
E — Error
F — Fatal
S — Silent (highest priority, on which nothing is ever printed)
You can replace the :E with any other letter from above to get more info.
In order to filter out anything other than what you are looking for (in this case, WifiStateMachine) you must put a *:S after your last command (i.e. WifiStateMachine:E ThemeChoose:V ... ... AndroidRuntime:E *:S)
Sources: http://developer.android.com/tools/help/logcat.html
http://developer.android.com/tools/help/adb.html
Update for windows users:
Thank go to FuzzyMeep Two, Here's what he's posted for windows
FuzzyMeep Two said:
I have made a tool to simplify this for people. I will send you the .bat version, to see the validity of the file, and post the .exe for everyone else.
http://logcat-tool.googlecode.com/files/logcatHELPER.exe
I made this in about a half hour, so if you fnd any issues let me know. I believe i worked out all functionality issues, and do plan on expanding functionality in the future.
Click to expand...
Click to collapse
(If you used his tool, here's his post, thank him for his work!)
Very nicely done, now i have something i can refer people to
Perfect tutorial. Well done. ... I'll translate your tutorial into my language to share it other people.
pRo_lama said:
Perfect tutorial. Well done. ... I'll translate your tutorial into my language to share it other people.
Click to expand...
Click to collapse
Thank you! And thanks for taking your time to translate it!
If you need me to clarify anything shoot me a PM, and I'll help! (Same goes for anybody else interested in porting to their language)
Pax
Very nice, but I do have a question (and I started programming for Android recently): What do you do when the system reboots while debugging (in my case musb_hdrc.ko)? I tried catlog, but the logs are empty... Is there another way to do that?
Thank you in advance
Krain said:
Very nice, but I do have a question (and I started programming for Android recently): What do you do when the system reboots while debugging (in my case musb_hdrc.ko)? I tried catlog, but the logs are empty... Is there another way to do that?
Thank you in advance
Click to expand...
Click to collapse
Use adb instead of an in-android method to capture the logs, you can start when the boot animation starts (note: Not when the kernel splash screen appears) and when it reboots, it'll automatically end. (i.e. run the following in command prompt:
Code:
adb logcat *:E > oh_nos_it_crashed.txt
)
If you're not getting to the boot animation (keeps cycling on the Kernel splash screen) then you have kernel issues, and you need a kernel that has integrated last_kmsg (a whole different ball of wax that I'm still learning about) to figure out what's going on. (kmesg's are direct kernel output)
Maybe if someone like AdamOutler (or any other Dev who has a much better handle on them than myself) were to explain them, it'd help
Pax
Hey man regarding your guide .
I was testing a built of cm9 from my htc one v and it wasnt booting so the dev told me to do a logcat for it .
Just wondering what the process and commands would be?
Thanks.
Just a little more info when doing logcat.
Remember, Logcat will run till you end the session. And it won't always create the file till you do so. It's possible you may not see the logfile for a minute or so.
But what if you can't connect ADB to your device? You can do this
(note that the location naming convention may be different depending on device)
Open your terminal app;
Type: logcat > /sdcard/logcat.txt (this should create it in internal memory on the tablet)
To send to ext sd card: logcat > /mnt/external_sd/logcat.txt
I use a tablet for example Phones may have a different naming convention.
Nice definition of the display terminology
MD
tranceph0rmer said:
Hey man regarding your guide .
I was testing a built of cm9 from my htc one v and it wasnt booting so the dev told me to do a logcat for it .
Just wondering what the process and commands would be?
Thanks.
Click to expand...
Click to collapse
What you'll wanna do is run the following,
Code:
adb logcat *:E > crash.txt
And look at the output file specifically for lines that say 0x0deadbaad (if you see that, that means there's a problem with the Java libraries it references above it) otherwise look for other F/ lines, that'll point you in the right direction.
If you're having issues where and is not accessible for to buy having USB debugging turned off because of doing a /data wipe (factory data reset) first install a similar Rom (in your case, a prior, stable CM9, boot into it, turn on usb debugging, reboot into recovery & only write /cache & dalvik cache before installing the offending Rom & getting your logcat (sorry if I rambled, just got done working a double )
Pax
Sent from my R800x using Tapatalk 2
Moscow Desire said:
Just a little more info when doing logcat.
Remember, Logcat will run till you end the session. And it won't always create the file till you do so. It's possible you may not see the logfile for a minute or so.
But what if you can't connect ADB to your device? You can do this
(note that the location naming convention may be different depending on device)
Open your terminal app;
Type: logcat > /sdcard/logcat.txt (this should create it in internal memory on the tablet)
To send to ext sd card: logcat > /mnt/external_sd/logcat.txt
I use a tablet for example Phones may have a different naming convention.
Nice definition of the display terminology
MD
Click to expand...
Click to collapse
Thanks, MD!
The problem is when you can't access terminal (bootloops, fc'ing like it's going out of style, etc.) that adb is really useful. Sometimes to trick the system into working, you can (esp with AOSP based roms) install a same version of android (I.e. 4.0.4) & not wipe /data (after turning on usb debugging) & still have an access (I learned this after spending about 2-3 months crack flashing my own builds & getting tired of titanium restoring all my apps)
Pax
Sent from my R800x using Tapatalk 2
Great guide, thanks! Found it through the portal. I just added to my sig so maybe it will help stop some of those questions.
paxChristos said:
What you'll wanna do is run the following,
Code:
adb logcat *:E > crash.txt
And look at the output file specifically for lines that say 0x0deadbaad (if you see that, that means there's a problem with the Java libraries it references above it) otherwise look for other F/ lines, that'll point you in the right direction.
If you're having issues where and is not accessible for to buy having USB debugging turned off because of doing a /data wipe (factory data reset) first install a similar Rom (in your case, a prior, stable CM9, boot into it, turn on usb debugging, reboot into recovery & only write /cache & dalvik cache before installing the offending Rom & getting your logcat (sorry if I rambled, just got done working a double )
Pax
Sent from my R800x using Tapatalk 2
Click to expand...
Click to collapse
Thanks for the info.
Will do that the next time i get stuck at the boot animation
can anyone tell me how to clear / reset logcat?
Thanks in advance
riteshbendre said:
can anyone tell me how to clear / reset logcat?
Thanks in advance
Click to expand...
Click to collapse
Why would you want to do that?
To my knowledge, the only way logcat is reset is if you reboot your phone.
That's why filtering your results is very helpful, because no matter how long it's been running, you can get the info that you want without extraneous information
Pax
Thanks for the clarifications
Man thank you so much for the awesome guide!
Now I can actually filter out my logcat results instead of searching through the entire log.
Sent using Tapatalk
Helpful Tool
paxChristos said:
Here's how to use logcat.....
Click to expand...
Click to collapse
I have made a tool to simplify this for people. I will send you the .bat version, to see the validity of the file, and post the .exe for everyone else.
FIXED HUGE ISSUE CAUSING EMPTY FILES
DOWNLOAD
PM or post here if you run into any issues. They WILL be addressed.
I have made a tool to simplify Logcat creation for people. The creation of this tool was inspired, and guided, by the thread started HERE by paxChristos.
UPDATE 4.1
Corrected an issue causing empty files.
apparently, if the process id contained a space ( 1234) the file would parse correctly, but if the numbers came up to the parenthesis (12345) it would output an empty file named ACTIVITY(12345) with no extension.
This was a huge issue, and i apologize for not seeing it sooner. It has been corrected, and the logcat tool works better than ever. I just ran through a 20,000 line logcat without any empty files appearing.
a couple more things to help with stability.
Underscores (_) will be replaced by dashes (-)
Brackets ([]) and arrows (<>) will be replaced with paranthesis(())
-------------------------------------------------------------------------------------------------------------
HUGE UPDATE
Added the ability to "SUPER PARSE" Files, which separates files into folders by log level and creates a TXT file for each activity
Super parse DOES NOT Work with LONG format Logs.
SUPER PARSE is in its infancy I do expect errors, please let me know if you run into anything.
OLD STUFF
EDIT V3.6 DONE
Added ability to filter logcats by activity name. (logcat -s "FILTER")
Fixed Log Level Setting
EDIT V3.5 DONE
NOW PROPERLY PARSES "LONG" FORMAT LOGCATS.
Thank you to Senior Member jes0411 for pointing out the issues that lead me to create V3.4 and 3.5. If any of you have an issue please let me know. It could be hours before i get to it or weeks, but i will get to fixing it.
EDIT V3.4 DONE
Changed the way the date variable was handled to hopefully fix issues experienced by users of non-English versions of windows.
EDIT V3.3 DONE
EDIT V 3.2 Finished
Google code won't allow any new uploads, so i uploaded the new update to XDA in a ZIP file.
Fixed ADB Location settings, some users were having trouble if they input the ADB folder with any quotation marks in the path name, it will now automatically remove quotation marks to ensure correct syntax.
Fixed issue with ADB Location setting not exiting to previous menu.
Fixed issue with Log Level setting not exiting to previous menu.
Capitalized some stuff
Added a feature that will automatically create the selected folder if no output folder exists and the user attempts to run a log.
Added a check when selecting an output folder that will ask if you want the folder created if it does not exist
EDIT V3.1 DONE
FIXED OPTIONS 7 & 8, URLS WERE MISSING A "?"
CHANGELOG EDITS
SAVES AND PARSES FILES IN TO DIFFERENT OUPUT FILES BASED ON LOG LEVEL (E , I , D , W , ETC)
LOGCAT TOOL v1.1 by FuzzyMeep TWO
I made this in about a half hour, so if you fnd any issues let me know. I believe i worked out all functionality issues, and do plan on expanding functionality in the future.
reposted HERE
Edit: source here.
Batch Source
EDIT: UPDATED TO V1.1
added the framework to add filtering to your logcat, it is in the exe, but not utilized yet (still bugy). i have also worked out a few minor bugs in this release.
Very nice tut. Will try
thanks a ton for the in depth guide. I was always fairly confused on how to approach this, so now I'll have something to refer to in order to help all of the awesome devs here.
mcmb03 said:
thanks a ton for the in depth guide. I was always fairly confused on how to approach this, so now I'll have something to refer to in order to help all of the awesome devs here.
Click to expand...
Click to collapse
+1

[Q] Talking to modem using AT commands

Hello everyone, i'm new to this forum, so i'm not sure if i should ask for help here, but anyway.
I'm trying to do a data call using adb shell (also i view logs using logcat), but i can't find the modem file. I've read this article http://forum.xda-developers.com/showthread.php?t=1471241 but i didn't help me.
When i execute cat /proc/tty/drivers i get the following:
Code:
/dev/tty /dev/tty 5 0 system:/dev/tty
/dev/console /dev/console 5 1 system:console
/dev/ptmx /dev/ptmx 5 2 system
/dev/vc/0 /dev/vc/0 4 0 system:vtmaster
rfcomm /dev/rfcomm 216 0-255 serial
g_serial /dev/ttyGS 237 0-3 serial
serial /dev/ttyS 4 64-67 serial
pty_slave /dev/pts 136 0-1048575 pty:slave
pty_master /dev/ptm 128 0-1048575 pty:master
unknown /dev/tty 4 1-63 console
Looks like i shoud send commands to /dev/ttyGS0, but it doesn't reply. I've tried the following commands:
Code:
echo "AT\r" > /dev/ttyGS0
echo "ATD12345678900;\r" > /dev/ttyGS0
but nothing happens. Actually, i'm not sure that i have to send commands to this file, but others don't reply too. So, i'm asking for help to do a data call, thanks in advance.
Also i have huawei P1 XL (u9200) and LG P765, which are based on similar chipsets, but for some reason i can't make data call with huawei, but can do it with LG. All devices are rooted. If u have any suggestions please let me know=)

[Method] Automate the Theater Mode

******************************
A late note:
below contents were written in May2015, after some days I paid my attention to other things (now Oct2015).
If you are new to read, and really interested to achieve this, you may also read the following comments, which may contain some new thoughts/ better methods.
Currently my new watch system is not rooted and am not so hungry on battery. But I promise I will be back to tidy through when I got spare time.
Thanks again for reading.
******************************
I got a way to automate the "Theater mode" of my watch.
I would like my wear to auto switch to "Theater mode" at night and exit every morning to save battery. (Just too lazy to remember to switch it when sleeping ). The real problems are ①google doesn't provide an API for developers ②currently no good method to execute native standalone command on watch.
My basic idea is to simulate a double tap on power button using shell. This would not be that difficult like ②..
Seems current apps don't provide such function: like autowear, weartasker,tasker for wear.... none of them provide a function of executing command on watch.
Then I used thread of gusano38 to apply a debugging of wear from phone (pretend as a PC).
Besides, there is another thread of joschi70 on wearshell, I don't know much about bean shell, so no idea whether it can modify wear setting rather than just retrieving info.
Here are the detailed steps:
Your phones should be rooted.
A. One time record
1. debug your watch (turn on in watch developer opition)
2. use "getevent" to find "bcmpmu_on" related event, in my case, event2
3. run command "cat /dev/input/event2 > /sdcard/doubletap", double tap your power button, then use control-C to stop the command
4. There should be a "doubletap” located in you watch /sdcard
use "cat /sdcard/doubletap > /dev/input/event2" to run and test if it is working
B. After you finish step A, you can always use the following code to trigger current Theater mode
allow bluetooth debugging
Code:
[COLOR="gray"]su
adb kill-server
export HOME=/sdcard
setprop service.adb.tcp.port 5555
stop adbd
start adbd
adb forward tcp:4444 localabstract:/adb-hub
adb connect localhost:4444
sleep 2
adb -s localhost:4444 shell "input keyevent 26; cat /sdcard/doubletap > /dev/input/event2"
setprop service.adb.tcp.port -1
stop adbd
start adbd
adb kill-server
exit[/COLOR]
Also recorded a short demo video
Note: NOT recommended for daily use, maybe you prefer a simple hardware tap, but here debugging mode may make your wear unsafe (therefore this is permanent notification)
=========================================================
It has been some time since my above post, I tried beanshell and finally solved my own problem.
The disadvantage of debug is unsafe, permanent notification, and delay(e.g. my above codes need wait 2s for adb service to be ready). No one if use wearshell.
main code
Code:
import java.lang.Runtime;
import java.io.DataOutputStream;
Process su = Runtime.getRuntime().exec("su");
DataOutputStream outputStream = new DataOutputStream(su.getOutputStream());
outputStream.writeBytes("input keyevent 26;cat /sdcard/doubletap>/dev/input/event2;");
outputStream.flush();
outputStream.writeBytes("exit\n");
outputStream.flush();
su.waitFor();
How:
Step B:
1. install wearshell
2. Prepare above main code, you can either
save to a file (e.g. doubletap.bsh) in /sdcard of watch, and call the through source("/sdcard/doubletap.bsh")
or
directly run (sometimes need to combine into one line like intent)
3. use intent to call: de.fun2code.android.wear.shell.EXEC with extra "bsh".
Now you are free to use it daily!
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
============================================================
This is a third update: I grayed the ADB part of first post for not confusing. This time I show how I used it.
Basically I make my watch into Theater mode and turn off Bluetooth of my phone at night. In the morning do the opposite things:
Just skip the run shell step which kills "bluetooh share" app (my phone has some problem with BT).
This is just one part pf my day/night switch tasks e.g. I also have auto airplane mode and interruption mode. By the way, I don't use airplane mode to turn off bluetooth. Simply because I want my watch to connect a little longer. To do that, you can set "airplane radios" so that you decide whether or not to turn off wifi/bluetooth/etc when you go to airplane mode.
This should save battery a little if not too much. Your decision if it helps you.
my one day sample:
I was searching a solution for this.. However this is still not a daily solution! However this puts a few steps closer at least. Thanks
Sent from my SM-G920F using Tapatalk
I have updated. wearshell worth to try.
qingtest said:
I have updated. wearshell worth to try.
Click to expand...
Click to collapse
This project looks great since it would let me automate activating theater mode with Tasker and I haven't found any other ways to do it. If I understand your post correctly, I need to save the code to a file and save on my watch's storage. How do I copy the file there?
I installed the wearshell , then placed the file with the code named doubletap.bsh in watch sdcard folder and created intent in tasker exactly like in the screenshot and nothing.. The intent goes as it should (green dot on tasker) but the watch still the same..
Sent from my SM-G920F using Tapatalk
if you have sony smart watch 3 like me, can simply plug in your usb cable, otherwise I think can use Debugging over Bluetooth.
then use "adb push" to transfer the file.
In tasker the target is Activity/Service, not BroadcastReceiver.
if this does not solve, can you just paste the codes to web shell page (can also insert 'echo xxx;'), see if there is any output or error?
If error maybe it is the root permission, as you can see my sample code needs su.
well I think the key simulation function may not necessarily need root, but I had my watch rooted (my default). You can either root watch or make a little change to the java codes (so that not requiring root permission).
qingtest said:
In tasker the target is Activity/Service, not BroadcastReceiver.
if this does not solve, can you just paste the codes to web shell page (can also insert 'echo xxx;'), see if there is any output or error?
If error maybe it is the root permission, as you can see my sample code needs su.
well I think the key simulation function may not necessarily need root, but I had my watch rooted (my default). You can either root watch or make a little change to the java codes (so that not requiring root permission).
Click to expand...
Click to collapse
I was using target as activity.
The watch wakes up the screen like if o touched it in normal mode, but nothing else.
My watch it is supposed to be rooted.. I get the # when using shell, but when I saw on code that had SU it was my first though that it might not be rooted.
What changes you suggest for the code? I'm a bit dumb on code since I'm a basic self learner...
Sent from my SM-G920F using Tapatalk
It should work. For problem shooting purpose I guest you check shell and beanshell separately.
1. Make sure adb works in the command window.
The first command "input" is to simulate power press, it should 100% work.
The second command "cat" is to simulate double press, if not working you need to redo the recording.
2. Run beanshell with any command like "echo aaa" in the webpage it should 100% work [edit: print("aaa");]
3. Run my code in webpage, should work
4. Put in tasker
Let me know which step you cannot go through.
qingtest said:
It should work. For problem shooting purpose I guest you check shell and beanshell separately.
1. Make sure adb works in the command window.
The first command "input" is to simulate power press, it should 100% work.
The second command "cat" is to simulate double press, if not working you need to redo the recording.
2. Run beanshell with any command like "echo aaa" in the webpage it should 100% work
3. Run my code in webpage, should work
4. Put in tasker
Let me know which step you cannot go through.
Click to expand...
Click to collapse
I'm having problem right on the second command... using "adb shell cat /sdcard/doubletap>/dev/input/event2" returns in command prompt "The system cannot find the path specified"... however I have triple checked and I have the file doubletap.bsh in the SDCARD folder....
I pushed the doubletap.bsh file to /sdcard and it's not working for me. Running a task with the intent doesn't do anything despite showing the green dot. My watch isn't rooted so I'm sure that's a factor. When I run the code on the web interface this is the error I get
BeanShell: error code bsh.TargetError: Sourced file: inline evaluation of: ``import java.lang.Runtime; import java.io.DataOutputStream; Process su = Runtime. . . . '' : Typed variable declaration : Method Invocation exec : at Line: 3 : in file: inline evaluation of: ``import java.lang.Runtime; import java.io.DataOutputStream; Process su = Runtime. . . . '' : .exec ( "su" )
Target exception: java.io.IOException: Error running exec(). Command: [su] Working Directory: null Environment: null
Click to expand...
Click to collapse
I tried removing what I thought was calling on su permissions but couldn't get it to work, but it may just be poor syntax. Do you know what the code would be if it's not using su?
Edit:
I can't even get the echo beanshell command to run. When I enter 'echo aaa' in the webpage I get the following:
BeanShell: error code bsh.EvalError: Sourced file: inline evaluation of: ``echo aaa ;'' : Typed variable declaration : Class: echo not found in namespace : at Line: 1 : in file: inline evaluation of: ``echo aaa ;'' : echo
Click to expand...
Click to collapse
there are two files 1. doubletap 2. doubletap.bsh.
The first one includes is generated following my step A, did you check it?
sorry "echo" is only for bash.. if you are running beanshell it should be print("aaa"); which work 100%
qingtest said:
there are two files 1. doubletap 2. doubletap.bsh.
The first one includes is generated following my step A, did you check it?
Click to expand...
Click to collapse
Thanks but I'm still overlooking something.
A. One time record
1. debug your watch (turn on in watch developer opition)
2. use "getevent" to find "bcmpmu_on" related event, in my case, event2
3. run command "cat /dev/input/event2 > /sdcard/doubletap", double tap your power button, then use control-C to stop the command
4. There should be a "doubletap” located in you watch /sdcard
use "cat /sdcard/doubletap > /dev/input/event2" to run and test if it is working
Click to expand...
Click to collapse
I need to do the above first even if I'm not using the run shell command, correct? I have my watch set to ADB debugging on, but where am I entering the commands? I'm sure I'm just not understanding what to do.
qingtest said:
A. One time record
1. debug your watch (turn on in watch developer opition)
2. use "getevent" to find "bcmpmu_on" related event, in my case, event2
3. run command "cat /dev/input/event2 > /sdcard/doubletap", double tap your power button, then use control-C to stop the command
4. There should be a "doubletap” located in you watch /sdcard
use "cat /sdcard/doubletap > /dev/input/event2" to run and test if it is working
Click to expand...
Click to collapse
I assumed we could do B without A, so I guess this was the mistake.
Still I'm lacking some knowleage to where we do this and how..
Where we go for one time record and where we run all this steps? ADB to use the "getevent" and the command?
If you could ptovide some more baby steps would be helpfull! thanks
EDITk, I guess I figured it out partially
WIth command prompt and watch screen ON run "adb shell getevent" and while running double press the button (to induce theater mode).
In my phone it showed up like this in the command prompt when I double pressed the button:
I don't get the "bcmpmu_on" on any event but rater "gpnp_pon"
could not open /dev/input/event0, Out of memory
add device 1: /dev/input/event10
name: "ssp_context"
add device 2: /dev/input/event9
name: "tilt_wake_sensor"
add device 3: /dev/input/event8
name: "hrm_lib_sensor"
add device 4: /dev/input/event7
name: "meta_event"
add device 5: /dev/input/event6
name: "step_cnt_sensor"
add device 6: /dev/input/event5
name: "uncal_gyro_sensor"
add device 7: /dev/input/event4
name: "sig_motion_sensor"
add device 8: /dev/input/event3
name: "uncal_geomagnetic_sensor"
add device 9: /dev/input/event2
name: "geomagnetic_sensor"
add device 10: /dev/input/event1
name: "qpnp_pon"
/dev/input/event1: 0001 0074 00000001
/dev/input/event1: 0000 0000 00000000
/dev/input/event1: 0001 0074 00000000
/dev/input/event1: 0000 0000 00000000
/dev/input/event1: 0001 0074 00000001
/dev/input/event1: 0000 0000 00000000
/dev/input/event1: 0001 0074 00000000
/dev/input/event1: 0000 0000 00000000
NOw it's here I'm kind of stuck.. now Im trying to use in the command prompt :
adb shell sendevent cat /dev/input/event1 > /sdcard/doubletap
I event tried
adb shell su sendevent cat /dev/input/event1 > /sdcard/doubletap
and it's returning
"The system cannot find the specified path"
what I'm I missing?
insaned said:
I assumed we could do B without A, so I guess this was the mistake.
Still I'm lacking some knowleage to where we do this and how..
Where we go for one time record and where we run all this steps? ADB to use the "getevent" and the command?
If you could ptovide some more baby steps would be helpfull! thanks
EDITk, I guess I figured it out partially
WIth command prompt and watch screen ON run "adb shell getevent" and while running double press the button (to induce theater mode).
In my phone it showed up like this in the command prompt when I double pressed the button:
I don't get the "bcmpmu_on" on any event but rater "gpnp_pon"
could not open /dev/input/event0, Out of memory
add device 1: /dev/input/event10
name: "ssp_context"
add device 2: /dev/input/event9
name: "tilt_wake_sensor"
add device 3: /dev/input/event8
name: "hrm_lib_sensor"
add device 4: /dev/input/event7
name: "meta_event"
add device 5: /dev/input/event6
name: "step_cnt_sensor"
add device 6: /dev/input/event5
name: "uncal_gyro_sensor"
add device 7: /dev/input/event4
name: "sig_motion_sensor"
add device 8: /dev/input/event3
name: "uncal_geomagnetic_sensor"
add device 9: /dev/input/event2
name: "geomagnetic_sensor"
add device 10: /dev/input/event1
name: "qpnp_pon"
/dev/input/event1: 0001 0074 00000001
/dev/input/event1: 0000 0000 00000000
/dev/input/event1: 0001 0074 00000000
/dev/input/event1: 0000 0000 00000000
/dev/input/event1: 0001 0074 00000001
/dev/input/event1: 0000 0000 00000000
/dev/input/event1: 0001 0074 00000000
/dev/input/event1: 0000 0000 00000000
NOw it's here I'm kind of stuck.. now Im trying to use in the command prompt :
adb shell sendevent cat /dev/input/event1 > /sdcard/doubletap
I event tried
adb shell su sendevent cat /dev/input/event1 > /sdcard/doubletap
and it's returning
"The system cannot find the specified path"
what I'm I missing?
Click to expand...
Click to collapse
I'm stuck at the same place you are. When I run "adb shell getevent" from the command prompt I get results that show "gpnp_pon" for event1 and there's no "bcmpmu_on". So I've tried "adb shell sendevent cat /dev/input/event1 > /sdcard/doubletap" and "adb cat /dev/input/event1 > /sdcard/doubletap" and both give me the same error, "The system cannot find the path specified."
Hi I hoped to make it clear but was too lazy to wrote every detail where I assume readers were familiar with adb.
This is the answer for you two:
①You should know the basic idea is to simulate keypress.
The "input keyevent" does not have the ability to simulate a double tap, that's why we need to use adb to record.
The recorded data is put in the file "doubletap"
②From your question, I guess you are not so familiar with cmd right?
If you run "adb cat /dev/input/event1 > /sdcard/doubletap" in dos cmd, it will actually only run the command "cat /dev/input/event1 " and retrieve the result then write to a file "/sdcard/double" in windows. However, windows does not have such a path, that's why error is reported.
③ sorry I only have played with my own watch, I think the one ‘**on’ should be equivalent to my 'bcmpmu_on'.
④ To do it right, you need to quote the command like this: adb shell "cat /dev/input/event1 > /sdcard/doubletap"
Or first go into adb shell ,then run the command (like below picture)
↑After double press, press Ctrl+C to stop. Then adb will exit with "^C"
The file should already in /sdcard/, can check like below: (in your case doubletap)
Now you can simply run below command to test. should toggle theater mode 100%: (in your case doubletap)
qingtest said:
Hi I hoped to make it clear but was too lazy to wrote every detail where I assume readers were familiar with adb.
This is the answer for you two:
①You should know the basic idea is to simulate keypress.
The "input keyevent" does not have the ability to simulate a double tap, that's why we need to use adb to record.
The recorded data is put in the file "doubletap"
②From your question, I guess you are not so familiar with cmd right?
If you run "adb cat /dev/input/event1 > /sdcard/doubletap" in dos cmd, it will actually only run the command "cat /dev/input/event1 " and retrieve the result then write to a file "/sdcard/double" in windows. However, windows does not have such a path, that's why error is reported.
③ sorry I only have played with my own watch, I think the one ‘**on’ should be equivalent to my 'bcmpmu_on'.
④ To do it right, you need to quote the command like this: adb shell "cat /dev/input/event1 > /sdcard/doubletap"
Or first go into adb shell ,then run the command (like below picture)
↑After double press, press Ctrl+C to stop. Then adb will exit with "^C"
The file should already in /sdcard/, can check like below: (in your case doubletap)
Now you can simply run below command to test. should toggle theater mode 100%: (in your case doubletap)
Click to expand...
Click to collapse
I'm familiar with command prompt and know the basics with adb. I guess it was confusing that some of the steps were very detailed so I could do exactly what you wrote, but some steps were missing things and I didn't realize it. Thank you for your patience.
After doing what was in your last post I'm able to toggle theater mode from adb on my laptop while my laptop is connected, so that's great. However doing it from the Wearshell intent still doesn't work. I copied the code you posted and changed event2 to event1, but I'm pretty sure the problem is that your code uses su and my watch is not rooted. Do you know what the code would look like without using root?
This is the error I got from Wearshell
BeanShell: error code bsh.TargetError: Sourced file: inline evaluation of: ``import java.lang.Runtime; import java.io.DataOutputStream; Process su = Runtime. . . . '' : Typed variable declaration : Method Invocation exec : at Line: 3 : in file: inline evaluation of: ``import java.lang.Runtime; import java.io.DataOutputStream; Process su = Runtime. . . . '' : .exec ( "su" )
Target exception: java.io.IOException: Error running exec(). Command: [su] Working Directory: null Environment: null
Click to expand...
Click to collapse
I just updated my watch to 5.1.1, so lost root. The code is no longer working for me either. I confirm the input and cat do not necessarily need su permission.
However, I don't have an existing code for you ( i am relative new in beanshell too). Will try and share with my spare time (you are welcome to do so too )
Thanks a million for the patience to the detailed adb explanation which helped a lot!
Already working both in Adb, Wearshell and tasker intent. I have the Watch rooted..
However I DID a slight change to the code, I had to remove the " input keyevent 26" from the line, because it was causing only the screen to turn on and without it works great. The double tap on the button for theater mode doesn't need screen on anyway, so I gave it a shot to remove and it worked.
import java.lang.Runtime;
import java.io.DataOutputStream;
Process su = Runtime.getRuntime().exec("su");
DataOutputStream outputStream = new DataOutputStream(su.getOutputStream());
outputStream.writeBytes("cat /sdcard/doubletap>/dev/input/event1;");
outputStream.flush();
outputStream.writeBytes("exit\n");
outputStream.flush();
su.waitFor();
Click to expand...
Click to collapse

[GUIDE] Automatic dual sim switching on latest official OTA

TL;DR:
You need root.
Shell command with root privileges to toggle sim programatically:
Code:
service call phone 162 i32 x i32 y
Where x is 0 for SIM1 and 1 for SIM2, and y is 0 to disable and 1 to enable.
For example:
Code:
service call phone 162 i32 1 i32 0
will disable SIM2 and
Code:
service call phone 162 i32 1 i32 1
will enable it.
Longer version, and how to find the magic "162" number:
You need:
1. vdexExtractor
2. jadx
Step by step:
1. Pull /system/framework/arm64/boot-framework.vdex
2. extract it with vdexExtractor, you should get some dex classfiles.
3. Open them with jadx and find the one that contains com.android.internal.telephony.ITelephony
4. Navigate to the class with jadx and locate the value of TRANSACTION_setSimPowerStateForSlot, this is your magic number.
After you have the command you can use for example Tasker to enable and disable the SIM card.
The only downside of using this method is that major Android version bumps will most likely break this, as the numbers vary from android build to android build.
Spent a few hours trying to figure this out for Oreo only to find your post about 5s before I found the solution myself! Many thanks. I've linked your post here to go with my N-only guide.
Sweet, I've been looking for a solution for this on my Oneplus 5 and this works perfectly with Tasker.
I tried this op OP6T but it doesn't seem to work. Can someone confirm? Maybe the 'magicnumber' differs.
I pulled the vdex file, but I don't know how to extract it with that command line tool vdexExtractor. Can someone help me with this? Here's the file
Maybe a dumb question, but what is enabled by this feature?
ChemoNL said:
Maybe a dumb question, but what is enabled by this feature?
Click to expand...
Click to collapse
Well it gives you the opportunity to run a Tasker command to toggle SIM state. For example disable a SIM during a certain time-frame. Automation FTW!
BTW can someone tell if this function will still work in the light of https://www.androidpolice.com/2018/11/12/tasker-lose-sms-call-functionality-google-security-changes/
help
projection said:
TL;DR:
You need root.
Shell command with root privileges to toggle sim programatically:
Code:
service call phone 162 i32 x i32 y
Where x is 0 for SIM1 and 1 for SIM2, and y is 0 to disable and 1 to enable.
For example:
Code:
service call phone 162 i32 1 i32 0
will disable SIM2 and
Code:
service call phone 162 i32 1 i32 1
will enable it.
Longer version, and how to find the magic "162" number:
You need:
1. vdexExtractor
2. jadx
Step by step:
1. Pull /system/framework/arm64/boot-framework.vdex
2. extract it with vdexExtractor, you should get some dex classfiles.
3. Open them with jadx and find the one that contains com.android.internal.telephony.ITelephony
4. Navigate to the class with jadx and locate the value of TRANSACTION_setSimPowerStateForSlot, this is your magic number.
After you have the command you can use for example Tasker to enable and disable the SIM card.
The only downside of using this method is that major Android version bumps will most likely break this, as the numbers vary from android build to android build.
Click to expand...
Click to collapse
what if i cant find TRANSACTION_setSimPowerStateForSlot even in nougat?
for what reason someone need to do such thing?
more_than_hater said:
for what reason someone need to do such thing?
Click to expand...
Click to collapse
My reason is that I only want to be reached on my work number during work hours. So in my case I disable sim2 at 1600 when I go home from work, and then I enable it right before I start working again.
The apps available for this don't work on my phone (opo5) so this was the only way I could find.
Vledderos said:
I tried this op OP6T but it doesn't seem to work. Can someone confirm? Maybe the 'magicnumber' differs.
I pulled the vdex file, but I don't know how to extract it with that command line tool vdexExtractor. Can someone help me with this? Here's the file
Click to expand...
Click to collapse
same here. i have no idea how to extract the vdex file ........
projection said:
TL;DR:
You need root.
Shell command with root privileges to toggle sim programatically:
Code:
service call phone 162 i32 x i32 y
Where x is 0 for SIM1 and 1 for SIM2, and y is 0 to disable and 1 to enable.
For example:
Code:
service call phone 162 i32 1 i32 0
will disable SIM2 and
Code:
service call phone 162 i32 1 i32 1
will enable it.
Longer version, and how to find the magic "162" number:
You need:
1. vdexExtractor
2. jadx
Step by step:
1. Pull /system/framework/arm64/boot-framework.vdex
2. extract it with vdexExtractor, you should get some dex classfiles.
3. Open them with jadx and find the one that contains com.android.internal.telephony.ITelephony
4. Navigate to the class with jadx and locate the value of TRANSACTION_setSimPowerStateForSlot, this is your magic number.
After you have the command you can use for example Tasker to enable and disable the SIM card.
The only downside of using this method is that major Android version bumps will most likely break this, as the numbers vary from android build to android build.
Click to expand...
Click to collapse
i've succesfully extracted boot-framework.vdex and obtained 3 new files:
boot-framework_classes.cdex
boot-framework_classes2.cdex
boot-framework_classes3.cdex
but using jadx i don't get any result... just an empty window
btw: i'm on op5t running pie
alessandro_xda said:
TL;DR:
You need root.
Shell command with root privileges to toggle sim programatically:
Where x is 0 for SIM1 and 1 for SIM2, and y is 0 to disable and 1 to enable.
For example:
will disable SIM2 and
i've succesfully extracted boot-framework.vdex and obtained 3 new files:
boot-framework_classes.cdex
boot-framework_classes2.cdex
boot-framework_classes3.cdex
but using jadx i don't get any result... just an empty window
btw: i'm on op5t running pie
Click to expand...
Click to collapse
Any luck with this? I am on pie op5t also and want to be able to switch on and off
BigBrosMo said:
Any luck with this? I am on pie op5t also and want to be able to switch on and off
Click to expand...
Click to collapse
I gave up
I had success. Oneplus 5 with Pie
I discovered that with Pie it is necessary another step between 2 and 3, because the step 2 now gives .cdex files (compact dex) instead of the .dex files, and jadx (at least the versions I tried) can read only .dex files.
In the github page of vdexExtractor I found a section about the vdexExtractor#compact-dex-converter, that is necessary to convert .cdex to .dex.
I used the Linux x86-64 - Statically compiled binaries, the shared libraries version didn't work on my Virtual Machine with linux Mint (I have only windows 10 on my pc)
Using that converter I obtained the .dex files that jadx can read and follow step 3 and 4 of the guide.
I hope to be of some help
dragone17 said:
I had success. Oneplus 5 with Pie
...
In the github page of vdexExtractor I found a section about the vdexExtractor#compact-dex-converter, that is necessary to convert .cdex to .dex.
I used the Linux x86-64 - Statically compiled binaries, the shared libraries version didn't work on my Virtual Machine with linux Mint (I have only windows 10 on my pc)
Click to expand...
Click to collapse
That's great! I am on an island right now in Thailand and with only a win7 machine. I would live to get this working as I don't want both Sims on all the time to conserve battery, and would like to automatically check my home SIM once and awhile in the background. While I am quite comp savvy I dont have the time/bandwidth to compile a Linux distro or virtual machine just to run this converter... Or... Do I even need to? What's the quickest and dirtiest method for me to find my "magic number"?
And is that number unique to the install or my IMEI? Like if I reinstall/upgrade the os do I need to redo the process or would it remain the same?
I'm sorry but I don't know if you can run vdexExtractor on windows. If it is possible, I couldn't find how. But jadx have a version with gui compiled to run on windows.
I suppose that the "magic number" depends on the os version, and maybe the phone model.
It didn't change for me on the various minor upgrades on oreo (5.1.5, 5.1.6, 5.1.7), and now it didn't change on the minor pie upgrades (9.0.2, 9.0.3).
Not sure if the number is the same on the various oneplus devices.
alessandro_xda said:
I gave up
Click to expand...
Click to collapse
Had the same problem. Extracted .cdex files I couldn't read from jadx and anything else I tried. Was about to give up, then just guesstimated. Most of the numbers I found were between 150-180, so I just experimented within that range and hit the magic number.
vkrin said:
Had the same problem. Extracted .cdex files I couldn't read from jadx and anything else I tried. Was about to give up, then just guesstimated. Most of the numbers I found were between 150-180, so I just experimented within that range and hit the magic number.
Click to expand...
Click to collapse
is there a way to read the current value before changing it?
The ID on OnePlus 7 on Pie is 175.
No idea if it's the same on the OP6 though.
My phones magic number was "177"
Op6 beta 16
Havoc 2.6

Categories

Resources