Related
I have CM7 installed... I know there are settings for screen timeout under display, and CM7 settings allow you to specify the delay for the screen to actually lock. But what about when the screen is locked, you turn it on to check the time and it shuts off after 5 secs. Can this be changed?
Edit: Here's a list of important posts so people don't have to read the entire thread...
Background Info
Step-by-step guide for windows
Allow .jar files to be seen in APK Manager
How-to deODEX android.policy.jar for ODEXed ROMs
How-to for linux/mac(will make a better guide once I finish porting the APK Manager tool from Windows)
Old Stuff:There's not a setting to change the lock screen timeout but I got to looking around and think I found where it can be changed. The stuff I found pointed to android.policy.jar which is located in /system/framework so I adb pulled it and then decoded it using apktool. Some smali files contain hex values of 0x1388 equals 5000 in decimal where 5000ms = 5s. So one of those should be what we want to change. I'm going to try figuring out which one to change, set it to 10s = 10000ms = 0x2710. If it works for me, I can describe how to do it yourself in better detail and/or post a modified android.policy.jar with the timeout you would like.
Edit: I started a thread about this in the Eris dev forum and removed the attached files from here. PM me or post in one of these two threads if you have questions or would like me to modify and send you a custom android.policy.jar
http://forum.xda-developers.com/showthread.php?t=1079844
I successfully increased the default 5s timeout when you wake the phone but don't unlock. If you want to test it out, download one of the attached zip files corresponding to the timeout you would like to have(10s or 30s). Extract android.policy.jar from the zip file and follow either the ADB or Root Explorer or Terminal Emulator instructions below.
If using ADB:
Code:
adb remount
adb shell
cd /system/framework
mv android.policy.jar android.policy.jar.bak
exit
adb push android.policy.jar /system/framework
adb shell
cd /system/framework
chown 0:0 android.policy.jar
chmod 644 android.policy.jar
#reboot to recovery#
#wipe both cache and dalvik-cache#
#reboot#
If using Root Explorer on phone:
mount system as r/w
rename original android.policy.jar in /system/framework to android.policy.jar.bak
move modified android.policy.jar to /system/framework
change owner: owner = 0 - root & group = 0 - root
change permissions: rw-r--r--
#reboot to recovery#
#wipe both cache and dalvik-cache#
#reboot#
Click to expand...
Click to collapse
If using Terminal Emulator on phone:
Code:
mount -o remount,rw /dev/block/mtdblock3 /system
mv /system/framework/android.policy.jar /system/framework/android.policy.jar.bak
mv /PATH/TO/NEW/android.policy.jar /system/framework
cd /system/framework
chown 0:0 android.policy.jar
chmod 644 android.policy.jar
#reboot to recovery#
#wipe both cache and dalvik-cache#
#reboot#
Later tonight or tomorrow I will post a how-to so anyone can make the necessary modifications themselves. That should allow for other devices/ROMs to modify theirs as well since it will be customized to their phone.
I've only tested this on my Eris running GSB v3.1 - Gingerbread 2.3.4 - CM 7.1.0 RC0. Be sure to make a NAND backup and a backup of android.policy.jar as I can't guarantee this will work for you. If you have problems or just want to switch back to the original 5s timeout, replace the modified android.policy.jar with the android.policy.jar backup, wipe cache & dalvik-cache, and reboot or restore from the NAND backup you created.
I'm really surprised no one has brought this idea up before..well glad I had a chance to give you something to dig into and explore some more. I haven't done any editing to system files like this before so I might be posting back with some questions. Thanks for the info..I'll let you know how it goes!
When I plug my phone in it doesnt seem to be going into debugging mode. I have that option checked for it to enable when USB is plugged in but the only icon showing is the USB icon.
I say this because when I run adb devices its not listing my device..also running adb shell it says error: device not found
I havent tried running the adb shell since I flashed to CM7..is there something I need to do differently with this ROM?
thetornado said:
When I plug my phone in it doesnt seem to be going into debugging mode. I have that option checked for it to enable when USB is plugged in but the only icon showing is the USB icon.
I say this because when I run adb devices its not listing my device..also running adb shell it says error: device not found
I havent tried running the adb shell since I flashed to CM7..is there something I need to do differently with this ROM?
Click to expand...
Click to collapse
The debugging notification will only show up if the option for "USB debugging notify" is also checked in Settings->Applications->Development. Not sure why it wouldn't be able to find your phone especially since it sounds like you had it working fine before. What version of adb do you have? I'm using v1.0.26 and never had any problem. You can check the version with the command "adb version". You could also try using adbWireless which would allow you to not have it hooked to your computer with the USB cable.
Scratch that last post..I got it working in ADB Shell
I downloaded the APK tool and moved the files to C:\Windows
Ran this successful: adb pull /system/framework/android.policy.jar
Problem with: apktool d android.policy.jar out - error saying it couldn't find apktool. I went to restart my phone to see if that was an issue and now its hung on the white android screen and wont boot up
Thoughts?
You didn't actually modify anything on the phone right? And didn't push anything to it either? If not, nothing would have changed and it shouldn't be having a problem booting. Try "adb reboot recovery", wipe cache & dalvik-cache then reboot. If you can't run adb commands...pull the battery, put it back in, power it on and hold volume up + power to get into recovery. If something was modified, use adb to revert the modded files back to the originals or restore with a NAND backup if you made one.
Edit: As for apktool not being found, it sounds like apktool is not in your PATH. The Windows folder should be part of your PATH by default. You could check your PATH variable by following these instructions and modify it if needed or you try moving the unpacked apktool files to the same location as the adb command which is most likely /PATH/TO/ANDROID_SDK/platform-tools OR /PATH/TO/ANDROID_SDK/tools
Sorry for the delay..got back to trying this mod. I got an error..
C:\Users\ME\apktool d android.policy.jar out
Unable to access jarfile C:\Windows\\apktool.jar
Did I put these 3 files in the wrong location?
I just saw your comment about putting these files into where adb.exe is located. I moved these files there..also checked my path and its set up for:
Variable: path
Value: C:\android-sdk\platform-tools
The error I got now is: Unable to access jarfile C:\android-sdk\platform-tools\\apktool.jar
I'm not all that familiar with how Windows handles things but something it should be able to find apktool.jar if it's the same directory as apktool.bat. What is the contents of apktool.bat? A workaround would be manually doing the .bat file's job and run "apktool" using this command instead:
Code:
"java -jar /LOCATION/OF/apktool.jar"
Typing that in a cmd window should give you the usage output for apktool. If that works, you could then use that format to decode and build apk/jar files.
I have everything in the folder: C:\android-sdk\platform-tools
Contents of 'apktool.bat':
@echo off
java -jar "%~dp0\apktool.jar" %1 %2 %3 %4 %5 %6 %7 %8 %9
I am getting this error:
C:\Users\ME>java -jar C:\android-sdk\platform-tools\apktool.jar
Unable to access jarfile C:\android-sdk\platform-tools\apktool.jar
Ok...two more things to try.
Add the location of the java commands to the PATH variable. Probably somewhere like C:\jdk1.6.0_##\bin OR C:\Program Files\Java\jdk1.6.0_##\bin. The PATH variable as a whole would now be something like this: C:\LOCATION\OF\jdk1.6.0_##\bin;C:\WINDOWS\system32;C:\WINDOWS
If that doesn't help: change directory(cd) to C:\android-sdk\platform-tools in the cmd prompt, then run "java -jar apktool.jar"
Sorry it's being such a PITA to just get apktool to run.
1. The location of my Java program is: C:\Program Files\Java - There are 3 folders in there: jdk1.6.0_25, jre1.6.0_22, jre6 - I currently have a user variable 'path' with the value 'C:\android-sdk\platform-tools' - should it be added after this? ..if so, could you explain from what I gave about java what I need to add?
2. Tried cd - same thing..Unable to access jarfile
What does the following command give as output?
Code:
echo %PATH%
I'd set your system environment variable PATH like so:
right-click my computer -> properties -> advanced system settings -> Environment Variables...
under system variables, select Path, and Edit...
add the following(without the quotes) to the end of what's already there: ";C:\Program Files\Java\jdk1.6.0_25\bin;C:\android-sdk\platform-tools;C:\android-sdk\tools"
Also, since you are running Windows...it might make things easier on you to use APK Manager. Here's the thread for it: http://forum.xda-developers.com/showthread.php?t=695701
Here is what I have from the echo %PATH%
{
"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"
}
I installed the APK manager..I have it up and running. So I pulled the 'android.policy.jar' - Now what do I do to edit this file?
With all the storms, a power outage, and being busy I'm just now able to get back to you. I'm going to try going through the process using APK Manager on a Windows desktop I have access to. Step-by-step instructions will be in the post below.
Step-by-Step for Windows
You will need the java jdk installed and ADB set up for this to work.
download APK Manager and extract it to you preferred location
this guide will use C:\apk_manager_4.9
run C:\apk_manager_4.9\Script.bat
select option 0 to adb pull
where = /system/framework/android.policy.jar
stored name = android.policy.jar
current project = y
select option 9 to decompile
minimize Script.bat window
use Notepad++(or your preferred editor) to open:
Code:
C:\apk_manager_4.9\projects\android.policy.jar\smali\com\android\internal\policy\KeyguardViewMediator.smali
find ".method public pokeWakelock()V" NOT ".method public pokeWakelock(I)V"
inside the method, find the two lines starting with "const/16 v#" followed by a hex value(0x####)
the second(0x1388=5000ms=5s) is the default timeout unless a hardware keyboard is open, in which case the first(0x2710=10000ms=10s) is used
the values are 16-bit signed integers so the highest either can be set is 0x7FFF=32767ms=32.767s (Your screen will not wake up if set higher)
use this dec->hex convertor to determine the hex equivalent of your desired ms timeout
modify the hex values to your liking, save the file, and close Notepad++
return to the Script.bat window
select option 11 to compile
system apk = y
additional files = n
select option 8 to adb push
where&name = /system/framework/android.policy.jar
select option 24 to quit
open a command prompt to run these commands:
Code:
adb shell chmod 644 /system/framework/android.policy.jar
adb reboot recovery
in recovery,wipe dalvik-cache & cache, then reboot
Done!
All GOOD! Thanks for your hard work on figuring all this out for windows..it really wasn't hard at all once I had the right set of instructions haha
The only thing I've noticed is that the "screen off animation" does not work now - I have checked and unchecked it and its still not working..its really no biggie but just thought I'd say in case you want to play around with this mod more.
thetornado said:
All GOOD! Thanks for your hard work on figuring all this out for windows..it really wasn't hard at all once I had the right set of instructions haha
The only thing I've noticed is that the "screen off animation" does not work now - I have checked and unchecked it and its still not working..its really no biggie but just thought I'd say in case you want to play around with this mod more.
Click to expand...
Click to collapse
I'm glad we finally got it figured out for you. I have the screen animation turned off on my Eris so I didn't notice this broke it. I'll look into it and see if I can figure anything out. The first thing that comes to mind is that the screen off animation could somehow be dependent on the AWAKE_INTERVAL_DEFAULT_MS variable. As I found when first looking at this mod, changing the variable won't actually affect the value wherever it is used since the package is already compiled. So if the animation does use that variable in some way, we'll need to find where that happens and change the value there.
HOW-TO Fix **ADB is not recognized in the CMD**
Navigate to & Left_Click on Start >
Right_Click on Computer >
Left_Click on Advance System Settings >
Left_Click on Environment Variables >
Left_Click on New ( User Variables ) >
Variables Name: ADB ( Or anything you want )
Variables Value: ;C:\SDK\tools ( Just like this, This is the Path of my adb.exe )
You must put a ; in front of ;C:\ ( adb Path goes here / Variables Value: )
That's it.. You now have set up adb to work Global via cmd prompt on win7
~Eugene
eugene373 said:
HOW-TO Fix **ADB is not recognized in the CMD**
Navigate to & Left_Click on Start >
Right_Click on Computer >
Left_Click on Advance System Settings >
Left_Click on Environment Variables >
Left_Click on New ( User Variables ) >
Variables Name: ADB ( Or anything you want )
Variables Value: ;C:\SDK\tools ( Just like this, This is the Path of my adb.exe )
You must put a ; in front of ;C:\ ( adb Path goes here / Variables Value: )
That's it.. You now have set up adb to work Global via cmd prompt on win7
~Eugene
Click to expand...
Click to collapse
or you can just open up command prompt and cd^ (adb folder location)
thesparky007 said:
or you can just open up command prompt and cd^ (adb folder location)
Click to expand...
Click to collapse
or copy the exe and the needed dll's to system32
however when i type adb it better just work regardless of what folder I'm in...
If you are running .bat & a Noob it will never work.... Just follow the Directs posted in OP
Thanks OP for the tip.
This is the easiest way to start adb.
OK, so I don't know what I did wrong but I named the variable name to adb and then the variable value ;C:\Program Files (x86)\Android\android-sdk\platform-tools which is where my adb.exe is located. But if I open up a command prompt and do adb devices it says:
C:\Users\Tiffany>adb devices
'adb' is not recognized as an internal or external command,
operable program or batch file.
If I cd to that location adb works but I thought it would be cool to just open a command prompt and be able to use adb but it's not working for me. Any suggestions or do u see anything wrong?
Tiffany84 said:
OK, so I don't know what I did wrong but I named the variable name to adb and then the variable value ;C:\Program Files (x86)\Android\android-sdk\platform-tools which is where my adb.exe is located. But if I open up a command prompt and do adb devices it says:
C:\Users\Tiffany>adb devices
'adb' is not recognized as an internal or external command,
operable program or batch file.
If I cd to that location adb works but I thought it would be cool to just open a command prompt and be able to use adb but it's not working for me. Any suggestions or do u see anything wrong?
Click to expand...
Click to collapse
Tiffany, try this from a cmd prompt:
path = %path%;C:\Program Files (x86)\Android\android-sdk\platform-tools
then adb should work regardless of where you are in cmd
RyteSyde said:
Tiffany, try this from a cmd prompt:
path = %path%;C:\Program Files (x86)\Android\android-sdk\platform-tools
then adb should work regardless of where you are in cmd
Click to expand...
Click to collapse
AHH, You are awesome. That worked. So should I delete that variable that I added or just leave it there?
Edit: Ok. So it works when I add that path but if I close that prompt and then reopen and try to use adb with out adding that path again I get the error. So do I have to do that every time I open the command prompt?
Tiffany84 said:
AHH, You are awesome. That worked. So should I delete that variable that I added or just leave it there?
Edit: Ok. So it works when I add that path but if I close that prompt and then reopen and try to use adb with out adding that path again I get the error. So do I have to do that every time I open the command prompt?
Click to expand...
Click to collapse
No you shouldn't have to if you open the cmd window with admin rights and set the path=. Run cmd as administrator or use the posts above and edit the path variable and add a ; to the end of it and then the path to platform-tools
either way should work
and if you get that to stick you won't need the other variable you added before
RyteSyde said:
No you shouldn't have to if you open the cmd window with admin rights and set the path=. Run cmd as administrator or use the posts above and edit the path variable and add a ; to the end of it and then the path to platform-tools
either way should work
and if you get that to stick you won't need the other variable you added before
Click to expand...
Click to collapse
Ok, so I ran the cmd prompt as admin and it still won't stick. So your saying I need to add ; before C: and at the end of it? Sorry. Not the greatest with pc's. Thanks for trying to help though.
Tiffany84 said:
Ok, so I ran the cmd prompt as admin and it still won't stick. So your saying I need to add ; before C: and at the end of it? Sorry. Not the greatest with pc's. Thanks for trying to help though.
Click to expand...
Click to collapse
whatever is in your path variable, leave that and just add this to the end:
;C:\Program Files (x86)\Android\android-sdk\platform-tools
RyteSyde said:
whatever is in your path variable, leave that and just add this to the end:
;C:\Program Files (x86)\Android\android-sdk\platform-tools
Click to expand...
Click to collapse
I named it adb and then the blank spot for the value I just copied and pasted what u had and still nothing. I give up. I guess stuff isn't meant to be easy for me. Story of my life. Thank u so much for trying to help.
Tiffany84 said:
I named it adb and then the blank spot for the value I just copied and pasted what u had and still nothing. I give up. I guess stuff isn't meant to be easy for me. Story of my life. Thank u so much for trying to help.
Click to expand...
Click to collapse
I was referring to updating the system path. Where you created the variable, underneath that should be the "System variables" section. Scroll down in that the the variable "path" and double click it. Move the cursor to the end of the line entry and paste in the ;C:\...etc... line from above
RyteSyde said:
I was referring to updating the system path. Where you created the variable, underneath that should be the "System variables" section. Scroll down in that the the variable "path" and double click it. Move the cursor to the end of the line entry and paste in the ;C:\...etc... line from above
Click to expand...
Click to collapse
BAM!!!!!!!!!!!!!!!!!!!!! Thank u for not giving up on me even though I had. That did it. I"M giving u all my thanks for the day. Thank u again. I really appreciate it.
Tiffany84 said:
BAM!!!!!!!!!!!!!!!!!!!!! Thank u for not giving up on me even though I had. That did it. I"M giving u all my thanks for the day. Thank u again. I really appreciate it.
Click to expand...
Click to collapse
it's no root but glad I could help
RyteSyde said:
it's no root but glad I could help
Click to expand...
Click to collapse
Definitely not root but hey, still pretty cool.
Thread moved to General as not development, thanks for sharing though
I always wanted to know how to set adb so you can use it anywhere. Editing the path in the system variable worked for me. Thanks RyteSyde.
The right way to avoid weird issues.... [Noob Proof sorry in advance]
It actually works perfect if you just do the following:
1. Right Click My Computer -> Properties
2. On the left pane, Find and Click "Advanced system settings"
3. Under the "Advanced" Tab Find and Click "Environment Variables..."
4. In the box for "User variables for [your name here; e.g. David]" there will be a button that says "New..." Click it.
5. Now you have a box in front of you with two fields:
1. Variable name: entering path here is really safer and can help to avoid clogging up the environment namespaces (cluttering your ram/registry)
Code:
Path
2. Variable value: directory containing the adb.exe you want to use**; i.e.
Code:
C:\Android\sdk\platform-tools
**to find this with ease search for "adb.exe" or look for it in "...sdk\platform-tools\" or "sdk\tools".
**This is a version dependent thing for the Android SDK which folder its in.
6. Click OK on all the dialogs and exit the windows we opened here.
7. Hit the windows key + R and type cmd.exe; hit Enter
8. Type adb into the newly opened cmd window. hit Enter
9. If adb runs all is well. Your DONE. If not continue to step 10.
--If it work stop here!--
10. At this point we are going to select our entry from step 5. (in Environment variables...)and delete it. Otherwise windows has two pointers to our adb.exe.
11. Navigate in the "System variables" box and scroll down until you see Path in the Variable Column. Select it and Click "Edit..."
12. Click inside "Variable value:" go to the very end of this and drop a ";" no spaces. Enter the value from Step 5.2
13. Click OK/Apply on all dialogs and reboot your PC.
14. Repeat steps 7-9 and if all is well your done. If not you may need to redownload the AndroidSDK from here: http://developer.android.com/sdk/index.html then repeat this guide.
The reason for first trying to do this under "User" as opposed to "System" is if you need to track your changes to Path in case anything goes wrong as it can be a daunting task to go through the System version (its really full of stuff that needs to be there XD )
But don't take my word for it: My path
Code:
%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static
and my Windows is brand new Store-bought not OEM. It tends get get bigger the more stuff windows needs to globally keep track of that doesn't live in C:\Windows\
Hope this helped!
RyteSyde said:
whatever is in your path variable, leave that and just add this to the end:
;C:\Program Files (x86)\Android\android-sdk\platform-tools
Click to expand...
Click to collapse
I could really use some help I have a windows vista 32-bit
The first time I tried to set up adb I messed up bad and deleted my original environment variable path
so now I can't even do it because I need my original environment variable path then ;C:\Program Files (x86)\Android\android-sdk\platform-tools
I didn't create a system restore point so I am screwed is there anyway I can recover my original environment variable path?
Grandkai said:
I could really use some help I have a windows vista 32-bit
The first time I tried to set up adb I messed up bad and deleted my original environment variable path
so now I can't even do it because I need my original environment variable path then ;C:\Program Files (x86)\Android\android-sdk\platform-tools
I didn't create a system restore point so I am screwed is there anyway I can recover my original environment variable path?
Click to expand...
Click to collapse
http://forum.xda-developers.com/showthread.php?t=2317790
I would personally use this seeing it's one click go.
Hi,
In France, the 4th Mobile Operator, FREE, is launching a wifi access for mobile phone. This access is relayed by all the Adsl Box from FREE ADSL.
The SSID of this Wifi Access is "FreeWifi_secure" and it is protect by WPA EAP-SIM.
FREE is solding some android phones with the ability to configure EAP-SIM but they do not share the changes they made it on their Roms.
I use an EVO 3D GSM with KingIceCobra3D 1.2. And i found a simple method to connect to this wifi.
In the file:
/data/misc/wifi/wpa_supplicant.conf
Code:
adb shell cat /data/misc/wifi/wpa_supplicant.conf
ctrl_interface=wlan0
update_config=1
device_type=10-0050F204-4
config_methods="push_button keypad"
[COLOR="Red"]network={
ssid="FreeWifi_secure"
key_mgmt=WPA-EAP IEEE8021X
eap=SIM
priority=5
}
[/COLOR]
Add theses Lines in red
Carefull to preserve the rigths of this file after the modification
1) Get the File and rename it to wpa_supplicant.conf
2)
Code:
adp push wpa_supplicant.conf /data/misc/wifi/wpa_supplicant.conf
adb shell chown 1000:1010 /data/misc/wifi/wpa_supplicant.conf
adb shell chmod 660 /data/misc/wifi/wpa_supplicant.conf
adb shell ls -l /data/misc/wifi/wpa_supplicant.conf
-rw-rw---- 1 1000 1010 272 May 17 09:10 /data/misc/wifi/wpa_supplicant.conf
adb shell cat /data/misc/wifi/wpa_supplicant.conf
ctrl_interface=wlan0
update_config=1
device_type=10-0050F204-4
config_methods="push_button keypad"
network={
ssid="FreeWifi_secure"
key_mgmt=WPA-EAP IEEE8021X
eap=SIM
priority=5
}
FXJumper.
Just checked on mwakious3Drom 4.0 ... works great
remerciements?
tuxstang said:
Just checked on mwakious3Drom 4.0 ... works great
Click to expand...
Click to collapse
I would like +1 on my "thank meter" and you will my first fan ;-)
merci,
fx
Hi Fxjumper,
I'm really interesting in your solution.
I don't find data/misc ...
Can I create it or have I to use a specific file manager.
I have tried with "file manager" and "file expert"
Thanks for your help
Optimus 2X - CM7 Temasek Kang -104
mgl2 said:
Hi Fxjumper,
I'm really interesting in your solution.
I don't find data/misc ...
Can I create it or have I to use a specific file manager.
I have tried with "file manager" and "file expert"
Thanks for your help
Optimus 2X - CM7 Temasek Kang -104
Click to expand...
Click to collapse
Use a root file browser. Root Explorer. Also, be sure to mount it as RW (advanced options)
Thank u for your help.
a) All right : I put the wpa_supplicant.conf into my phone but now i can't activate wifi due to an error
b) what the second code is for ? (what have i to do with this code ?)
thx
Edit : a) it's Ok now after editing the file : i don't have to replace the initial text but to add the red text from fxjumper (i'm an idiot cause that's what he said )
The B) point isn't resolve : what is the code for and when have i to put it inside ?
Hello,
The second code is an example to install the wpa_supplicant.conf file. This replaces your ssid configured.
Your solution is preferable, because you do not remove your existing configuration but add the SSID "FreeWifi_secure".
Sincerely,
fxjumper said:
Hello,
The second code is an example to install the wpa_supplicant.conf file. This replaces your ssid configured.
Your solution is preferable, because you do not remove your existing configuration but add the SSID "FreeWifi_secure".
Sincerely,
Click to expand...
Click to collapse
It works for you????
I did it and it can t connect to the network but it s trying now...
Any idea?
Precisions
(Google traduction --- sorry)
After a few questions in Private Message, here is a method from a blank file and edit it.
i) file format (dos or unix encode)
ii) to file permissions
This is how I propose to proceed
1) recovering the file on the computer
2) we change
3) upload it on the mobile
4) we check the consistency of the file (right)
------------------------
It is left
------------------------
1) I assume the phone is Rooted
we will save the file wpa_supplicant.conf that derail and recreate one:
Code:
adb shell
cd /data/misc/wifi
cp-a wpa_supplicant.conf wpa_supplicant.conf.sav
rm wpa_supplicant.conf
exit
Switch OFF/ON the wifi
Copy the file on the computer
pull adb shell /data/misc/wifi/wpa_supplicant.conf wpa_supplicant.conf
2) To modify the file I suggest you use notepad++
http://download.tuxfamily.org/notepa....Installer.exe
Edit the file, and add at the end
network = {
ssid = "FreeWifi_secure"
key_mgmt = WPA-EAP IEEE8021X
eap = SIM
priority = 5
}
save
3) is the upload
Code:
adb push wpa_supplicant.conf /data/misc/wifi/wpa_supplicant.conf.new
4) It checks the credentials and the owner and the old file
Code:
adb shell
cd /data/misc/wifi/
ls -l wpa_supplicant.conf
----> -rw-rw ---- 1 1000 1010 185 May 20 5:31 p.m. wpa_supplicant.conf
We crush our file
Code:
cat wpa_supplicant.conf.new > wpa_supplicant.conf
This should solve our problem of right and permissions
we check again:
Code:
ls -l wpa_supplicant.conf
----> -rw-rw ---- 1 1000 1010 185 May 20 5:31 p.m. wpa_supplicant.conf
Sincerely,
Another way, as we most use a custom rooted rom, is to use a rooted filemanager.
For exemple, i use ES File Explorer, set so it accesses /data RW, then edit the file with ES's editor. No need to set back file's permissions.
tuxstang said:
Another way, as we most use a custom rooted rom, is to use a rooted filemanager.
For exemple, i use ES File Explorer, set so it accesses /data RW, then edit the file with ES's editor. No need to set back file's permissions.
Click to expand...
Click to collapse
And it works for you??????
I did it and it can t connect....
Who have it working?????? and what did you do????
B_e_n said:
And it works for you??????
I did it and it can t connect....
Who have it working?????? and what did you do????
Click to expand...
Click to collapse
Hello B_E_N,
In private message, you said you are using a motorola milestone xt720 under cronosx 2.3.7, a cyanogen mod 7 customized.
Now i sent you a patch with /system/framework/com.orange.authentication.simcard.jar
We are waiting your test ...
Sincerely,
CM9 nightlies + SGS
Hello,
I just tried this modification, but cannot find a way to make it work...even though I doublecheck both the permission and the content of the file
For information, I'm running CM9 nightlies for my Samsung Galaxy S.
Until now it doesn't work for me ... even with rom toolbox. Permissions and owners are checked and ok.
Next try : via adb & androisd sdk.
o2x - cm7 - FREE
One more thing : no more error message but wifi try to connect without result ...
o2x - cm7 - FREE
B_e_n said:
And it works for you??????
I did it and it can t connect....
Who have it working?????? and what did you do????
Click to expand...
Click to collapse
Here's how i proceede from ground up on my EVO 3D, with Mwakious, Predator and KingCobra ICS roms.
1/ go in settings and select FreeWifi_secure
2/ set a lock PIN as requested
3/ switch off WiFi
4/ open ES File Explorer
5/ check "Up to Root", "Root Explorer" and "Mount FileSystem" in ES File Explorer settings
6/ navigate to /data/misc/wifi
7/ edit wpa_supplicant.conf
8/ save
9/ switch on WiFi and select FreeWifi_secure
10/ unset lock PIN
Hope it helps.
it was that easy?????
should work on all rooted phone so
works like a charm on my evo
Don't work with my phone...
How do you change owners parameters with ES explorer ?
Regards.
o2x - cm7 - FREE
Hi,
maybe you can use an alternate method on post #11 in
http://forum.xda-developers.com/showthread.php?t=1639437&page=2
what's your phone by the way ?
I'm using CM7.2 on a Nexus One.
I edited the file with ES Explorer, saved, activated wifi...
But doesn't work... It tries to connect but fails.
Hi, I don't really know where to put this topic but anyways my problem is that i need to edit a line in a file.
So i think of something like this
su
Cd /data/data/foldernameofapp/
Edit "file.dat"
Edit line 4 "text here 2"
i want it to edit like this "text here 3"
Change only the number. or replace the hole line with a new line where i only changed the number. btw the best is if the script can change a line and not find text and change. Because the number in the text i want to change can vary from different numbers.
Hope someone understands what i mean. Thanks in advance
P.S i can use root explorer and open the file with a text editor and change it, this works but takes forever
P.S.S i got root
This below will change "text here <whatever>" in oldfile.txt to "text here 3" in newfile.txt
Code:
$ busybox sed 's/text here .*/text here 3/' oldfile.txt > newfile.txt
kuisma said:
This below will change "text here <whatever>" in oldfile.txt to "text here 3" in newfile.txt
Code:
$ busybox sed 's/text here .*/text here 3/' oldfile.txt > newfile.txt
Click to expand...
Click to collapse
Okay but will it create a new file? Because I want it to save the old file.
Sent from my Galaxy Nexus using xda premium
julllleee said:
Okay but will it create a new file? Because I want it to save the old file.
Click to expand...
Click to collapse
I'm quite sure you can find out a way for the new file to live under the name of Sanders.
hmm i get this error. ser:bad option in substitution expression
Btw what do you mean with the last post? How do I save it? I can use your code and then maybe have another script after your thats remove the old file and then rename the new file to the old name?
sed 's/<zk_cp>0</zk_cp>.*/<zk_cp>6</zk_cp>/' zk.dat > zk2.dat
julllleee said:
sed 's/<zk_cp>0</zk_cp>.*/<zk_cp>6</zk_cp>/' zk.dat > zk2.dat
Click to expand...
Click to collapse
Ah, ok, you can't use / as delimiter if it occurs in the replacement strings as well. And yes, of course you can rename (mv) or copy (cp) the resulting files to get correct file names. Did you really have to ask that?
Code:
$ cp zk.dat zk.tmp
$ sed 's!<zk_cp>.*</zk_cp>!<zk_cp>6</zk_cp>!' zk.tmp > zk.dat
kuisma said:
Ah, ok, you can't use / as delimiter if it occurs in the replacement strings as well. And yes, of course you can rename (mv) or copy (cp) the resulting files to get correct file names. Did you really have to ask that?
Code:
$ cp zk.dat zk.tmp
$ sed 's!.*!6!' zk.tmp > zk.dat
Click to expand...
Click to collapse
Okay thanks I'll try the code
Sent from my Galaxy Nexus using xda premium
Wow works really good exactly as I want. I really appreciated it. You are the best!!
Sent from my Galaxy Nexus using xda premium
Follow thread http://forum.xda-developers.com/showthread.php?t=2173465
First of all , I'm not responsible for any damage..
Of course that's a rough explanation(i really need to hit the bed) but I hope you get the idea and someone will create more clearer and friendly instruction/guide/how-to/whatever.
When flashing L9 , LG App extracts files into C:\ProgramData\LGMOBILEAX\Phone ,
LGP769_AP[6].bin (contains /system partition which includes hdcp.sh) and that can be easly modified(image) and replaced during flashing process.
adb push su /data/local/tmp/
adb push busybox /data/local/tmp/
adb push Superuser.apk /data/local/tmp/
adb push rooting.sh /data/local/tmp/
adb shell chmod 777 /data/local/tmp/busybox
adb shell chmod 777 /data/local/tmp/rooting.sh
Follow thread http://forum.xda-developers.com/showthread.php?t=2173465
Downloading 10g kdz now. Will post back after I try to work this out. Thanks alot dude.
@lelus,
I am old dos buzz, so looking at the hexediting done by you in the BIN file, I can say that I am getting some hints.
You are suggesting to quietly replace the BIN file, in the middle of flashing KDZ file (when it is extracted to following folder), right?
C:\ProgramData\LGMOBILEAX\Phone\LGP769_AP[6].bin
The question is at which point the BIN file is to be changed? I still am confused with the sequence of BIN file replacement, scripts and files pushed via ADB. When these procedures are to be done? before flashing or after flashing?
I get hint that, you have modified BIN file to bypass the script file "hdcp.sh" which is used by LG Tool while flashing and instead of that, you are instructing to push+execute modified script "/data/local/tmp/rooting.sh". This new script is added in the beginning of BIN file, does that mean it will be executed everytime we reboot the phone? I may be wrong, just wanna clarify.
I dont have P769 device (good for me ), else I would have try that by now.
You can push the files and set permissions.
Flash your phone once to copy LGP769_AP[6].bin (it goes up to [10] and takes some time to extract the files, there should be enough time) from C:\ProgramData\LGMOBILEAX\Phone\ to some location.
Modify LGP769_AP[6].bin with a hex editor
Flash you phone once again,just like before you'll see lg flash tool decompressing files into C:\ProgramData\LGMOBILEAX\Phone\, when you see it done with LGP769_AP[6].bin copy/replace original with modded file, like before there should be enough time for it. Phone should be rooted after reboot.
hdcp.sh is setuid root and is executed at boot
Re: root p769 v10g and possibly other variants
Im very new to rooting. I've only rooted one phone(lg optimus p509). I now have my fancy new p769 and want some superuser action. I've been doing a lot of reading, and frankly, im worried about bricking or screwing up my new phone! When the more indepth description of your new found genius is released, could you please include details on exactly how to keep my phone safe and unbricked..THANKS!
Sent from my LG-P769 using xda premium
matts0807 said:
Im very new to rooting. I've only rooted one phone(lg optimus p509). I now have my fancy new p769 and want some superuser action. I've been doing a lot of reading, and frankly, im worried about bricking or screwing up my new phone! When the more indepth description of your new found genius is released, could you please include details on exactly how to keep my phone safe and unbricked..THANKS!
Sent from my LG-P769 using xda premium
Click to expand...
Click to collapse
As you say you are very new, I advice do not try this method at the moment. its very serious and you may brick your phone.
OK. My phone now rooted. But I only get root in adb shell only. Other root required app in phone don't popup Superuser dialog. My app cannot gain root access even I set "Automatic Response" to "Allow". Any Idea?
My phone firmware is p768f V10D, hdcp.sh is in LGP768_AP[5].bin. For other model I think your method should work if you can find proper file to edit (with hex edit).
Ha. Finally work. I replace su and Superuser from their website (After trial and error I don't know what the problem at first). I'm not sure if improper edit .bin file will brick your phone. So wait for some dev to confirm it. If you're not familiar with Hex editor I don't suggest you do this for now.
This may make me sound stupid, but could someone please post a clear set of directions to follow for this method. I think I understand it, but this is my only phone at the moment, and I don't want to screw it up because I swapped up a couple of steps.
For people who want to root LG L9 ICS Phone, please follow this guide http://forum.xda-developers.com/showthread.php?t=2173465
The method in this thread lack some steps to clean out rooting staff and script
For those who interest, below are the steps I did to root my phone from Lelus post info.
*** Please read it carefully and understand every step before you try. I cannot help you if you brick your phone. And please note that I'm not a android dev and these steps work for Lelus P769 10G and my P768f 10D. It should work in all variants but I'm not guarantee. ***
0. Find your KDZ at http://forum.xda-developers.com/showthread.php?t=2107971
1. Manually extract my kdz with LGExtract 0.2.1 from http://forum.xda-developers.com/showthread.php?t=1566532
2. Copy kdz (my file is V10D_00.kdz) and LGExtract.exe to C:\root\ , In command prompt just run
C:\root>LGExtract.exe -kdz V10D_00.kdz
3. You got V10D_00.cab
4. Extract cab with 7z or other zip program that can handle .cab (Google for it if you don't have it yet.) you got 2 files. LGP768.dll and V10D.wdb
5. Extract wdb with following command
C:\root>LGExtract.exe -wdb V10D.wdb LGP768.dll
*** don't forget my model is P768, you should change it to match the file you got ***
6. You'll found extracted files in BIN directory. After this step use your favorite Hex edit to search for hdcp.sh . I found it in LGP768_AP[5].bin. If you copy text from hex edit it look like following
# hdcp.sh
#
# [email protected], [email protected] , [email protected]
#
# HDCP sh file
#!/system/bin/sh
if ls /persist/mhl/key.bin ; then
echo "alreay exist" > /data/mhl.log
/system/xbin/hdcp-init 1 3 >> /data/mhl.log
echo "step 1 : hdcp on" >> /data/mhl.log
else
if ls /persist/en_hdcp.bin ; then
rm /persist/en_hdcp.bin
fi
echo "not exist" > /data/mhl.log
fi
7. In your hex editor, try to edit that file to following
#!/system/bin/sh
/data/local/tmp/rooting.sh
#.com , [email protected]
#
# HDCP sh file
#!/system/bin/sh
if ls /persist/mhl/key.bin ; then
echo "alreay exist" > /data/mhl.log
/system/xbin/hdcp-init 1 3 >> /data/mhl.log
echo "step 1 : hdcp on" >> /data/mhl.log
else
if ls /persist/en_hdcp.bin ; then
rm /persist/en_hdcp.bin
fi
echo "not exist" > /data/mhl.log
fi
*** for those who not familiar with Hex edit you must edit both left (HEX) and right side (TEXT) of editor because some characters is not on keyboard (ex. ENTER, just type 0a in left side editor to make ENTER key).
8. Trial and error until your copy text look like code above (you can copy your edited text from hex editor to text editor to examine it). Then save your file.
9. Next step is download all required file from Lelus link (or from my root.7z) and place them in C:\root
10. In command prompt run
cd C:\root
adb push su /data/local/tmp/
adb push busybox /data/local/tmp/
adb push Superuser.apk /data/local/tmp/
adb push rooting.sh /data/local/tmp/
adb shell chmod 777 /data/local/tmp/busybox
adb shell chmod 777 /data/local/tmp/rooting.sh
*** You can use adb.exe from http://forum.xda-developers.com/showthread.php?t=2085344 thread if you don't install android delveloper tools
11. All files should upload to your phone. After this step try to flash your normal unextracted kdz. You should open C:\ProgramData\LGMOBILEAX\Phone while flashing your rom. After kdz flash program show about 8% progress you should see that there are extract .bin files in that directory. Just quickly copy your edited .bin file (only the file that contain hdcp.sh script) and replace extracted file with it. *** you should wait for flash program to finish extract your file before replace it. ***
Read about how to flash your phone at http://forum.xda-developers.com/showthread.php?t=2085344
12. Done. You phone reboot with Superuser app install. If you have any problem like me that Superuser app don't popup to ask permission, please download latest version from http://androidsu.com/superuser/. I also upload updated files in root.7z below.
13. From Lelus' suggestion : After rooting I would probably suggest
adb shell rm /data/local/tmp/rooting.sh
adb shell touch /data/local/tmp/rooting.sh
adb shell chmod 755 /data/local/tmp/rooting.sh
Thanks Lelus for sharing this, :good:
Edit : Add updated Su, Superuser, LGExtract.exe, hex editor image and rooting.sh
Good one artit.
Do you think all LGP768_AP[5].bin (or other variants) are the same file (so we can uploaded a modified one and everyone can use it)?
Would this be a universal way of rooting all LG phone?
Thank You Lelus!
If this works everyone should click the "Thanks" button on Lelus' post.
---------- Post added at 09:35 AM ---------- Previous post was at 09:34 AM ----------
chicguy said:
Good one artit.
Do you think all LGP768_AP[5].bin (or other variants) are the same file (so we can uploaded a modified one and everyone can use it)?
Would this be a universal way of rooting all LG phone?
Click to expand...
Click to collapse
No. All bin files will be different since it holds the partitions and files that are loaded on the devices.
What I means is within the same variants, would it be the same kdz file downloaded? Then we can upload one bin file corresponding to each kdz file?
artit said:
1. Manually extract my kdz with LGExtract 0.2.1 from http://forum.xda-developers.com/showthread.php?t=1566532
2. Copy kdz (my file is V10D_00.kdz) and LGExtract.exe to C:\root\ , In command prompt just run
C:\root>LGExtract.exe -kdz V10D_00.kdz
3. You got V10D_00.cab
4. Extract cab with 7z or other zip program that can handle .cab (Google for it if you don't have it yet.) you got 2 files. LGP768.dll and V10D.wdb
5. Extract wdb with following command
C:\root>LGExtract.exe -wdb V10D.wdb LGP768.dll
*** don't forget my model is P768, you should change it to match the file you got ***
6. You'll found extracted files in BIN directory. After this step use your favorite Hex edit to search for hdcp.sh . I found it in LGP768_AP[5].bin. If you copy text from hex edit it look like following
Click to expand...
Click to collapse
Welldone! Artit! Thanks a lot.
For this same above process I have made a quick and small batch file of KDZ extraction tool and it keeps LGP768_AP
[*].bin files in single folder for further use.
By the way, when I looked for hdcp.sh in P760V10I, I found hdcp.sh in LGP760_AP[6].bin exactly as mentioned by Lelus. It seems the location of this text is different in BIN file and when extracting it goes to any piece of BINs, not always in 6th piece.
EDIT: Are you using Offline Flash method? Or online?
chicguy said:
What I means is within the same variants, would it be the same kdz file downloaded? Then we can upload one bin file corresponding to each kdz file?
Click to expand...
Click to collapse
I do not know.
I have modified .bin files for 11A and 10G on my home pc. I will upload them when I get home later if no one has already.
rooted
Thanks. Now i got P769bk us tmobile rooted.
Hash editor each hash key must match in same place. sd card removal helped.
Uploaded the V10g modded binary for P769. MD5 checksum included, but I forgot to change the directory in the file that checks it (but you can change it).
filedropper[dot]com/lgp769v10g-bin
gigasize[dot]com/get/t23b42m76yc
MD5: c2cbf3997a9ab7181c71c75d697db6f5
Where is the www[dot]zip file for the OFFLINE FOTA method of flashing (/showthread.php?t=2085344)?
EDIT: Please disregard this post. This was a result of a corrupted download. shttps.zip will include the www directory.
V11a rooted as well!