[Guide] Change default orientation to portrait! - Streak 5 General

After days (literally days...) of staring at this code trying to make sense of it (I am not a coder, but am the IT guy at a software company so that helped a litte), it finally started making sense and I found the one tiny change necissary to make the default orientation portrait. Since I cannot make the new .odex file for a specific build without installing it (which I dont want to do), I'll just post the instructions to do this yourself.
{
"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"
}
Disclaimer: The usual, I don't accept responsibility for any harm to your phone, any changes you make should be reversible if you mess up. These steps will only work for stock Dell roms. If you are on StreakDroid it can still be accomplished but is slightly different. You should only proceed if you have a decent knowledge of adb/shell/command line. This guide is intended for Windows PCs. Make a nandroid backup and/or backup your android.policy.odex
What you need
Android SDK (if you're a member of xda and you dont have this already then it's a must)
Java JDK
7-zip
Smali/Baksmali (download both jar files and rename them to remove the version number. For example rename 'baksmali-1.2.6.jar' to just 'baksmali.jar')
dexopt-wrapper (attached)
busybox (easiest way to install is to install titanium backup and select problems as many of you know from the superuser.zip root method)
your BOOTCLASSPATH (can be found in /init.rc on your phone)
Install the Android SDK, Java JDK, and 7-zip if you havent already. If you are installing the SDK for the first time you should probably familiarize yourself with the SDK first (lots of guides out there) then make sure to run SDK Manager and download the platform tools. Place the smali.jar and baksmali.jar files in the same folder as adb.exe (whether it be in the tools or platform tools folder or wherever you have moved adb). Place dexopt-wrapper on your Streak's sdcard.
Steps
> means a command (dont type the >)
1. Open a command window to the same folder as adb.exe (in Win7 ctrl + shift + right-click in the folder and select "open command window here")
2. Plug in your phone then pull the entire framework folder
> adb pull /system/framework/ framework
3. Decompile the android.policy.odex file
> cd framework
> java -jar ..\baksmali.jar -x android.policy.odex -o ..\androidpolicy
4. Navigate to the androidpolicy\com\android\internal\policy\impl folder and replace the PhoneWindowManager.smali with the one attached to this post.
5. Compile the code
> cd ..\
> java -jar smali.jar -o classes.dex androidpolicy
6. Add the resulting "classes.dex" file to the android.policy.jar file. To do this open the framework folder, right click on android.policy.jar and 7-zip -> open archive, drag the classes.dex into the 7-zip window so that you now see a META-INF folder and the classes.dex file. The resulting android.policy.jar should be around 96 KB in size.
7. Put the resulting android.policy.jar onto your phone sdcard. Fastest way is to put the jar file into the same folder as adb.exe and
> adb push android.policy.jar /sdcard/
8. Open shell
> adb shell
9. Become super user (if you havent done this before, make sure your phone is on so you can grant it superuser permissions)
> su
----------------------------------------------------------------------------
This section only needs to be done once
----------------------------------------------------------------------------
10. Put dexopt-wrapper into the correct folder with the correct permissions
> cd /system/bin/
> busybox cp /sdcard/dexopt-wrapper . (yes after dexopt-wrapper is a space and a period)
> busybox chmod 755 dexopt-wrapper
> cd /sdcard/
----------------------------------------------------------------------------
11. Create a new .odex file from the .jar file
> dexopt-wrapper android.policy.jar new.odex BOOTCLASSPATH
BOOTCLASSPATH should be the value of your bootclasspath from init.rc. For example my command looked like this (all one command):
dexopt-wrapper android.policy.jar new.odex /system/framework/core.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/kafdex.jar:/system/framework/OmaDrmClient.jar
12. Copy the "signature" from the original .odex file to the newly created one
> busybox dd if=/system/framework/android.policy.odex of=new.odex bs=1 count=20 skip=52 seek=52 conv=notrunc
13. Replace the original android.policy.odex with the new one (you will need to mount your /system/framework/ with r/w permissions, can be done with root explorer or this app
> cd /system/framework/
> busybox cp /sdcard/new.odex android.policy.odex
> busybox chmod 644 android.policy.odex
14. Done
> sync
> reboot
Your phone will now reboot, be patient as it may take slightly longer to boot up the first time. On initial bootup the lockscreen will still be in landscape with the sliders also in landscape. Just unlock, let the phone boot up some more, turn off the screen and turn it back on...
Troubleshooting
If for some reason you run into problems and your phone hangs at the dell logo...
1. Boot into recovery
2. Put the original android.policy.odex (the one in the framework folder) into the same folder as adb.exe
3. Open a command window to same folder as adb.exe (should still be open from the install steps)
4. Type the following commands
> adb shell mount /dev/block/mtdblock6 /system
> adb push android.policy.odex /system/framework/
5. Select the reboot option in the recovery menu and you should be back to stock.
For GingerStreak 2.4 look here - Thanks TheManii

If you use adw you can lock the screen to eitherportrait of landscape in settings. I haveit locked to landscape because I prefer it.

I prefer launcher pro for a few reasons and would like the lockscreen to be in portrait so that I don't have to use widgetlocker
Interesting note. I have compared the streak code for the file specified to the dell venue which is a portrait default device and they are identical...not sure what to think about that.

Think I found what needs to be changed, but must sleep. will report back tomorrow

Hope you will be able to sort this one out!
I am one of the many that want this fix.

Original post updated with guide!

good work! I will give it a try soon.
Sent from my Dell Streak using XDA App

I'm having a headache just reading the instructions! Ha ha. I guess I'll just wait for jhotmann or another android genius to come up with a Recovery flashable .pkg or even an installable .apk, whichever is feasible. Great work, jhotmann!

jhotmann, maybe you can share this mod of yours with Dj_steve. He might be able to incorporate it into a new ROM.

I have messaged steve on twitter. I know krad can do this and he's probably on the latest build.
Sent from my Dell Streak 2.2.1 (339)

Amazing! It's a phone now, not a Tablet! It worked perfectly for me!

Very nice, but not so easy. I am at the 11. and can't find when to get BOOTCLASSPATH. I know it is in init.rc in the phone, I can find it with ASTRO file manager or with adb shell, but I don't know how to open it and get BOOTCLASSPATH??? Please help somebody. I was trying to find it on the internet but no success...
Thank you in advance

Type exit to get out of shell (you may have to do it twice), then adb pull /init.rc
Sent from my Dell Streak 2.2.1 (339)

Thank you for your effort, but it says permission denied. I tried to reopen command line (always as admin), but id didn't help. Found somewhere operation 'adb remount', but it didn't help either (Operation not permitted).
I have rooted Dell Streak with Gingerbreak, maybe this information will help.
However, I copied init.rc with busybox to my sdcard and get it from there, but now I can't open it (I found, that it can be open with MS Visual Studio, then tried Notepad plus, Total commander... always just mess of black squares etc.)
I guess I am too tired today, but I will try to finish this tomorrow, because I really want Dell Streak in portrait and it is only 4 more steps
But thank you anyway, I must be really hard to find this. The way is not easy but at least it can be accomplished now

Weird, I have had no problems opening it in notepad. Theres a good chance the bootclasspath is the same as mine so you can probably copy it from my example

Nice work!! Too bad I'm not on stock. Hopefully Steve will integrate this in 1.9.1

Edrill said:
Nice work!! Too bad I'm not on stock. Hopefully Steve will integrate this in 1.9.1
Click to expand...
Click to collapse
Steve said it'll be there but not active by default, so it's a go!
Question: So can we now lock the default orientation to portrait for apps like the dialer? I'm using us240 density and the landscape dialer while in a call or when you receive a call hides the name of the person and looks ugly.

the entire system can be locked to portrait. Or you could probably set up a tasker to lock the phone app (and contacts app) in portrait if you dont want the whole system locked in portrait.
Edit: just created a tasker profile to do that...good call sir

Can you port cyanogen 7 to streak. Just loaded a nightly on my ole craptivate and it had 2.3.4 ginger goodness.
Sent from my Dell Streak

jhotmann said:
I have messaged steve on twitter. I know krad can do this and he's probably on the latest build.
Sent from my Dell Streak 2.2.1 (339)
Click to expand...
Click to collapse
Thanks jhotmann!

Related

[Guide] Setting up ADB [Windows]

This guide was originally written by ante0 on VillainROM.co.uk. For the original click here. Due to some people having issues accessing VillainROM's website I have asked ante0 to give me permission to post the guide here. He happily obliged so thanks go to ante0 for this guide!
All I have done to it is change the layout and remove any unnecessary text.
Tools needed:
Android SDK
HTC Sync 3.0.5387 - get the latest if this is old
WinRAR - to extract Android's SDK files
Patience and time
1. Getting ADB (Android Debug Bridge)
ADB is a part of android's SDK. It can be obtained here. Please get the latest Windows version.
Next we need to "install" it.
This is done by simply extracting it to your hard drive:
Install WinRar, then right click on the zip file and choose "extract to".
I chose C:\ as the folder in the zip is named "android-sdk-windows", so you can find the files in C:\android-sdk-windows
After that is done we are now done with the "installing" part.
2. Setting up environment variables - access adb from outside of \android-sdk-windows\tools directory in a command prompt
Now that we have extracted all files we need to set up Windows environment variables to make our lives easier.
I always do this, because it saves you having to cd C:\android-sdk-windows\tools every time you load a cmd prompt.
Windows XP:
Right click on "My computer" and select "Properties"
Click on the "Advanced" tab in the box that appears, looks like the pic below.
{
"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"
}
Click on the button named "Environment Variables".
Now, double click on the text entry named "Path" in the lower list box
At the end of it, add ";C:\android-sdk-windows\Tools"
(";" is required at the start so windows knows it's a new entry.)
Click on OK to exit out of the dialog, then OK again to get out of My computer's properties. After you reboot your computer you'll have it set up.
Windows 7/Vista:
Right click on "Computer" and select "Properties"
In the System window that appears click on "Advanced System settings" located in the left list
Click on the Advanced tab in the box that appears, then on the "environment variables" button.
Double click on "Path" located in the lower list box.
At the end of it, add ";C:\android-sdk-windows\Tools"
(";" is required at the start so windows knows it's a new entry.)
Now click on OK, then OK again to exit. Restart and all will be set up.
3. Making sure USB works
(original guide linked to my old driver guide - here are new details)
Install the very latest version of HTC Sync - 3.0.5387 is the latest at time of writing but get the latest if this is old
This should install the correct drivers regardless of whether you're on 64-bit, 32-bit, Vista, 7 or XP.
4. Using ADB
(unedited)
I won't list all commands you can use here. I will only list some examples...
Remember to plug your phone in your usb cable (I've forgotten sometimes... lol)
Start by opening a command prompt.
This is done by opening up the startmenu then click on "Run..." (Alternative way: Windowskey + R).
In the "Run..." box, enter "cmd" without quotes.
If you have some knowledge of using a cmd prompt you don't need to read the next part.
To navigate you mainly use the commands CD and DIR.
Here's an image of what it looks like
C:\Documents and settings\jwork> tells you what your current working folder is.
To get out of it, use the command "cd ..".
This will go back one folder, so your new location will be C:\Documents and settings>
One more "cd .." will take you to C:\.
Now, lets say you have a folder named Images in C:\. To enter it you use "cd Images".
If you want to list all files in that folder, enter the command "dir".
Now you might have a image named image01.jpg in that folder, that you want to get to your phone.
Use the command adb push image01.jpg /sdcard/
It should notify you now if the push was successful.
You can check if the image is on your sdcard by using the command "adb shell ls /sdcard/".
That should conclude this guide...
One more thing, if you just enter "adb" it will show a list of all commands with descriptions.
Any questions? Just post here.
Hi
i really need some help here. whenever i type adb into the command box , i get "adb" is not recognised as an internal or external command , operable program or batch file. But i have alrdy installed the ADB by extracting it to a folder.
Right now im trying to install a custom rom and im stuck at accessing the recovery page pls help meee
Sounds like you haven't successfully added adb to your DOS path. Re-read section 2 again and make sure you followed the instructions correctly.
Great guide man, very nice work
That's awesome!!! It's a nice tutorial for the newbies! And it benefits me, I reli like it!!
Thx!!!
Sent from my E15i using XDA App
jubo1236 said:
Hi
i really need some help here. whenever i type adb into the command box , i get "adb" is not recognised as an internal or external command , operable program or batch file. But i have alrdy installed the ADB by extracting it to a folder.
Right now im trying to install a custom rom and im stuck at accessing the recovery page pls help meee
Click to expand...
Click to collapse
I had the same problem because the path was incorrect. I found the adb command in
Code:
android-sdk-windows/platform-tools/
rather than in
Code:
android-sdk-windows/tools/
btdag said:
1. Getting ADB (Android Debug Bridge)
ADB is a part of android's SDK. It can be obtained here. Please get the latest Windows version.
Click to expand...
Click to collapse
hi,
thanks for the explanation both for you and ante0 but can you reload the link if possible becaue i cannot download the file for the first step? it gives error
No matter what I do. I always get the "adb" is not recognised as an internal or external command , operable program or batch file. What am I doing wrong?
Google has recently changed where adb can be found in the sdk. Just un-zip it anywhere i recommend the C drive, so it should look like this C:\android-sdk-windows\
Then browse to this folder and launch 'SDK Manager'
Open the window 'Choose packages to install' (it should open automatically first time) and choose to install the 'Android SDK Platform-tools, revision *'
To set the variable paths, do as in the first post and add these variable strings (assuming you unzipped it to C:\android-sdk-windows\ if not just modify it so it matches where you unzipped it to
Code:
;c:\android-sdk-windows\tools;c:\android-sdk-windows\platform-tools
Then you're good to go!
After doing all the above stated i still can't execute any commands. I typed "adb devices" and it just says the devices that are linked but it doesn't give me a serial number.
NeatBee said:
Google has recently changed where adb can be found in the sdk. Just un-zip it anywhere i recommend the C drive, so it should look like this C:\android-sdk-windows\
Then browse to this folder and launch 'SDK Manager'
Open the window 'Choose packages to install' (it should open automatically first time) and choose to install the 'Android SDK Platform-tools, revision *'
To set the variable paths, do as in the first post and add these variable strings (assuming you unzipped it to C:\android-sdk-windows\ if not just modify it so it matches where you unzipped it to
Code:
;c:\android-sdk-windows\tools;c:\android-sdk-windows\platform-tools
Then you're good to go!
Click to expand...
Click to collapse
What does it say? Copy it to here
Sent from my Hero using Tapatalk
I have tried to restart the computer, sign in and out, install SDK again and again, changed the PATH in Enviromentor variables ... but still refuses ADB to work!
I typed "C: \ android-sdk-windows \-platform tools," in the PATH box and restarted the computer. Then I typed "adb" in CMD, but it is all the time: "'adb' Is Not Recognized as an internal or external command,
operable program or batch file. "
Is crazy! What is the problem?
BTW, I have installed the driver for my phone and selected "USB debugging".
You've typed the path wrong. Delete the path you've already put in it and copy this one
Code:
;C:/android-sdk-windows/platform-tools/;C:/android-sdk-windows/tools/;
hello
NeatBee said:
You've typed the path wrong. Delete the path you've already put in it and copy this one
Code:
;C:/android-sdk-windows/platform-tools/;C:/android-sdk-windows/tools/;
Click to expand...
Click to collapse
I think you are using wrong format, \ instead of /
For me I used "C:\Program Files\Android\android-sdk-windows\platform-tools\;C:\android-sdk-windows\tools\;"
in order to make it work"....ignore quotes.
Yet when I try to do the push command with some files
it gives me error: devise not found
anyone have clue?!
Thanks
This guide is rock solid! Thanks
mm realy need to learn to use adb been flashing my hero for over a year now and still dont know how adb works
sorry for the silly question but will the same steps help to setup a path for windows 7
because i really need to know how to use it as well if someone acn post a link for steps to use it it would be really appreaciated
thanks
EDIT: extremely sorry did not read the full post there is already a guide for windows 7
thanks for the post
ok so i have tried all of the above steps
i now get adbd cannot run in production builds
thanks alot
once i get adb all set up and it works fine - can i uninstall HTC sync and HTC driver? will adb still work?

[HOW TO]Unlocking method for "file not found" problem

Before we start, ROOT access, along with the "usb debugging" to be enabled on your phone for this unlock to be successful. Your phone must be connected to the computer.
UPDATE:One-click unlock for PC & MAC Created: http://forum.xda-developers.com/showthread.php?t=761751
The first step requires ADB which is a console that comes with the Android SDK, and is located in the C:\ Drive.
You can create a easy script to access adb by creating a text file and copying the following information:
Code:
@echo off
cd c:\android-sdk-windows\Tools
adb devices
pause
adb shell
NOTE: The android sdk must be in the C:\ drive for the script to work, and you can rename the "android-sdk-windows" to something else if you have an alternate name for your android sdk folder.
name the script ADB, and rename the .txt extension to .bat (enable view hidden file extensions in folder options) and run it for quick, and easy access to adb.
Now that problem is solved, lets get on to extracting the actual file from the internal sd card, to your computer for the purpose of extracting the unlock code.
Run adb.bat to open up adb, or any other method you might use and you should see a cmd promt with A list of the devices attached along with your device.
Press any key, and you should see a $ -----> type "su" (without the quotation marks) and press [ENTER]. If your device has already granted "su" or Superuser permissions to your desktop adb console, then you should see a # now you type
the following:
cat /efs/nv_data.bin >> /sdcard/nv_data.bin
press [ENTER] and you should see a repetition of the command you just typed with the difference being that the "#" is not before it, but under it.
You have successfully transferred the file to your internal sd card!
{
"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"
}
Now to transferring the file that we will obtain the unlock code, to the computer to extract said code.
On your phone (while still connected to the computer) you must mount the USB storage to extract the file off the internal SD card, (to do this drag the notification bar down while connected, and click the "usb connected" button, which will prompt a pop up for "Mount" and "Don't Mount", we'll be mounting the sd card to extract the file)
now check "my computer" and look for the storage disk of the internal sd card for your phone (not the external!)
then move the "nv_data.bin" file to your C:\ drive
Now you need to download the "sgux.exe" unlock code finder, you can find it at the following:
http://www.mediafire.com/?js8dgn3nic5asb0 or http://www.multiupload.com/2IAYWWGF8A
after downloading the file from either mirror (the media fire one is zipped, which means you need to extract it) you need to move the sgux.exe file to your C:\
Now onto the last step:Obtaining the Code!
after having both the sgux.exe, and nv_data.bin file in the C:\ drive
Run your command promt (run>cmd or if you have a "windows key" press the windows key+r) in the command prompt type "cd C:\" (without the quotation marks) then sgux.exe nv_data.bin and voila the proccess should generate your own 8-digit unlock code!!
Now give yourself a pat on the back for your hard work ;P
HOW TO LOCK SAMSUNG GALAXY S - FOR WARRANTY AND ALTERNATIVE "UNLOCK"
After you get the NCK code using the method above, enter: *7465625*638*#
There will be a pop-up box.
Complete the first field (MCC/MNC) with the network you want your phone locked to (eg. 226 10 where 226 = romania; 10 = orange etc.) and the second field (Control Key) with the NCK extracted from the .bin file.
Press OK and your phone should relock.
This method can also be used in the case where the universal unlock code doesn't work, this is done by "locking the device to the carrier+sim" so someone who uses Rogers in Canada, would use the NETWORK "MCC" for their Country (302) and MNC for the carrier (720) so you use 302 720 with the instructions above to lock the phone to Rogers in Canada, thus allowing you to use the sim card. This is a "unlock" in terms that you can use it with another carrier, but not a "universal" unlock that can be used with any carrier without the hassle of repeating the above method.
Here are the MCC/MNC country codes:
http://en.wikipedia.org/wiki/Mobile_Network_Code
HOW TO UNLOCK AFTER PLACING DIFFERENT SIM
After inserting new sim, you should be prompted to enter unlock code, if not then to unlock your phone just use the code: #7465625*638*# and enter your NCK in the pop-up box. Press OK. Phone should get unlocked .
Click to expand...
Click to collapse
NOTE: Below I have attached the "adb.bat script, and the sgux.exe" files in zips, for those who want to download it directly from here.
I have flashed to JM5 and with Samset 1.9f, It comes pre-rooted but does not have a terminal emulator yet and Id like to give this a try on my locked Galaxy S, but Im not familiar with how to get ADB for my computer.. maybe you can add the steps or post another link for ADB ?
EarlZ said:
I have flashed to JM5 and with Samset 1.9f, It comes pre-rooted but does not have a terminal emulator yet and Id like to give this a try on my locked Galaxy S, but Im not familiar with how to get ADB for my computer.. maybe you can add the steps or post another link for ADB ?
Click to expand...
Click to collapse
I've included all the instruction for running ADB , but in that case make sure you have the android sdk installed
You can download it at the following:
http://dl.google.com/android/android-sdk_r06-windows.zip
Extract the zip, and then just follow my instructions in my original post.
I've also included a script to run it directly, it's attached in the first post and is called "adb.zip" that has the adb.bat script inside.
UPDATE:
You can also use the original method
http://forum.xda-developers.com/showpost.php?p=7776555&postcount=1
but instead of the adb code in there which is the following:
Code:
adb shell
su
dd if=/dev/block/bml3 of=/sdcard/bml3.bak
the above is the original method, but for some adb consoles there's a VITAL step missing!
the actual dev directory.
So below is the fix for the first method to work (use this)
Code:
adb shell
cd /dev/block
su
dd if=/dev/block/bml3 of=/sdcard/bml3.bak
Bowsa2511 said:
UPDATE:
You can also use the original method
http://forum.xda-developers.com/showpost.php?p=7776555&postcount=1
but instead of the adb code in there which is the following:
Code:
adb shell
su
dd if=/dev/block/bml3 of=/sdcard/bml3.bak
the above is the original method, but for some adb consoles there's a VITAL step missing!
the actual dev directory.
So below is the fix for the first method to work (use this)
Code:
adb shell
cd /dev/block
su
dd if=/dev/block/bml3 of=/sdcard/bml3.bak
Click to expand...
Click to collapse
the cd /dev/block shouldn't matter but I will add it to the guide
dagentooboy said:
the cd /dev/block shouldn't matter but I will add it to the guide
Click to expand...
Click to collapse
In my case (along with others) it wouldn't recognize and direct to the directory automatically, causing the creation of the nv_data.bin method.
The simple fix was directing adb to that directory XD
Bowsa2511 said:
In my case (along with others) it wouldn't recognize and direct to the directory automatically, causing the creation of the nv_data.bin method.
The simple fix was directing adb to that directory XD
Click to expand...
Click to collapse
ok sounds good. I found the nv_data.bin method by tracing where bml3 was being mounted. It turns out bml3 is mounted at /efs .... that is probably why you need su to copy bml3 because it is in use.
guys, could you please explain how to sim unlock but with some easier methods
these ADB and so on just have eaten my brains
spent 3 hours and 0 result
using mac os + windows 7 as virtual machine
DarkVasyaK said:
guys, could you please explain how to sim unlock but with some easier methods
these ADB and so on just have eaten my brains
spent 3 hours and 0 result
using mac os + windows 7 as virtual machine
Click to expand...
Click to collapse
Check out the original thread here. I updated it with an automatic script to generate the code.
It Worked.............great................Thank you so much.......
thansk for this!
Instructions worked perfectly ... got my code!
Now just have to find a foreign SIM to complete the job ...
Thanks to all that made this possible. AT&T was being a real PITA about unlocking.
Bowsa2511 said:
Before we start, ROOT access, along with the "usb debugging" to be enabled on your phone for this unlock to be successful. Your phone must be connected to the computer.
The first step requires ADB which is a console that comes with the Android SDK, and is located in the C:\ Drive.
You can create a easy script to access adb by creating a text file and copying the following information:
Code:
@echo off
cd c:\android-sdk-windows\Tools
adb devices
pause
adb shell
NOTE: The android sdk must be in the C:\ drive for the script to work, and you can rename the "android-sdk-windows" to something else if you have an alternate name for your android sdk folder.
name the script ADB, and rename the .txt extension to .bat (enable view hidden file extensions in folder options) and run it for quick, and easy access to adb.
Now that problem is solved, lets get on to extracting the actual file from the internal sd card, to your computer for the purpose of extracting the unlock code.
Run adb.bat to open up adb, or any other method you might use and you should see a cmd promt with A list of the devices attached along with your device.
Press any key, and you should see a $ -----> type "su" (without the quotation marks) and press [ENTER]. If your device has already granted "su" or Superuser permissions to your desktop adb console, then you should see a # now you type
the following:
cat /efs/nv_data.bin >> /sdcard/nv_data.bin
press [ENTER] and you should see a repetition of the command you just typed with the difference being that the "#" is not before it, but under it.
NOTE: Below I have attached the "adb.bat script, and the sgux.exe" files in zips, for those who want to download it directly from here.
Click to expand...
Click to collapse
Thank you for your step by step sir, very helpful, as i was trying to figure out how to get ADB running on my PC.
Thanks again.
not working...tried all methods for pc
tried adb method and cannot create nv_data.bin file system is read-only
tried unlocker app and it says NO CODES FOUND, and also says are you sure your using a samsung galaxy S.
my phone is samsung i897 captivate under att contract, never had to enter a code in the past, but now the phone is locked and i cant retrieve the code, any ideas?
Help please
i´ve tried to unlock have searched der nv_data.bin with a root explorer app, copied this to sd and from there in my folder c:\hack, where the sgux.exe is also
I run it and following i see if its ready:
Opening file <nv.bata.bin>....
Searching code block....
Found
Searching Code...
C:\hack>
where is my code?
Please help
Awesome guide! Can't wait to get my phone monday
I tried adb, and when I type su I get a reply superuser denied, don't understand why, need help
bump......
After running sgux.exe nv_data.bin, this is what show up:
MCC/MNC lock :00101
Any idea?
I'm on att, but currently roaming in China...
after I type su, it say's "Permission denied" what am I doing wrong? Can some please help me

[Q] Randomised boot animations?

Would it be at all possible to get something like this made for Defy?
This is a script from Galaxy Nexus forums, so I don't think it would work on Defy..
http://forum.xda-developers.com/showthread.php?t=1434950
What it Does
There are various apps out there that can achieve the same result but this is a simple script that uses a random number generator to swap in a random boot animation each time you boot. The script runs one just before the animation and never again until you boot the next time.
You can have any number of animations that will randomise and you can also set a flag to have just one run without needing to delete the others.
Click to expand...
Click to collapse
Couldn't you write a quick shell script to randomly choose a file from SD and copy it over the current bootanimation.zip? It would be executed after boot finishes, perhaps by an app to manage scripts. Just an Idea.
ArRaY92 said:
Couldn't you write a quick shell script to randomly choose a file from SD and copy it over the current bootanimation.zip? It would be executed after boot finishes, perhaps by an app to manage scripts. Just an Idea.
Click to expand...
Click to collapse
I haven't a clue :s I really hope it can be done though.. there are so many awesome boot animations!
Plus I'm making one of my own... or trying to.
Hoping for someone who knows about scripts and things
Okay, I think I will have a go. Let me just find out how to get a random number in unix shell that is in a certain range.
okay, so lets try.
Code:
#!/system/bin/sh -
#Change folder
cd /mnt/sdcard/bootanimations
ls > list
#Get random file
set -- *
length=$#
ran=$(hexdump -e '1/1 "%d"' -n 1 /dev/urandom)
rand=$(( $ran % ($length + 1) ))
file=$(sed -n "${rand}"p list)
#Copy over old animation
cp -f "$file" /system/media/bootanimation.zip
echo "successful if 0: " $?
rm list
Works now, took a piece of code from the other script because I could not get ${!rand} to work on the phone.
Works great for pictures and such too.
ArRaY92 said:
Okay, I think I will have a go. Let me just find out how to get a random number in unix shell that is in a certain range.
Click to expand...
Click to collapse
Perhaps looking at the script I linked to will help?
My script should work, only drop animations into /sdcard/bootanimations.
run once after boot with smanager from playstore
ArRaY92 said:
My script should work, only drop animations into /sdcard/bootanimations.
run once after boot with smanager from playstore
Click to expand...
Click to collapse
I'll give it a try!
After running this I reboot (a couple) and test it?
I'm assuming it needs SU in SManager?
Is this a patch? Will it need anything to remove it if it doesn't work and I can't a boot?
Sorry haha
pk92 said:
I'll give it a try!
After running this I reboot (a couple) and test it?
I'm assuming it needs SU in SManager?
Is this a patch? Will it need anything to remove it if it doesn't work and I can't a boot?
Sorry haha
Click to expand...
Click to collapse
No, this is only a small shell script. I think it needs SU to copy the animation over the existing one.
I am however not sure, if cp copies over the old file without forcing, let me look this up
You can just delete it from sManager if it does not work. Will not prevent you from booting if it fails, phone boots fine without animation. In case of failure, I would however think that it would just fail to change the animation
edit: I added the -f flag to cp.
ArRaY92 said:
No, this is only a small shell script. I think it needs SU to copy the animation over the existing one.
I am however not sure, if cp copies over the old file without forcing, let me look this up
You can just delete it from sManager if it does not work. Will not prevent you from booting if it fails, phone boots fine without animation. In case of failure, I would however think that it would just fail to change the animation
edit: I added the -f flag to cp.
Click to expand...
Click to collapse
Thanks so much for writing it by the way
I'd take a guess that it does need SU to copy the animation, as it is going to a root directory (/system/media).
Does your script mount /system/media as RW or is that not needed in a script? (I have NO idea haha, I'm studying Software Dev but no idea about Android development).
I'll try it out later tonight when I get home (Going out for a few drinks)
pk92 said:
Thanks so much for writing it by the way
I'd take a guess that it does need SU to copy the animation, as it is going to a root directory (/system/media).
Does your script mount /system/media as RW or is that not needed in a script? (I have NO idea haha, I'm studying Software Dev but no idea about Android development).
I'll try it out later tonight when I get home (Going out for a few drinks)
Click to expand...
Click to collapse
Will test it on my own mobile now.
edit: **** wont work
For the hell of it, I cant make it work with sh. Bash works nicely. Most stupid thing is: sManager always forces sh when executing scripts. If you tap on start konsole from within sManager, it starts /system/xbin/bash. calling the script from there works.
I have no Idea for a clean workaround
ArRaY92 said:
Will test it on my own mobile now.
edit: **** wont work
For the hell of it, I cant make it work with sh. Bash works nicely. Most stupid thing is: sManager always forces sh when executing scripts. If you tap on start konsole from within sManager, it starts /system/xbin/bash. calling the script from there works.
I have no Idea for a clean workaround
Click to expand...
Click to collapse
Will I have to run the script each boot? Sorry for all the questions haha.
I'm trying to make my own Boot Animation at the moment... Using Flash CS6 for now..
The part0 (non loop) will be drawing the Pentagram, then the elements appearing
The part1 (loop) will be the elements animated until boot.
I'll be using it with this Boot Logo
{
"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"
}
https://dl.dropbox.com/u/25175326/bootlogos/pentagram.raw
Ok, The only problem I get now is this:
Code:
localhost bootanimations # cp -f $file /system/media/bootanimation.zip
cp: can't create '/system/media/bootanimation.zip' : File Exists
Going to try deleting the boot animation from there and running.
-EDIT-
Deleted /system/media/bootanimation.zip
Ran the script
Ended up with the default Android boot animation :|
Hm. I added the -f to force overwriting. For me it works, I tried it with pictures, every time the the script is executed, I have another picture with the same name. Only make sure to not include sub folders or other files then zip files in the folder.
Sent from my MB525 using xda app-developers app
ArRaY92 said:
Hm. I added the -f to force overwriting. For me it works, I tried it with pictures, every time the the script is executed, I have another picture with the same name. Only make sure to not include sub folders or other files then zip files in the folder.
Sent from my MB525 using xda app-developers app
Click to expand...
Click to collapse
Does the script need to be ran each boot to work?
My process:
Open SManager
Click script - Edit - Copy all
Menu > Console
Run Shell
Hold screen - Paste
No errors at all
Back button - Kill
Reboot (normal)
/sdcard/bootanimations contains the following files:
"Portal.zip"
"CM9.zip"
The only one that seems to run is Portal.zip, making me think that it does need to be run each boot.. Any way around this?
Perhaps it being a flashable zip that does something along these lines or this or something ?
Possible way to get it to run at startup:
Install Autostart (Root)
Download the script Autostart.sh and place it at /data/opt/autostart.sh (Permissions 755 I think)
Place your Boot Animations in /sdcard/bootanimations - They can be named anything.
Reboot your phone, and the script should run
When you next reboot your phone you should have random boot animations working..
This is all just theory so far, I haven't tested it yet!
Nevermind, It seems the Autostart app doesn't work on ICS (so I'm assuming JB too.)
Perhaps a flashable .zip is the best way, editing system files
pk92 said:
Does the script need to be ran each boot to work?
My process:
Open SManager
Click script - Edit - Copy all
Menu > Console
Run Shell
Hold screen - Paste
No errors at all
Back button - Kill
Reboot (normal)
/sdcard/bootanimations contains the following files:
"Portal.zip"
"CM9.zip"
The only one that seems to run is Portal.zip, making me think that it does need to be run each boot.. Any way around this?
Perhaps it being a flashable zip that does something along these lines or this or something ?
Click to expand...
Click to collapse
What shell does smanager open?
Also, did you try just creating a script.sh file with the code I posted and when opening it in sManager klick run? Without any copy and paste?
There is even a button to give su rights to script.
ArRaY92 said:
What shell does smanager open?
Also, did you try just creating a script.sh file with the code I posted and when opening it in sManager klick run? Without any copy and paste?
There is even a button to give su rights to script.
Click to expand...
Click to collapse
After I click run shell it says:
Code:
exec sh -c "cd '/mnt/sdcard' ; exec /system/xbin/bash"
dcard' ; exec /system/xbin/bash"
[COLOR="Red"]localhost[/COLOR] [COLOR="Blue"]sdcard #[/COLOR]
No errors, but the boot anim doesn't seem to change (from what I can see)
I did try saving it as a .sh and open in sManager but you said it only uses sh not bash?
Result of running .sh file without editing anything:
Code:
exec sh 'mnt/sdcard/Random Boot Animation.sh'
andom Boot Animation.sh' <
:not found/Random Boot Animation.sh:line 2:
/mtn/sdcard/Random Boot Animation.sh: cd: line 4:
can't cd to /mnt/sdcard/bootanimations
/mnt/sdcard/Random Boot Animation.sh: line 5: ca:
read-only file system
:not found/random Boot Animation.sh: line 6:
sed: list: No such file or directory
:not found /Random Boot Animation.sh: line 13:
': no such file or directory
Seems to be a bit... messed up lol
(when running as executable i get this:
Code:
# exec sh -c '/mnt/sdcard/script.sh'
sh: /mnt/sdcard/script.sh: Permission Denied
Code:
#!/system/bin/sh -
#Change folder
cd /mnt/sdcard/bootanimations
rm list
ls > list
#Get random file
set -- *
length=$#
ran=$(hexdump -e '1/1 "%d"' -n 1 /dev/urandom)
rand=$(( $ran % ($length + 1) ))
file=$(sed -n "${rand}"p list)
#Copy over old animation
cp -f "$file" /system/media/bootanimation.zip
echo "successful if 0: " $?
This one works for me reliably...
pk92 said:
After I click run shell it says:
Code:
exec sh -c "cd '/mnt/sdcard' ; exec /system/xbin/bash"
dcard' ; exec /system/xbin/bash"
[COLOR="Red"]localhost[/COLOR] [COLOR="Blue"]sdcard #[/COLOR]
No errors, but the boot anim doesn't seem to change (from what I can see)
I did try saving it as a .sh and open in sManager but you said it only uses sh not bash?
Result of running .sh file without editing anything:
Code:
exec sh 'mnt/sdcard/Random Boot Animation.sh'
andom Boot Animation.sh' <
:not found/Random Boot Animation.sh:line 2:
/mtn/sdcard/Random Boot Animation.sh: cd: line 4:
can't cd to /mnt/sdcard/bootanimations
/mnt/sdcard/Random Boot Animation.sh: line 5: ca:
read-only file system
:not found/random Boot Animation.sh: line 6:
sed: list: No such file or directory
:not found /Random Boot Animation.sh: line 13:
': no such file or directory
Seems to be a bit... messed up lol
(when running as executable i get this:
Code:
# exec sh -c '/mnt/sdcard/script.sh'
sh: /mnt/sdcard/script.sh: Permission Denied
Click to expand...
Click to collapse
Sorry for my intermission.
The
:not found/random Boot Animation.sh: line 6:
line, is related with EOL. You are using MS-Dos end of line, but Android (as linux, unix based system) needs Unix end of line for scripts.
When I edit script on Windows, I use Scite it allows change and convert EOL.
There is a lot of Text editors whith this EOL feature.
I would like implement EOL check in SManager, but it is my eternal TODO.
Regards,
Devwom
devwom said:
Sorry for my intermission.
The
:not found/random Boot Animation.sh: line 6:
line, is related with EOL. You are using MS-Dos end of line, but Android (as linux, unix based system) needs Unix end of line for scripts.
When I edit script on Windows, I use Scite it allows change and convert EOL.
There is a lot of Text editors whith this EOL feature.
I would like implement EOL check in SManager, but it is my eternal TODO.
Regards,
Devwom
Click to expand...
Click to collapse
So you wrote sManager? Nice work. One thing that bothers me though, is that if you start a console it starts up bash, but if you run a script it forces sh. That really sucks for testing. Please correct me if I am wrong, or if you have any advice.
Also, the design is kind of old But as long as it works...

[Q] I deleted my launcher. [Resolved]

I was deleting unused apps from my phone and, like an idiot, I deleted my only installed launcher. The phone boots and I can access the settings. I have a launcher installed and it shows up in menu/ settings/ app but it wont start and I don't know how to start it. I do have adb and fastboot though I don't have wireless internet. This device is not activated and there is no gmail account linked to this device. I did create a zip of a launcher and tried to flash it through recovery but that didn't work. I do not have a custom recovery installed but I did root the device. Is there a way to get a launcher installed and working so I can use this device again?
Grab the APK file for the stock launcher (or any launcher of your choice), connect your phone to the computer via USB with debugging on and install the launcher using this ADB command:
adb install launcher.apk
Make sure to replace launcher.apk with the exact name of the APK file, of course. You might need to copy the launcher to your SDK's platform-tools folder and run this command while in that directory as well, if the folder hasn't already been added to your PATH variable.
Once done, reboot your device. You can then use any root-enabled file manager to simply copy the launcher's APK file into /system/app to make sure you have one installed as a system app all the time, though make sure to fix its permissions to rw-r--r-- (644).
HQRaja said:
Grab the APK file for the stock launcher (or any launcher of your choice), connect your phone to the computer via USB with debugging on and install the launcher using this ADB command:
adb install launcher.apk
Make sure to replace launcher.apk with the exact name of the APK file, of course. You might need to copy the launcher to your SDK's platform-tools folder and run this command while in that directory as well, if the folder hasn't already been added to your PATH variable.
Once done, reboot your device. You can then use any root-enabled file manager to simply copy the launcher's APK file into /system/app to make sure you have one installed as a system app all the time, though make sure to fix its permissions to rw-r--r-- (644).
Click to expand...
Click to collapse
Thank you for your reply.
I already pushed the the launcher apk through adb and it installed on my phone from everything I can see. However even though it installed I do not know how to start it. I do not know how to gain access to a file manager as I do not access to any of my apps through the app drawer. Is there a way to activate and use an app without being able to access it in the drawer?
That's weird. Did you restart your phone? Upon every restart, Android looks for any installed launcher apps and if there's only a single one installed, it automatically loads it up. In case there are multiple launchers installed, Android loads a default one if set, or offers you to select one if you haven't set any as default. If you have installed a launcher via ADB by now, it should be loading upon device reboot. Try a different launcher's APK maybe? If it still doesn't work, try fixing permissions manually via ADB, or via recovery. Also, try installing it as a system app i.e. adb push Launcher.apk /system/app/ and don't forget to fix permissions to rw-r--r-- (644).
HQRaja said:
That's weird. Did you restart your phone? Upon every restart, Android looks for any installed launcher apps and if there's only a single one installed, it automatically loads it up. In case there are multiple launchers installed, Android loads a default one if set, or offers you to select one if you haven't set any as default. If you have installed a launcher via ADB by now, it should be loading upon device reboot. Try a different launcher's APK maybe? If it still doesn't work, try fixing permissions manually via ADB, or via recovery. Also, try installing it as a system app i.e. adb push Launcher.apk /system/app/ and don't forget to fix permissions to rw-r--r-- (644).
Click to expand...
Click to collapse
I will get right to doing that, and see how it turns out thank you and please stay tuned.
Update: I attempted the command to push it to the system/app and my return read "failed to copy 'apex.apk' to ' /system/app/apex.apk': Read-only file system"
It sounds to me upon reading that, that if I fix permission to make the file system read/write then this command will work. However, I do not know the commend to make that change.
No, you don't get read/write access by fixing permissions. The error that you get asically means you don't have system write access via ADB at the moment. Try this:
Code:
adb remount
adb push Launcher.apk /system/app/
adb shell
su
chmod 644 /system/app/Launcher.apk
exit
exit
adb reboot
The above method should work if your current kernel is an insecure one (i.e. it allows ADBD running as root and thus, the use of adb remount command for full system read/write access). If that doesn't work, try this:
Code:
adb push Launcher.apk /sdcard/
adb shell
su
mount -o remount,rw /system
mv /sdcard/Launcher.apk /system/app/Launcher.apk
chmod 644 /system/app/Launcher.apk
exit
exit
adb reboot
HQRaja said:
No, you don't get read/write access by fixing permissions. The error that you get asically means you don't have system write access via ADB at the moment. Try this:
Code:
adb remount
adb push Launcher.apk /system/app/
adb shell
su
chmod 644 /system/app/Launcher.apk
exit
exit
adb reboot
The above method should work if your current kernel is an insecure one (i.e. it allows ADBD running as root and thus, the use of adb remount command for full system read/write access). If that doesn't work, try this:
Code:
adb push Launcher.apk /sdcard/
adb shell
su
mount -o remount,rw /system
mv /sdcard/Launcher.apk /system/app/Launcher.apk
chmod 644 /system/app/Launcher.apk
exit
exit
adb reboot
Click to expand...
Click to collapse
I will try both commands and report back thank you!
These are my returns:
{
"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"
}
You could also try installing a launcher from the Google Play website and hopefully it will install on your phone. Then once you have a working launcher you could more easily restore the factory one.
spunker88 said:
You could also try installing a launcher from the Google Play website and hopefully it will install on your phone. Then once you have a working launcher you could more easily restore the factory one.
Click to expand...
Click to collapse
I can't use Google play because this I have not had this phone registered at all. I only used it to play games and media and never had my account linked to it. I now wish I would have because I agree with you, having done that would ahve made this entire thing a non situation I think.
That's kinda weird. Try the same command with 'cp' instead of 'mv', perhaps that'll help.
According to adb it worked, however I can not access home and the launcher is no longer in my list of installed apps. Very confusing to me
It seems then that you have deleted some other system-critical APK as well, perhaps. A good idea would be to reinstall the ROM now. If you are already running a custom ROM, you can do so without the need to wipe data, by installing the same ROM. In case of stock ROM, you should find a flashable zip file of the same version or a later update, and flash it without wiping data too. Though if that doesn't work either, a ROM flash followed by a full data+cache+dalvik-cache wipe should do it.
Oh speaking of that, try wiping cache and dalvik cache from recovery and rebooting to see if it helps, before you attempt the above.
HQRaja said:
It seems then that you have deleted some other system-critical APK as well, perhaps. A good idea would be to reinstall the ROM now. If you are already running a custom ROM, you can do so without the need to wipe data, by installing the same ROM. In case of stock ROM, you should find a flashable zip file of the same version or a later update, and flash it without wiping data too. Though if that doesn't work either, a ROM flash followed by a full data+cache+dalvik-cache wipe should do it.
Oh speaking of that, try wiping cache and dalvik cache from recovery and rebooting to see if it helps, before you attempt the above.
Click to expand...
Click to collapse
I was already thinking that so I finally found a stock firmware file and am currently attempting to flash it now. I will report back with the results.
Update: The results are in and.....it is now working! This is what I wanted to do from the start but I had a very hard time finding a good link to a stock rom. Mr. Raja I am very thankful for all your help and time you spent with me on this issue.
kingnarkissos said:
I was deleting unused apps from my phone and, like an idiot, I deleted my only installed launcher. The phone boots and I can access the settings. I have a launcher installed and it shows up in menu/ settings/ app but it wont start and I don't know how to start it. I do have adb and fastboot though I don't have wireless internet. This device is not activated and there is no gmail account linked to this device. I did create a zip of a launcher and tried to flash it through recovery but that didn't work. I do not have a custom recovery installed but I did root the device. Is there a way to get a launcher installed and working so I can use this device again?
Click to expand...
Click to collapse
you need to simply install the launcher..
adb install apex.apk
that is all.
kingnarkissos said:
I was already thinking that so I finally found a stock firmware file and am currently attempting to flash it now. I will report back with the results.
Update: The results are in and.....it is now working! This is what I wanted to do from the start but I had a very hard time finding a good link to a stock rom. Mr. Raja I am very thankful for all your help and time you spent with me on this issue.
Click to expand...
Click to collapse
I'm glad it worked out for you. You must have deleted some other system-critical APK as well, otherwise simply reinstalling the launcher via ADB should have worked just fine. In the future, it'll be a good idea not to delete any APKs from /system/app that you aren't absolutely sure about. =)
jimmydafish said:
you need to simply install the launcher..
adb install apex.apk
that is all.
Click to expand...
Click to collapse
That was the first thing I did and it did not work. The app did show up under the installed apps list, but I could not get it to start so it was never running. Therefor I couldn't gain access to it or any area of the device other than settings when the phone booted up. I stated such in the first post of this thread. Believe me I tried all the easy stuff first.
Mr.Raja I do agree with you. I must have deleted more than I thought I did because I agree with you and everyone else who is saying a simple adb flash will work. It should have worked. So whatever I did to it forced me to reflash a rom onto it. I am just thankful to you and everyone else who tried to help me. I appreciate the time spent assisting me.
How I fixed this issue was RSDlite and the rom from this link http://forum.xda-developers.com/showthread.php?t=2017200 and it worked like a charm.
This issue is resolved!

[GUIDE][XSP]Easy init.d support for Stock ROMs

Easy init.d support for Stock ROMs
Disclaimer: Credits belong to original authors. I'm sharing this intending that others might benefit. This worked for me without problems, but I'm not responsible for any unwanted effects others might experience. Keep a CWM backup just in case.
What is this?
This is an easy method to add init.d support to our stock ROMs running on stock kernels. Then, scripts placed in /system/etc/init.d/ folder will be executed automatically at boot.
Requirements:
1.Rooted phone.
2.Root explorer or similar app.
3.Busybox installed.
check:
Type "busybox run-parts" (without quotes) in a terminal emulator and press enter. If you get an output similar to what's shown below you're all set. It means that busybox is installed and the command is present. (It's needed for the MOD).
Code:
1|[email protected]:/ $ busybox run-parts
BusyBox v1.20.2-jb static (2012-11-25 17:47 +0100) multi-call binary.
Usage: run-parts [-t] [-l] [-a ARG] [-u MASK] DIRECTORY
Run a bunch of scripts in DIRECTORY
-t Print what would be run, but don't actually run anything
-a ARG Pass ARG as argument for every program
-u MASK Set the umask to MASK before running every program
-l Print names of all matching files even if they are not executable
1|[email protected]:/ $
If busybox not installed, install it from Google play.
How to:
1) Open root explorer, go to /system/etc/ folder.
2) Mount /system as R/W by pressing the button at upper right corner.
3) Open init.qcom.post_boot.sh file for editing. (Long-press> Open in Text Editor)
4) Add this line to the bottom end of that file.
Code:
busybox run-parts /system/etc/init.d/
**Add an empty line after that. It's very important**​
{
"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"
}
5) Save the file. (You can delete the .bak file that Root explorer creates).
Then..
6) Create 'init.d' folder in /system/etc/ if not already present.
7) Change it's permissions to 755/rwxr-xr-x (Long-press> permissions)
That's it!
Testing:
To see whether it works, extract the test script (from attachment) to init.d folder, change script's permissions to 755/rwxr-xr-x and reboot the phone. You should see a file called Test.log in /data/ with a message saying that it's working.
(Tested on Android 4.3 (.201). Should work in others.)
How it works:
It's quite obvious. The init.qcom.post_boot.sh is one of the scripts that runs at boot, which in turn executes the busybox command to execute the scripts in init.d folder. Simple!
Credits & Sources
1) @iridaki and original thread here.
2) @smokin1337 and original thread here.
Note: Following the first tutorial broke my root. Second method executed only the first script in the list. So, I combined the needed parts of two guides!
Alternative methods:
#'Universal init.d' app from Google play would also execute init.d scripts, but at the app level.
#'SManager' is another app that can execute scripts at boot.
There maybe other methods...
You may point out any shortcomings/improvements.
Thanks and Regards!
mrhnet said:
Easy init.d support for Stock ROMs
Disclaimer: Credits belong to original authors. I'm sharing this intending that others might benefit. This worked for me without problems, but I'm not responsible for any unwanted effects others might experience. Keep a CWM backup just in case.
What is this?
This is an easy method to add init.d support to our stock ROMs running on stock kernels. Then, scripts placed in /system/etc/init.d/ folder will be executed automatically at boot.
Requirements:
1.Rooted phone.
2.Root explorer or similar app.
3.Busybox installed.
check:
Type "busybox run-parts" (without quotes) in a terminal emulator and press enter. If you get an output similar to what's shown below you're all set. It means that busybox is installed and the command is present. (It's needed for the MOD).
Code:
1|[email protected]:/ $ busybox run-parts
BusyBox v1.20.2-jb static (2012-11-25 17:47 +0100) multi-call binary.
Usage: run-parts [-t] [-l] [-a ARG] [-u MASK] DIRECTORY
Run a bunch of scripts in DIRECTORY
-t Print what would be run, but don't actually run anything
-a ARG Pass ARG as argument for every program
-u MASK Set the umask to MASK before running every program
-l Print names of all matching files even if they are not executable
1|[email protected]:/ $
If busybox not installed, install it from Google play.
How to:
1) Open root explorer, go to /system/etc/ folder.
2) Mount /system as R/W by pressing the button at upper right corner.
3) Open init.qcom.post_boot.sh file for editing. (Long-press> Open in Text Editor)
4) Add this line to the bottom end of that file.
Code:
busybox run-parts /system/etc/init.d/
**Add an empty line after that. It's very important**​
5) Save the file. (You can delete the .bak file that Root explorer creates).
Then..
6) Create 'init.d' folder in /system/etc/ if not already present.
7) Change it's permissions to 755/rwxr-xr-x (Long-press> permissions)
That's it!
Testing:
To see whether it works, extract the test script (from attachment) to init.d folder, change script's permissions to 755/rwxr-xr-x and reboot the phone. You should see a file called Test.log in /data/ with a message saying that it's working.
(Tested on Android 4.3 (.201). Should work in others.)
How it works:
It's quite obvious. The init.qcom.post_boot.sh is one of the scripts that runs at boot, which in turn executes the busybox command to execute the scripts in init.d folder. Simple!
Credits & Sources
1) @iridaki and original thread here.
2) @smokin1337 and original thread here.
Note: Following the first tutorial broke my root. Second method executed only the first script in the list. So, I combined the needed parts of two guides!
Alternative methods:
#'Universal init.d' app from Google play would also execute init.d scripts, but at the app level.
#'SManager' is another app that can execute scripts at boot.
There maybe other methods...
You may point out any shortcomings/improvements.
Thanks and Regards!
Click to expand...
Click to collapse
Will try thanks!!
I doesnt have the init.qcom file
Just have a init.goldfish and the init.d folder, but is always empty...
Help please...
janolucero said:
I doesnt have the init.qcom file
Just have a init.goldfish and the init.d folder, but is always empty...
Help please...
Click to expand...
Click to collapse
Do you have any other file with "post_boot" part, in system/etc/ folder? What's your ROM?
mrhnet said:
Do you have any other file with "post_boot" part, in system/etc/ folder? What's your ROM?
Click to expand...
Click to collapse
.254
i will try to reflash and start fresh.-
janolucero said:
.254
i will try to reflash and start fresh.-
Click to expand...
Click to collapse
I haven't tested it on 4.1.2. You may list what are the files in /system/etc folder..
(Just do this command in a terminal emulator, it will save the filelist to a file in sdcard. Post that file here.)
Code:
ls /system/etc/ >> /sdcard/filelist.txt
mrhnet said:
I haven't tested it on 4.1.2. You may list what are the files in /system/etc folder..
(Just do this command in a terminal emulator, it will save the filelist to a file in sdcard. Post that file here.)
Code:
ls /system/etc/ >> /sdcard/filelist.txt
Click to expand...
Click to collapse
Y not add the runparts command in install-recovery.sh file?
Sent from my C5303 using Tapatalk
Siddhesh said:
Y not add the runparts command in install-recovery.sh file?
Sent from my C5303 using Tapatalk
Click to expand...
Click to collapse
Yes, was thinking like that. Wanted to know whether any other post_boot script is there in 4.1.2
mrhnet said:
Yes, was thinking like that. Wanted to know whether any other post_boot script is there in 4.1.2
Click to expand...
Click to collapse
No needed if everyone uses supersu then there will be a file called install-recovery.sh but don't add runparts command in it make another file named install-recovery-2.sh(Only for supersu users) and add the runparts command. Our init.rc makes install-recovery.sh to start on boot
Sent from my C5303 using Tapatalk
Thanks for the tip. Adding runparts to the second file would prevent breaking init.d even if SuperSU update is flashed again. Good idea!
mrhnet said:
Thanks for the tip. Adding runparts to the second file would prevent breaking init.d even if SuperSU update is flashed again. Good idea!
Click to expand...
Click to collapse
Yes but its only for SuperSU users if someone using Superuser from koush then this trick will not work so u have to edit the original install-recovery.sh in that situation and please test this trick coz on my previous Xperia phones Wt19i and arcs only first script is executed never used scripts on XSP
Sent from my C5303 using Tapatalk
Siddhesh said:
Yes but its only for SuperSU users if someone using Superuser from koush then this trick will not work so u have to edit the original install-recovery.sh in that situation and please test this trick coz on my previous Xperia phones Wt19i and arcs only first script is executed never used scripts on XSP
Sent from my C5303 using Tapatalk
Click to expand...
Click to collapse
This the situation. Xperia Arc on C-rom KK ver 5.6 with nAa ver 3.4...
There is already a init.d file in system/etc.
Upon viewing the file install-recovery.sh there is a directive to create another install-recovery.2sh - i.e. as pix below:
Using SuperSU ver 1.94
So I will try this and report.
Sent from my Xperia Arc using XDA Free mobile app
Thanks for the post.. I'm going to try your method for adding init.d support but I have a question :
I found the "init.qcom.post_boot.sh" script in the root directory not "system/etc" nor "system/" is that an issue? should I edit it with no concerns? or should i edit the "install-recovery.sh" found in "system/etc/" ?
my device is HTC desire 816 with stock rom, rooted & with unlocked bootloader
Siddhesh said:
No needed if everyone uses supersu then there will be a file called install-recovery.sh but don't add runparts command in it make another file named install-recovery-2.sh(Only for supersu users) and add the runparts command. Our init.rc makes install-recovery.sh to start on boot
Sent from my C5303 using Tapatalk
Click to expand...
Click to collapse
Where to add the runparts command?
the other sh script is not running
In grand prime SM-G530FZ ( 5.0.2 ), This file exists ( i.e, qcom.....)
Did the mentioned steps. But not working

Categories

Resources