[Q] enabling/disabling USB from console ? - HTC One X

Hi,
Does anyone know how i can enable/disable USB functions from a terminal emulator?
i have tried:
Code:
echo 0 > /sys/class/android_usb/android0/enable
to disable the driver completely, as well as
Code:
setprop sys.usb.config none
However /sys/class/android_usb/android0/enable is always 1 and /sys/class/android_usb/android0/functions is always mass_storage,adb (even when selecting "charge only") and the current state remains unchanged.
The phone is rooted, so permissions should not be a problem.

Related

Disabling compcache on MCR 3.1 ?

How would i disable compcache on modaco custom rom 3.1 without using the kitchen?
Edit your /system/init.d/ramzswap.sh and comment out the following lines (by putting a "#" sign in front of them.)
Once your file is edited, it should look like this:
Code:
/system/xbin/insmod /system/lib/modules/tun.ko
#/system/xbin/insmod /system/lib/modules/lzo_decompress.ko
#/system/xbin/insmod /system/lib/modules/lzo_compress.ko
#/system/xbin/insmod /system/lib/modules/xvmalloc.ko
#/system/xbin/insmod /system/lib/modules/ramzswap.ko disksize_kb=131072
#/system/xbin/swapon /dev/block/ramzswap0
#echo "10" > /proc/sys/vm/swappiness
echo "performance" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
Once you've saved the file, reboot your phone and you're good.
I tried doing the same thing. I commented out those exact lines and when I reboot it shows I still have a swap file, just half the size it was before. Huh?

New 1-click root method

Hey folks,
See this link. It reads that it works for any Moto device running Gingerbread.
http://www.droid-life.com/2011/08/25/droid3-1-click-easy-root-already-released/
OK, I succeeded.
My Droid Pro is upgraded from rooted 2.2.1 to 2.3.3.
Follow the standard method may lose the root status next reboot.
I've modified the bat file (Click to root your DROID 3.bat) bellow. (Refer to http://www.psouza4.com/droid3/, Thanks!)
Good luck!
Code:
@echo off
cls
adb kill-server > NUL
COLOR B0
TITLE DROID 3 Easy Root Script
cls
echo ***************************************************************************
echo * *
echo * DROID 3 Easy Root script v7 *
echo * *
echo ***************************************************************************
echo *
echo * Please make sure you meet these pre-requisites:
echo *
echo * (a) install the correct driver
echo * (b) turn on USB debugging (on your phone under Settings -^> Applications)
echo * (c) plug in your phone and set your USB mode to 'charging only'
echo *
echo * Note: your phone will reboot twice during this procedure. This is normal.
echo *
echo * READY TO ROOT YOUR DROID 3 WHEN YOU ARE!
echo *
COLOR E0
pause
echo *
echo * Waiting for your phone to be connected...
echo *
adb wait-for-device > NUL
COLOR B0
echo * Running exploit [part 1 of 3]...
adb kill-server > NUL
adb shell rm /data/local/12m.bak > NUL
adb shell mv /data/local/12m /data/local/12m.bak > NUL
adb shell ln -s /data /data/local/12m
adb reboot
echo *
echo * Rebooting the phone... please wait.
adb kill-server > NUL
COLOR E0
adb wait-for-device > NUL
adb wait-for-device > NUL
COLOR B0
echo *
echo * Running exploit [part 2 of 3]...
adb shell rm /data/local/12m
adb shell mv /data/local/12m.bak /data/local/12m
adb shell rm /data/local.prop.bak > NUL
adb shell mv /data/local.prop /data/local.prop.bak
adb shell echo "ro.sys.atvc_allow_netmon_usb=0" ^> /data/local.prop
adb shell echo "ro.sys.atvc_allow_netmon_ih=0" ^>^> /data/local.prop
adb shell echo "ro.sys.atvc_allow_res_core=0" ^>^> /data/local.prop
adb shell echo "ro.sys.atvc_allow_res_panic=0" ^>^> /data/local.prop
adb shell echo "ro.sys.atvc_allow_all_adb=1" ^>^> /data/local.prop
adb shell echo "ro.sys.atvc_allow_all_core=0" ^>^> /data/local.prop
adb shell echo "ro.sys.atvc_allow_efem=0" ^>^> /data/local.prop
adb shell echo "ro.sys.atvc_allow_bp_log=0" ^>^> /data/local.prop
adb shell echo "ro.sys.atvc_allow_ap_mot_log=0" ^>^> /data/local.prop
adb shell echo "ro.sys.atvc_allow_gki_log=0" ^>^> /data/local.prop
adb reboot
echo *
echo * Rebooting the phone... please wait.
adb kill-server > NUL
COLOR E0
adb wait-for-device > NUL
adb wait-for-device > NUL
COLOR B0
echo *
echo * Running exploit [part 3 of 3]...
[COLOR="Red"]adb shell mount -o remount,rw /dev/block/system /system
adb shell rm /system/bin/su
adb shell rm /system/xbin/su
adb shell rm /system/bin/busybox
adb shell rm /system/xbin/busybox[/COLOR]
adb push busybox /system/xbin/busybox
adb push su /system/xbin/su
adb push Superuser.apk /system/app/Superuser.apk
adb shell chmod 4755 /system/xbin/su
adb shell chmod 755 /system/xbin/busybox
adb shell chown system.system /data
echo *
echo * ALL DONE! YOUR PHONE SHOULD BE ROOTED!
echo *
echo ******************************************************************************
echo.
echo You may now close this window...
echo.
COLOR A0
adb kill-server > NUL
pause
TITLE Command Prompt
COLOR 07
Did you have to do anything different to get it to work? Mine gets stuck on the first reboot and will not doing anything from that point on. The version I have is an .exe file not a bat file
It worked on my 3rd attempt
After reboot I do not have root
Worked just fine for me at the first time.
Maybe something wrong for you.
Try to make a full wipe (save your data first) and then try to root.
Mine gets caught up in the reboot part, screen just stays at the boatloader screen.
Sent from my DROID Pro using XDA App
Thanks, it worked!
I have to say, Gingerbread makes this phone shine.
I finally know how to get this phone working on my Vodafone NL sim. SMS-texting and data, all working.
Only thing not working: sms delivery receipts.
Oh well.
Can anyone help?
Sent from my DROID Pro using XDA App
Script ran without issue, but didn't appear to do anything .
I've also ready Gingerbreak could do the job but did not work either.
Try this, http://hackslurp.com/2011/08/27/how...-3-x2-cliq-on-android-2-3-4-gingerbread-easy/
Worked for me, droid pro on rogers canada(and using a macbook no less!)
lictor4 said:
Try this, http://hackslurp.com/2011/08/27/how...-3-x2-cliq-on-android-2-3-4-gingerbread-easy/
Worked for me, droid pro on rogers canada(and using a macbook no less!)
Click to expand...
Click to collapse
Thanks, but same issue. Script runs no issue but root apps not working. Terminal Emulator or Root Explorer.
Finally got it to work when it says rebooting you need to unplug the USB cable and manually reboot the phone each time. Wait until the phone fully reboots before plugging the USB back in
Sent from my DROID Pro using XDA App
I've done this several times without success. I've unplugged the phone during the reboot each time and waited for it to fully boot up before plugging it in.
What am I missing?

[HOW-TO] Enable USB Diag Mode in AOSP

Below are two scripts to enable/disable USB Diag mode on the Samsung Galasy S III. This should work on all CDMA carriers on both Touchwiz and AOSP roms. Curious to hear if this works on Evo LTE AOSP builds. Thanks to toastcfh for the help.
On Touchwiz you can go to the dialer and hit ##3424# > USB Settings and select DM + MODEM + ADB. But for CM10 and AOKP, the scripts must be used. Diag mode is mainly needed to use QPST and other similar CDMA tools... QXDM, CDMA Workshop, DFS, etc.
To enable diag mode run the following...
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
echo 1 > /sys/class/android_usb/android0/enable
start adbd
setprop sys.usb.state sys.usb.config
To disable diag mode you can reboot the phone or run the following...
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
You can use a script manager to run the script. Open script manager, browse to script files on SD card, select script, set to run as SU and hit save. Do this with both scripts. Now you can use the script manager in the Widgets section to create shortcuts on the desktop for easy access. Hopefully these scripts get built into CM10 so this method is no longer needed.
{
"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"
}
Scripts are attached below. Hit thx. :good:
HA HA HA this is a nice Tut bro i hope u get this for other Sammy devices we already have an AOSP solution for HTC Devices i hated having to boot to EL29 via sdcard just to access the modem
dexter35803 said:
HA HA HA this is a nice Tut bro i hope u get this for other Sammy devices we already have an AOSP solution for HTC Devices i hated having to boot to EL29 via sdcard just to access the modem
Click to expand...
Click to collapse
fixed it... http://forum.xda-developers.com/showthread.php?t=1626638 :good:
autoprime said:
fixed it... http://forum.xda-developers.com/showthread.php?t=1626638 :good:
Click to expand...
Click to collapse
i'm ready to give up on the diag app
Closest I've gotten sofar...
I still haven't gotten this to work on the HTC EVO LTE 4G, but this is what I've gotten so far:
diag.sh:
Code:
#/system/bin/sh
# sets DIAG mode
echo 0 > /sys/devices/virtual/android_usb/android0/enable
echo 04E8 > /sys/devices/virtual/android_usb/android0/idVendor
echo 6860 > /sys/devices/virtual/android_usb/android0/idProduct
echo diag > /sys/devices/virtual/android_usb/android0/f_diag/clients
echo diag,acm,adb > /sys/devices/virtual/android_usb/android0/functions
echo 1 > /sys/devices/virtual/android_usb/android0/enable
start adbd
setprop sys.usb.state sys.usb.config
MTP.sh:
Code:
#/system/bin/sh
# sets DIAG mode
echo 0 > /sys/devices/virtual/android_usb/android0/enable
echo 04E8 > /sys/devices/virtual/android_usb/android0/idVendor
echo 6860 > /sys/devices/virtual/android_usb/android0/idProduct
echo diag > /sys/devices/virtual/android_usb/android0/f_diag/clients
echo diag,acm,adb > /sys/devices/virtual/android_usb/android0/functions
echo 1 > /sys/devices/virtual/android_usb/android0/enable
start adbd
setprop sys.usb.state sys.usb.config
Any help to get this functional would be MUCH appreciated.
autoprime said:
Below are two scripts to enable/disable USB Diag mode on the Samsung Galasy S III. This should work on all CDMA carriers on both Touchwiz and AOSP roms. Curious to hear if this works on Evo LTE AOSP builds. Thanks to toastcfh for the help.
On Touchwiz you can go to the dialer and hit ##3424# > USB Settings and select DM + MODEM + ADB. But for CM10 and AOKP, the scripts must be used. Diag mode is mainly needed to use QPST and other similar CDMA tools... QXDM, CDMA Workshop, DFS, etc.
To enable diag mode run the following...
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
echo 1 > /sys/class/android_usb/android0/enable
start adbd
setprop sys.usb.state sys.usb.config
To disable diag mode you can reboot the phone or run the following...
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
You can use a script manager to run the script. Open script manager, browse to script files on SD card, select script, set to run as SU and hit save. Do this with both scripts. Now you can use the script manager in the Widgets section to create shortcuts on the desktop for easy access. Hopefully these scripts get built into CM10 so this method is no longer needed.
Scripts are attached below. Hit thx. :good:
Click to expand...
Click to collapse
I am on the latest CM10.1 nightly (03-27) with the fairly new 3.4 kernel. I am also on MB1 and have not had issues with updating PRL on it previously. I just tried to run the DIAG.sh script like I have always done to update to the new 16013 PRL and the script failed to work. I got the following error and DFS did not see the device in the port list. Any ideas?
DIAG.sh[8]: can't create /sys/class/android_usb/android0/f_acm/instances: No such file or directory
swiggs98 said:
I am on the latest CM10.1 nightly (03-27) with the fairly new 3.4 kernel. I am also on MB1 and have not had issues with updating PRL on it previously. I just tried to run the DIAG.sh script like I have always done to update to the new 16013 PRL and the script failed to work. I got the following error and DFS did not see the device in the port list. Any ideas?
DIAG.sh[8]: can't create /sys/class/android_usb/android0/f_acm/instances: No such file or directory
Click to expand...
Click to collapse
Yup, same thing here. I believe one of the nightlies near the end of March made this script non-functional. I wish I had the know-how to modify the script to get it to work with the newer nightlies. It's so much nicer doing that, then rolling back to a TW rom then reinstalling a nandroid backup.
uplift777 said:
deleted
---------- Post added at 03:36 PM ---------- Previous post was at 02:49 PM ----------
I just got the same error... What do I do get this working? Thanks...
Click to expand...
Click to collapse
same error as people above? if so.. downgrade to cm10.. not cm10.1.
i have not updated script for newer firmware so it will not work on that.
autoprime said:
same error as people above? if so.. downgrade to cm10.. not cm10.1.
i have not updated script for newer firmware so it will not work on that.
Click to expand...
Click to collapse
Thanks...Im on a mission to restore my IMEI...Hopefully I will be one step closer!
---------- Post added at 05:05 PM ---------- Previous post was at 04:20 PM ----------
autoprime said:
same error as people above? if so.. downgrade to cm10.. not cm10.1.
i have not updated script for newer firmware so it will not work on that.
Click to expand...
Click to collapse
Im assuming I have to go back to the old bootloader prior to CM10.1 Do you know where I can find this bootloader?
I tried to flash back to CM10 and got stuck on the Cynogenmod loading screen...

[Q]build.prop connect USB ?

Hello,
What command should be put in build.prop so that to the connection PC it passes directly on USB connection, and have direct mode developer.
Thank you in advance
Do you mean USB debugging?
If so, a quick google search results in this being your best bet:
adb shell
su
mount -o remount,rw /system
cd /
echo "persist.service.adb.enable=1" >> default.prop
echo "persist.service.debuggable=1" >> default.prop
echo "persist.sys.usb.config=mtp,adb" >> default.prop
echo "persist.service.adb.enable=1" >> /system/build.prop
echo "persist.service.debuggable=1" >> /system/build.prop
echo "persist.sys.usb.config=mtp,adb" >> /system/build.prop
Thank you,
But I have well these orders in build.pop!
But there is always by default charge battery and not USB connection!
(NB: I direct work in I compile of Roma, thus do not modify via ADB

Question Used some adb commands and now wireless charging takes 8hrs.... Please help

Code:
echo Setting lowest RAM Plus...
adb shell settings put global ram_expand_size_list 1
echo Disabling useless settings item...
adb shell settings put global online_manual_url 0
adb shell settings put system remote_control 0
echo Improving audio quality...
adb shell settings put system tube_amp_effect 1
adb shell settings put system k2hd_effect 1
echo Improving general usage...
adb shell settings put system multicore_packet_scheduler 1
adb shell settings put global cached_apps_freezer enabled
adb shell settings put secure tap_duration_threshold 0.0
adb shell settings put secure touch_blocking_period 0.0
echo Enabling adpative battery...
adb shell settings put global adaptive_battery_management_enabled 1
echo Improving apps launch...
adb shell settings put system rakuten_denwa 0
adb shell settings put system remote_control 0
adb shell settings put system send_security_reports 0
echo Enabling processing speed hack...
adb shell settings put global sem_enhanced_cpu_responsiveness 1
echo Enabling performance limit (less heat)...
adb shell settings put global restricted_device_performance 1,1
echo Doing Battery optimizations...
adb shell cmd package bg-dexopt-job
adb shell cmd package compile -m speed-profile -a
This is what I found in someones guide to make galaxy devices more responsive and smoother.... It was posted a couple months ago and I thought I'd try it out but after a couple days I havent really noticed a difference except that when I let my nightstand 10w wireless charger charge my phone it usually takes about 1.5 hrs from like 20-30% to full, now it takes roughly 6 or 7 hours... What can I do to revert these changes, or which command did it, or what happened?
Also the last 2 commands I'm not sure worked or not because whenever I used them it would crash adb terminal on my pc

Categories

Resources