Activate Tethering with ADB - Other Tools & General Discussion

Hello everyone,
I'm on LINUX, and I've create a simple script to activate :
- Data connexion (3G/4G) switch ON
- Enable tethering switch ON
- Change PC ethernet connexion
So I've just have to plug my phone on my USB, and launch my script and voila
But, recently I've got a new phone (Xiaomi MI4c) which works with android 5.1.1
And my script isn't working properly, and I don't know why !:crying:
Everything works, except "enable tethering" with ADB:
Code:
#adb shell su -c 'service call connectivity 30 i32 1'
Result: Parcel(
0x00000000: 00000000 00000002 00000006 006e0062 '............b.n.'
0x00000010: 00700065 0064005c 00000000 00000006 'e.p.\.d.........'
0x00000020: 00740062 0070002d 006e0061 00000000 'b.t.-.p.a.n.....')
And nothing happend
adb works fine :
Code:
# adb shell su -c 'service list connectivity' |grep connectivity
54 connectivity: [android.net.IConnectivityManager]
I've found this :
service call connectivity 32 i32 1 on Ice Cream Sandwich (4.0)
service call connectivity 33 i32 1 on Jelly Bean (4.1 to 4.3)
service call connectivity 34 i32 1 on KitKat (4.4)
service call connectivity 30 i32 1 on Lollipop (5.0)
Click to expand...
Click to collapse
How can I see which number should I use to enable this functionality with ADB ?
Thanks for your help.

Related

[Q] Sigh / G2 2.3.4 attempt to downgrade

so here is where am at I have followed this guide to the T and cant get anywhere on very first step I get permission denied [GUIDE] Downgrade G2 (2.3.3) & DZ (2.3.3) & mT4g (2.3.4) w/ S-ON to Stock Froyo . So I googled a fix for that somewhat got by it but as soon as i get to step 5 and begin the debug this is where am at.
adb install [-l] [-r] [-s] <file> - push this package file to the device and i
nstall it
('-l' means forward-lock the app)
('-r' means reinstall the app, keeping its data
)
('-s' means install on SD card instead of inter
nal storage)
adb uninstall [-k] <package> - remove this app package from the device
('-k' means keep the data and cache directories
)
adb bugreport - return all information from the device
that should be included in a bug report.
adb help - show this help message
adb version - show version num
DATAOPTS:
(no option) - don't touch the data partition
-w - wipe the data partition
-d - flash the data partition
scripting:
adb wait-for-device - block until device is online
adb start-server - ensure that there is a server running
adb kill-server - kill the server if it is running
adb get-state - prints: offline | bootloader | device
adb get-serialno - prints: <serial-number>
adb status-window - continuously print device status for a specifie
d device
adb remount - remounts the /system partition on the device re
ad-write
adb reboot [bootloader|recovery] - reboots the device, optionally into the boo
tloader or recovery program
adb reboot-bootloader - reboots the device into the bootloader
adb root - restarts the adbd daemon with root permissions
adb usb - restarts the adbd daemon listening on USB
adb tcpip <port> - restarts the adbd daemon listening on TCP on th
e specified port
networking:
adb ppp <tty> [parameters] - Run PPP over USB.
Note: you should not automatically start a PPP connection.
<tty> refers to the tty for PPP stream. Eg. dev:/dev/omap_csmi_tty1
[parameters] - Eg. defaultroute debug dump local notty usepeerdns
adb sync notes: adb sync [ <directory> ]
<localdir> can be interpreted in several ways:
- If <directory> is not specified, both /system and /data partitions will be u
pdated.
- If it is "system" or "data", only the corresponding partition
is updated.
environmental variables:
ADB_TRACE - Print debug information. A comma separated list
of the following values
1 or all, adb, sockets, packets, rwx, usb, sync
, sysdeps, transport, jdwp
ANDROID_SERIAL - The serial number to connect to. -s takes prior
ity over this if given.
ANDROID_LOG_TAGS - When used with the logcat option, only these de
bug tags are printed.
C:\AndroidSDK\android-sdk-windows\platform-tools>adb devices
List of devices attached
SH0AMR205274 device
C:\AndroidSDK\android-sdk-windows\platform-tools>adb shell
$ data/local/tmp/fre3vo -debug -start fba90000 -end ffffffff
data/local/tmp/fre3vo -debug -start fba90000 -end ffffffff
fre3vo by #teamwin
Please wait...
Attempting to modify ro.secure property...
fb_fix_screeninfo:
id: msmfb
smem_start: 802160640
smem_len: 3145728
type: 0
type_aux: 0
visual: 2
xpanstep: 0
ypanstep: 1
line_length: 1920
mmio_start: 0
accel: 0
fb_var_screeninfo:
xres: 480
yres: 800
xres_virtual: 480
yres_virtual: 1600
xoffset: 0
yoffset: 800
bits_per_pixel: 32
activate: 16
height: 80
width: 48
rotate: 0
grayscale: 0
nonstd: 0
accel_flags: 0
pixclock: 0
left_margin: 0
right_margin: 0
upper_margin: 0
lower_margin: 0
hsync_len: 0
vsync_len: 0
sync: 0
vmode: 0
Buffer offset: 00000000
Buffer size: 8192
C:\AndroidSDK\android-sdk-windows\platform-tools>adb devices
List of devices attached
SH0AMR205274 device
C:\AndroidSDK\android-sdk-windows\platform-tools>adb
Android Debug Bridge version 1.0.26
-d - directs command to the only connected USB devic
e
returns an error if more than one USB device is
present.
-e - directs command to the only running emulator.
returns an error if more than one emulator is r
unning.
-s <serial number> - directs command to the USB device or emulator w
ith
the given serial number. Overrides ANDROID_SERI
AL
environment variable.
-p <product name or path> - simple product name like 'sooner', or
a relative/absolute path to a product
out directory like 'out/target/product/sooner'.
If -p is not specified, the ANDROID_PRODUCT_OUT
environment variable is used, which must
be an absolute path.
devices - list all connected devices
connect <host>[:<port>] - connect to a device via TCP/IP
Port 5555 is used by default if no port number
is specified.
disconnect [<host>[:<port>]] - disconnect from a TCP/IP device.
Port 5555 is used by default if no port number
is specified.
Using this ocmmand with no additional arguments
will disconnect from all connected TCP/IP devic
es.
device commands:
adb push <local> <remote> - copy file/dir to device
adb pull <remote> [<local>] - copy file/dir from device
adb sync [ <directory> ] - copy host->device only if changed
(-l means list but don't copy)
(see 'adb help all')
adb shell - run remote shell interactively
adb shell <command> - run remote shell command
adb emu <command> - run emulator console command
adb logcat [ <filter-spec> ] - View device log
adb forward <local> <remote> - forward socket connections
forward specs are one of:
tcp:<port>
localabstract:<unix domain socket name>
localreserved:<unix domain socket name>
localfilesystem:<unix domain socket name>
dev:<character device name>
jdwp:<process pid> (remote only)
adb jdwp - list PIDs of processes hosting a JDWP transport
adb install [-l] [-r] [-s] <file> - push this package file to the device and i
nstall it
('-l' means forward-lock the app)
('-r' means reinstall the app, keeping its data
)
('-s' means install on SD card instead of inter
nal storage)
adb uninstall [-k] <package> - remove this app package from the device
('-k' means keep the data and cache directories
)
adb bugreport - return all information from the device
that should be included in a bug report.
adb help - show this help message
adb version - show version num
DATAOPTS:
(no option) - don't touch the data partition
-w - wipe the data partition
-d - flash the data partition
scripting:
adb wait-for-device - block until device is online
adb start-server - ensure that there is a server running
adb kill-server - kill the server if it is running
adb get-state - prints: offline | bootloader | device
adb get-serialno - prints: <serial-number>
adb status-window - continuously print device status for a specifie
d device
adb remount - remounts the /system partition on the device re
ad-write
adb reboot [bootloader|recovery] - reboots the device, optionally into the boo
tloader or recovery program
adb reboot-bootloader - reboots the device into the bootloader
adb root - restarts the adbd daemon with root permissions
adb usb - restarts the adbd daemon listening on USB
adb tcpip <port> - restarts the adbd daemon listening on TCP on th
e specified port
networking:
adb ppp <tty> [parameters] - Run PPP over USB.
Note: you should not automatically start a PPP connection.
<tty> refers to the tty for PPP stream. Eg. dev:/dev/omap_csmi_tty1
[parameters] - Eg. defaultroute debug dump local notty usepeerdns
adb sync notes: adb sync [ <directory> ]
<localdir> can be interpreted in several ways:
- If <directory> is not specified, both /system and /data partitions will be u
pdated.
- If it is "system" or "data", only the corresponding partition
is updated.
environmental variables:
ADB_TRACE - Print debug information. A comma separated list
of the following values
1 or all, adb, sockets, packets, rwx, usb, sync
, sysdeps, transport, jdwp
ANDROID_SERIAL - The serial number to connect to. -s takes prior
ity over this if given.
ANDROID_LOG_TAGS - When used with the logcat option, only these de
bug tags are printed.
C:\AndroidSDK\android-sdk-windows\platform-tools>adb shell
$ dd if=/sdcard/fre3vo of=/data/local/tmp/fre3vo
dd if=/sdcard/fre3vo of=/data/local/tmp/fre3vo
19+1 records in
19+1 records out
9796 bytes transferred in 0.006 secs (1632666 bytes/sec)
$ adb shell
adb shell
adb: permission denied
$ chmod 777 /data/local/tmp/fre3vo
chmod 777 /data/local/tmp/fre3vo
$ /data/local/tmp/fre3vo -debug -start fa
/data/local/tmp/fre3vo -debug -start fa
fre3vo by #teamwin
Please wait...
Attempting to modify ro.secure property...
An invalid argument was passed into the exploit engine.
An error has occured.
$ /data/local/tmp/fre3vo -debug
/data/local/tmp/fre3vo -debug
fre3vo by #teamwin
Please wait...
Attempting to modify ro.secure property...
fb_fix_screeninfo:
id: msmfb
smem_start: 802160640
smem_len: 3145728
type: 0
type_aux: 0
visual: 2
xpanstep: 0
ypanstep: 1
line_length: 1920
mmio_start: 0
accel: 0
fb_var_screeninfo:
xres: 480
yres: 800
xres_virtual: 480
yres_virtual: 1600
xoffset: 0
yoffset: 800
bits_per_pixel: 32
activate: 16
height: 80
width: 48
rotate: 0
grayscale: 0
nonstd: 0
accel_flags: 0
pixclock: 0
left_margin: 0
right_margin: 0
upper_margin: 0
lower_margin: 0
hsync_len: 0
vsync_len: 0
sync: 0
vmode: 0
Buffer offset: 00000000
Buffer size: 8192
Scanning region 3d000000...
and it goes no where tried several different methods no result can some one lend a hand? just tryin to temp root downgrade and some back up with s off and root
thanks for help

[Q] Can somebody help me interpret this debug screen? (Wave GT8500)

A while ago I received a free Wave S8500 running Bada 1.2. Since this OS was pretty awful I decided to upgrade having done the process before on another phone of the same model. Unfortunately I was stupid and managed to flash the wrong files so my phone ended up in a boot loop. I found the correct set of files and tried to flash them but Multiloader only works up to SHP APP, at this point it fails with a "serial port open error". When I try and boot the phone I reach a blue screen full of the following debugging information:
Page: 1/2 <Pic #>
S/W version: S8500+XP+KJ1
Modem: Q6270B-KPRBL-1.5.45T
SHP: VPP R5 2.1.1
Build Host:s1-AGENT08
BuildAt:2011/10/05 22:44:23
App Debug Level l: 0
ASSERTION_REQUIRE:m_hLib != IN
VALID_HOBJ failed/ (file WinLibDllMgr.cpp, line 40)
Cannot load (shpWindow)
<Callstack information>
PC = 40318BEF OemDumpRegister
LR = 403118 OemDumpRegister
<Running Task(InvalidTask) Call stack>
_SysAssertReport
GWES:WinLib::CDI I Mgr::LoadLibrary
WinLibDllProxyInit
WinLibDispatch
OemBmPrelnitMochaTask
mochaTaskPreInit
Page: 2/2 <* #>
All HW Information:
HW VERSION: S8500_REV07
IMEI VERSION: Not Active
RF CAL DATE: Not Active
Bad Block Information:
nNumBMPs : 0
nAge : 0
Run Time Bad Block Occurred :
Init BMPs = 2, Current BMPs = 0
Nucleus Task Information:
Running Task name = SHP_PRE SI
ices = 00000000
Wait = 00000000
Signal = 00000000
Priority = 0
To exit
Press 0 for 2sec
After pressing the home key it goes to a screen I've never previously seen with yellow text stating "UPLOAD to pc". Clearly the phone has a problem with the SHP_APP file and the Windows system it's connected to but beyond that I'm completely out of my depth. Can somebody shed some light on what is wrong with my phone and how I might go about fixing it?
Thanks in advance.

[Q] Attempt to open device /dev/radio0 yields EBUSY

I have a rooted Xperia E C1504 on which I would like to access the FM receiver chipset for a custom FM radio app I'm working on. Trouble is that my fcntl open() call to /dev/radio0 keeps returning EBUSY (errno 16: device or resource busy). Here is the code I'm using to try to open the device (executed in a root shell):
Code:
#define DEFAULT_RADIO_DEVICE "/dev/radio0"
...
radio_fd = open(DEFAULT_RADIO_DEVICE, O_RDWR);
I verified that the radio device is functional with the stock FM Radio app, which was able to tune to a frequency and receive PCM successfully. I turned this app off via its power button icon (this should release /dev/radio0, correct?) and explicitly force-stopped the stock FM Radio app from the Settings->Apps menu, and even deleting Radio.apk (the stock FM Radio app package) from /system/apps with Root Browser and then rebooting the phone, but my program continues to return EBUSY when it executes the above instruction.
What is the best way to investigate what process might be holding a lock on /dev/radio0 and kill it? I tried [adb shell "su -c 'lsof /dev/radio0'"] but the returned list didn't have any entries exactly matching /dev/radio0. There were quite a few cases of '/dev/log/radio' and almost 300 cases of just the word 'radio', but I was expecting to see something listed as using exactly /dev/radio0. I also tried [adb shell ps | grep radio] which returned
Code:
root 79 2 0 0 ffffffff 00000000 S kfmradio
radio 155 140 20416 3232 ffffffff 00000000 S /system/bin/rild
radio 178 140 7820 2472 ffffffff 00000000 S /system/bin/cnd
radio 215 140 6152 500 ffffffff 00000000 S /system/bin/qmuxd
radio 231 140 7288 752 ffffffff 00000000 S /system/bin/netmgrd
radio 610 157 311448 35704 ffffffff 00000000 S com.android.phone
the kfmradio process looked suspicious so I tried killing it, which didn't return any errors, but re-running the filtered ps list above showed that kfmradio was still in the process list (I suppose the OS restarted it?) Any advice regarding troubleshooting EBUSY returns from fcntl open() calls would be very helpful.
Device Model: Sony Xperia E C1504
Linux kernel: 3.4.0
Android OS: 4.1.1
Firmware version: Stock Kernel Xperia E C1505_11.3.A.0.47 (supposed to work for the C1504 as well)
Rooted with: SRSRoot and the 'Gandalf' exploit.

[GUIDE] Huawei usb 3g modem on android x86 4.4.2

Finally found a way to get this usb 3g modem to work with android x86. Looks like there are significant differences in android kitkat, the other tutorials didn't work for me. Here's what i did in case somebody else finds it useful:
Model: Huawei E1752 HSPA USB Stick
Android x86 4.4.2 on Acer Netbook
Get modem to work under Ubuntu first so you have chat scripts that are known to work with your modem/provider. (If having trouble finding the right AT commands to initialize your modem you can record them under windows. Try free serial port monitor)
Install PPP Widget. It doesn't work, but that gives us usb_modeswitch and pppd to play with.
Install busybox if you don't have it already. Your device should be rooted.
I disabled modem's cdrom mode so that i wouldn't have to modeswitch it with PPP Widget every time (did it from linux)
http://ma.juii.net/blog/disable-usb-mode-switching
Tweak and install pppd/chat scripts for your provider:
/sdcard/pppwidget/ppp/free-chat
Chat script to initiate connection. Change AT commands and dial number (*99#) if yours differ.
Code:
ABORT BUSY
ABORT 'NO CARRIER'
ABORT 'NO ANSWER'
ABORT DELAYED
REPORT CONNECT
TIMEOUT 2
"" AT
OK-AT-OK AT&FE0V1X1&D2&C1S0=0
OK-AT-OK AT
OK-AT-OK ATS0=0
OK-AT-OK AT
OK-AT-OK AT&FE0V1X1&D2&C1S0=0
OK-AT-OK AT
OK ATDT*99#
TIMEOUT 30
CONNECT ''
SAY '\rReport from chat:\r'
/sdcard/pppwidget/ppp/peers/free
pppd config file
Code:
#/etc/ppp/peers/free
# Usage: root>pppd call free
ttyUSB0
3600000
crtscts
connect '/data/data/de.draisberghof.pppwidget/app_bin/chat -v -f /sdcard/pppwidget/ppp/free-chat'
noauth
defaultroute
usehostname
user fooooooo
noipdefault
usepeerdns
idle 0
/sdcard/3gmodem/connect
script to start connection
Code:
#!/system/bin/sh
pppd call free
# use own DNS (OpenDNS)
ndc resolver setifdns ppp0 208.67.222.222 208.67.222.220
ndc resolver setdefaultif ppp0
To connect, open a terminal and type:
Code:
$ su
# cd /sdcard/3gmodem
# ./connect
Now you're connected. browser should work now.
Connection is there but android doesn't know about it, so apps like play store which check connectivity will think you're offline. Install Fake Wifi Connection to deal with those.
Done !
how to get chat script for other modem
Hello, Can I use your chat script with Huawei E3531, and replace only the AT commands?
Do I need busybox?
I have no knowledge of commands, just very basic commands on android terminal.
I am having a really hard time to connect to internet, mainly because Broadcom BCM43142 wifi is not compatible with android 9.0-r2, and older versions.
Thank you

Android Emulator Serial COM1 port crashes on data incoming from windows

Hi,
I have the following set:
* Windows 10 pro
* Android Studio Emulator 27.3.10
* Virtual Windows COM port bridge COM1 <--> COM2
I start the emulator with a clean API 25
target Android 7.1.1 for x86
with the following windows command:
Code:
emulator @Device_API_25 -qemu -serial COM1
when running:
Code:
adb shell "dmesg|grep tty"
i can see that the serial port was forwarded:
[ 0.000000] console [ttyS0] enabled
[ 2.399629] 00:04: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
[ 2.430745] 00:05: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A
Click to expand...
Click to collapse
afterwards i run the adb commands:
Code:
adb root
adb shell "setenforce 0"
Now,
when sending from android shell:
Code:
echo test >/dev/ttyS1
I can see the outcome in windows COM2 port
but, when trying to send from windows:
Code:
echo test > COM2
the emulator crashes with the following information:
emulator: ERROR: detected a hanging thread 'QEMU2 main loop'. No response for 15058 ms
Click to expand...
Click to collapse
and the emulator crash data is (partially):
Operating system: Windows NT
10.0.17134
CPU: amd64
family 6 model 61 stepping 4
4 CPUs
Crash reason: EXCEPTION_ACCESS_VIOLATION_WRITE
Crash address: 0x0
Assertion: Unknown assertion type 0x00000000
Process uptime: not available
Click to expand...
Click to collapse
did anyone encountered such an issue ?

Categories

Resources