[Q] Randomised boot animations? - Defy Q&A, Help & Troubleshooting

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...

Related

[Q] How to port/cook/bake your own android rom???

How can i take a cooked desire ROM, and port it to the htc hd2? (or use it as a base?)
I understand how to make a system.ext2 (make the image, not how to put anything in it) and i understand how to mount it -- but how can we make the build??? there are no tutorials on this at all, and i wish there was.
Any help would be extremely helpful! Thanks in advance!
------------
Oh and i noticed that nobody has ported any Evo 4G roms (even though the devices are pretty similar). why is that? Because it is CDMA?
------------
Update: What I KNOW​
ThaDeanesta said:
(From my post #8)
Well, from what i can see:
You can create a system.ext2 image from a folder in ubuntu (in terminal) using
Code:
[B][I]First, you need to change directory to your desktop:[/I][/B]
cd /home/[COLOR="Red"][USERNAME][/COLOR]/Desktop
[B][I]Then, make an image of a folder on your desktop:[/I][/B]
sudo genext2fs -d /home/[COLOR="Red"][USERNAME][/COLOR]/Desktop/[COLOR="Magenta"][FOLDER][/COLOR] 307200 system.ext2
Where [USERNAME] = your short ubuntu username, and [FOLDER] is the folder of which you want to make an image of. (the contents of the folder will be put into the root of your image).
This will make a 300MB image. If you want to change that, change the "307200" to the value that you want.
------------------------------​If you extract an update.zip, there is a system folder,a data folder, and a boot.img.
I'm pretty sure that you can take the contents of the system folder, and put them in system.img. I'm not 100% sure on what to do with the data folder, but i think you can put the contents into data.img. As for the boot.img, i think that it may be rootfs.img but am not 100% sure.
------------------------------​
Now, if you want to look at an exsisting system.ext2 or a data.img, just open up terminal and tipe in:
Code:
sudo mount -o loop /home/[COLOR="Red"][username][/COLOR]/Desktop/system.ext2 /mnt
This is just an example for if your file is on the desktop, and will be mounted in /mnt.
Change the username to your username before entering this into terminal ;). The same
process works for data.img (just change system.ext2 to data.img).
------------------------------​I know the way to create an image is correct, and i know the way to mount an image is correct, but i'd like to know exactly how to do the process from the start.
Click to expand...
Click to collapse
Useful!
I would love to know if there is a way or instructions on how to do this. The desire has many great roms/modded apps I would like on my phone.
I would love to know too. But I'm pretty happy with what the devs are doing so far with these roms.
Sent From My Htc-Hd2 With Froyostone V.2 Using XDA App
Go look in the android dev subforum. you might find something there
Sent from my Nexus One using XDA App
search on COFFEESHOP
Yea, I too would LOVE to know more about this...
^^^That coffee shop is OLD and hasn't been updated in a long time...I wouldn't bother...
There is a good kitchen in the Android main dev thread, but it's currently not for WM devices running Android...
PLEASE someone share the secret!
i want know too. who can share tool kitchen and to lead please! thanks
What I Know....
Well, from what i can see:
You can create a system.ext2 image from a folder in ubuntu (in terminal) using
Code:
[B][I]First, you need to change directory to your desktop:[/I][/B]
cd /home/[COLOR="Red"][USERNAME][/COLOR]/Desktop
[B][I]Then, make an image of a folder on your desktop:[/I][/B]
sudo genext2fs -d /home/[COLOR="Red"][USERNAME][/COLOR]/Desktop/[COLOR="Magenta"][FOLDER][/COLOR] 307200 system.ext2
Where [USERNAME] = your short ubuntu username, and [FOLDER] is the folder of which you want to make an image of. (the contents of the folder will be put into the root of your image).
This will make a 300MB image. If you want to change that, change the "307200" to the value that you want.
------------------------------​If you extract an update.zip, there is a system folder,a data folder, and a boot.img.
I'm pretty sure that you can take the contents of the system folder, and put them in system.img. I'm not 100% sure on what to do with the data folder, but i think you can put the contents into data.img. As for the boot.img, i think that it may be rootfs.img but am not 100% sure.
------------------------------​
Now, if you want to look at an exsisting system.ext2 or a data.img, just open up terminal and tipe in:
Code:
sudo mount -o loop /home/[COLOR="Red"][username][/COLOR]/Desktop/system.ext2 /mnt
This is just an example for if your file is on the desktop, and will be mounted in /mnt.
Change the username to your username before entering this into terminal ;). The same
process works for data.img (just change system.ext2 to data.img).
------------------------------​I know the way to create an image is correct, and i know the way to mount an image is correct, but i'd like to know exactly how to do the process from the start.
?????????????????
Thanks for the info! Should help a lot
i used : sudo genext2fs -d /home/[USERNAME]/Desktop/[FOLDER] 307200 system.ext2
but erro :
[email protected]:~/Desktop$ sudo genext2fs -d /home/hoang/Desktop/folder1 307200 system.ext2
genext2fs: Too many arguments. Try --help or else see the man page.
i use : sudo mount -o loop /home/hoang/Desktop/system.ext2 /mnt
{
"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"
}
and modifed it and now i want create to ext2 file
how to create a system.ext2 , please help me ! thanks
hoangan12 said:
i used : sudo genext2fs -d /home/[USERNAME]/Desktop/[FOLDER] 307200 system.ext2
but erro :
[email protected]:~/Desktop$ sudo genext2fs -d /home/hoang/Desktop/folder1 307200 system.ext2
genext2fs: Too many arguments. Try --help or else see the man page.
i use : sudo mount -o loop /home/hoang/Desktop/system.ext2 /mnt
and modifed it and now i want create to ext2 file
how to create a system.ext2 , please help me ! thanks
Click to expand...
Click to collapse
try using
genext2fs -d /home/[USERNAME]/Desktop/[FOLDER] -b 307200 system.ext2
also dont use the sudo command for this. If you use sudo then this will create it with root only permissions and makes it more annoying to edit.
Thats should help.
So looking at a Desire build the system folder in this is the same as our system.ext2 file and can see were some of the files fit but there are others in the desire build that look to belong in the kernel.
I am not bothered about building a new kernel as there are several fine people already working on excellent ones but i think we need a break down for rootfs and the intird.gz to find out a little more of what goes were when taking a working nexus/desire build apart to recompile for us.
Still not helping
i cant move lost+found folder
smjfosho said:
i cant move lost+found folder
Click to expand...
Click to collapse
From where.....
Ok Lets assume that you have mounted the system.ext2 to /mnt
from terminal type chmod 777 /mnt/lost+found
see if this helps. You might need to preface the command with sudo if it does not work
David Balfour said:
try using
genext2fs -d /home/[USERNAME]/Desktop/[FOLDER] -b 307200 system.ext2
also dont use the sudo command for this. If you use sudo then this will create it with root only permissions and makes it more annoying to edit.
Thats should help.
So looking at a Desire build the system folder in this is the same as our system.ext2 file and can see were some of the files fit but there are others in the desire build that look to belong in the kernel.
I am not bothered about building a new kernel as there are several fine people already working on excellent ones but i think we need a break down for rootfs and the intird.gz to find out a little more of what goes were when taking a working nexus/desire build apart to recompile for us.
Click to expand...
Click to collapse
This is pretty much what I was wondering too. Like, where do I put all of these Kernal and Module files and make them play nice with Android and then port it all so I can use it on my HD2.
Noob Question:
When you say mount the img, what exactly do you mean? Is it the same is being able to open the file and add/remove the files that make up the img?
Is there anywhere I can find like a cheat sheet of sorts for terminal commands?
Sorry for the noob questions, I have never used Linux before.
I was able to though within about 3.5 hours create 2 custom ROMS, flash my wifes G1 without bricking it, and use coffeeshop to create a System.ex2 file from a CM6 Desire rom I modified and added FRG33 radio too To bad I have no idea WTH to do with it
Sooo... I'm learning if anything!
I have managed to create the system.ext2 file haret loads and then starts to boot android but gets to cant find ipv6 and then loops with the battery percentage. I think I am not using the right image.
I downloaded a desire image from shippedroms.com Im wondering is there another source for downloading roms? I am looking for a rom compatable with the HD2 that has sense.
GhostXSeries said:
I have managed to create the system.ext2 file haret loads and then starts to boot android but gets to cant find ipv6 and then loops with the battery percentage. I think I am not using the right image.
I downloaded a desire image from shippedroms.com Im wondering is there another source for downloading roms? I am looking for a rom compatable with the HD2 that has sense.
Click to expand...
Click to collapse
you cant just take a desire build and make an ext2 and hope it will work. You need to port all the correct drivers,firmware other modules. Dont ask me what though i dont know and no one seems to be sharing.
Also @Hatefly http://ss64.com/bash/
hope that helps
Yes I have tried the desire build and sofar it does not boot. I am getting furhter and getting android to load.
I am using kitchen to extract the image file and then using the genext2fs -d /home/[USERNAME]/Desktop/[FOLDER] -b 307200 system.ext2 to create the ext2 file its self. I will play arround with the desire build and see if I can get it working. If I can I will be sure to share the procedure
i chmod 777 the complete set of folders and build prop prior to making it a ext2. see if it helps everyone else

[GUIDE] ADB Workshop and Guide for everyone

This workshop was held in #android-learning on irc.freenode.net by XDA Member Adrynalyne. All credit to him for this guide, I simply am taking it and turning it into a guide. Here we go!
You can find the raw IRC log here
Good evening folks, and welcome to my ADB workshop. This is by no means a full explanation on the subject, but more of a crash course to help folks get up to speed, and get more from their devices. There may be some things you already know here, so please be patient and respect those who do not.
Reference Files
http://adrynalyne.us/files/How to install adb.pdf
http://adrynalyne.us/files/Using ADB.pdf
So, lets just start with the basics.
What is ADB?
ADB stands for the android debugging bridge and is used for testing and debugging purposes by developers.
However, we like to get more out of our devices, and its a great way to fix things.
Knowing adb can mean the difference between a paperweight and a working phone.
So, to start with, we will look at installing ADB.
Generally speaking, the Sun/Oracle JDK is required to run all SDK functions.
ADB is but one tool in the SDK arsenal.
So, we begin by downloading and installing the JDK. This can be found here:
https://cds.sun.com/is-bin/[email protected]_Developer
Choose your OS, download and install. I recommend that 64 bit users use the regular x86/32 bit version as well.
Moving ahead, we download the Windows sdk from here:
http://dl.google.com/android/installer_r08-windows.exe
Due to already installing JDK, you won't be stopped by the install process.
Now, if you notice, I installed it to:
C:\android-sdk-windows
I did this because it makes things easier when setting up path variables.
I encourage everyone to do the same, but obviously it is not required.
So, this SDK is handy, but is only good up to 2.2. We want the latest and greatest! (Well I do)
So, we navigate to:
C:\android-sdk-windows\
and we run SDK Manager.exe
If you notice in your PDF file for installing adb, you will notice that you can update, and I made a choice not to include earlier sdk versions.
I won't go into full detail on that, but depending on the version of SDK you have, 8 or 9, it WILL make a difference in using adb.
By default, for version 8 adb.exe resides in C:\android-sdk-windows\tools
By default, for version 9 adb.exe resides in C:\android-sdk-windows\platform-tools
We will assume version 9 in this guide
Really, the SDK is installed and adb is usable right now, but in my humble opinion, its not enough
I like the ability to use adb in ANY directory on my machine.
To do this, we edit Windows's environment variables.
Specifically, the system path.
To do this, we click on start, or the orb (depending on OS), and right click on Computer, left clicking on properties in the menu.
If its windows XP, I believe it brings you into advanced system properties immediatly. Vista and 7 need a second step.
On the left hand side, as you notice I have highlighted in the pdf, left click advanced system settings.
Under advanced tab, we left click environment variables...
There are two boxes here.
We are concerned with system variables, however.
So we scroll down the list and highlight path and click edit.
Ignoring all the extra stuff in here, make sure you are at the end of the line, and type
Code:
;C:\android-sdk-windows\platform-tools
The semicolon allows us to separate it
from the previous path statement.
Click ok all the way out.
We now have ADB setup globally. We can use cmd.exe (I use powershell) and no matter what directory we are in, adb is recognized.
If it is not, make certain you entered the path into system variables, and made no typos.
If you installed to a different location, you will need to adjust the path accordingly.
This concludes the section on installing the Android SDK to use ADB.
This next section will be on using ADB, so please open that pdf now.
Now, this applies to any OS, not just Windows.
Well, with the exception of the USB drivers.
I will not go too much into that, but if you take a look at the PDF, it goes through installing usb drivers for the sdk, and how to download them.
Fiarly straightforward, in that rspect.
Now, to setup our phones to use with the SDK and ADB, we must change some settings.
First, we go to menu softkey, then settings.
We scroll down to Applications and tap it.
Under Development, we will check Enable USB Debugging. Please note the SGS phones are different in this respect.
The USB cable must be unplugged before enabling or disabling this setting.
Once this is done, we are now ready to play with adb
One quick note: If you get device not found/conencted, please reboot your phone. DJ05 has a quirk in it where ADBD randomly crashes on boot.
A reboot will fix this
ADBD= ADB Daemon
Ok, continuing on.
Lets look at installing applications. This is also known as sideloading.
Unlike installing from the SD card, it does not require unknown sources to be enabled.
The command for this is
Code:
adb install packagename
This assumes that you are working from the directory where the file is located.
This will install the application to /data/app.
It will also show sometimes useful errors if install fails.
That is not something you will see from the Android GUI.
Now, a lot of us have probably deleted files with apps like Root Explorer. While this isn't really a bad thing, it leaves behind databases and data for the application removed.
This is where the 0kb applicaiton entries come from.
If you take that application entry name, you can uninstall the extra data via adb.
First we go to the adb shell which logs into the phone.
Code:
adb shell
If we end up with a $, we will want admin rights, in many cases. This is not one of them, I don't beleive.
To get admin rights, you want to type
Code:
su
Look at your phone if this is the first time, it may prompt you to allow access. Else you will get permission denied.
If you are not rooted, this will not work either.
Ok, now that we are logged in, we will type
Code:
pm uninstall packagename
where packagename is the name of the 0kb listing.
Now this seems like a pain in the a** and I agree.
HOWEVER
There will be a time where Manage applications crashes when you try to uninstall it from the phone. In this case, a factory reset, or this method is the only effective way to fix the problem.
Moving on.
How many of us have removed system applications or renamed them? Did you know that you can simply disable them from the system?
Code:
adb shell
su
pm disable appllicationname
This will disable it, and the system will ignore it.
This can be seen as safer than deleting or renaming things, but your mileage may vary.
On the other hand, you can also re-enable these applications.
Code:
adb shell
su
pm enable applicationname
Please note: Not all applications will properly re-enable. I believe a factory reset or reinstall of said application will fix the issue.
Also, application names are absolutely case sensitive.
*nix based Operating Systems see the letter 'a' and 'A' as two different things.
when you log into adb shell, you are playing by android rules
Ok, a lot of us tweak and mod our phones and turning off the device to get to clockwork recovery, or battery pulls, or multiple button holds to get into Download mode are troublesome and annoying at best.
ADB can help us here.
Here, we do not need to be logged into the shell
If we want to merely reboot the phone:
Code:
adb reboot
If we want to go to recovery (works well with voodoo5)
Code:
adb reboot recovery
If we want to go to Download Mode because we need Odin, heaven forbid:
Code:
adb reboot download
Its instant. No waiting on animations or anything else.
Its also handy if Android has locked up, but yet still works in adb.
I for one hate taking my case off to battery pull.
So now we move on to pushing and pulling files.
Sometimes, I don't feel like mounting my sd card to copy a file over to my phone.
I can use this command to push a file straight to my sd card:
Code:
adb push filename /pathtodirectoryonphone
So for instance, if I have test.txt that I want to send, I would type:
Code:
adb push test.txt /sdcard/
and there it goes.
Ok moving on
Pushing files can be done to any directory, however, some are protected.
For instance, /system is going to give you a permission denied or a read only filesystem error.
To get around this, the easiest thing to do is push the file to your sdcard, then log into the shell:
Code:
adb shell
Code:
su
We will then mount the system as writable
Code:
mount -o rw,remount /dev/block/stl9 /system
Then we can use something like
Code:
cp /sdcard/test.txt /system/app/test.txt
cp stands for copy
and it requires the path of the file and destination path. The name of the file is optional
When you copy it, you can rename it to whatever you like.
For instance, if we wanted to backup a file
Code:
cp /sdcard/test.txt /sdcard/backuptest.txt
Now, lets assume you do not have busybox installed.
You non rooted users will not.
Then you must use a slightly more complicated command called dd
This is used like this:
Code:
dd if=/sdcard/test.txt of=/system/app/test.txt
if is for inputfile
of= output file
Not every user friendly, but probably one of the safer copy commands.
Ok, moving on to pulling files.
Lets say you want to get a file from your phone, to modify, backup, etc.
To do this, we simply use adb in this manner:
Code:
adb pull /pathtofile/filename destinationname
For instance, if I wanted to backup ADW launcher in system/app
I would do this
Code:
adb pull /system/app/ADWLaucnher.apk ADWLauncher.apk
And it will pull the file from the phone and put it in the current directory.
Like above, you can specifcy where it goes.
pushing files to the sdcard, it seems prudent to talk about changing permissions.
sdcards are typically fat32, which destroys permisisons, and Android is heavily permission based.
So if you push an application to your sd card, then try to copy it to /system/app/ bad things are going to happen, or the app may not even show up.
So in that case, we use something called chmod.
This is used in this manner
Code:
adb shell
su
chmod 755 /pathtoapplication/applicationname
Keep in mind
you dont want to do this while its still on your sd card.
an example
Code:
adb shell
su
chmod 755 /system/app/ADWLauncher.apk
755 is good for applications and script files.
Just a couple more topics to cover.
Lets go over deleting files.
This becomes especially handy for removing rogue applications.
To do this, we must be in the adb shell.
Code:
adb shell
su
rm /system/app/ADWLauncher.apk
You may need to remount system as writable with:
Code:
mount -o rw,remount /dev/block/stl9 /system
That applies when using chmod as well.
So what I did above was delete ADW Launcher from system/app
However, what if I wanted to delete the entire contents of a directory?
Same thing as before, except
Code:
adb shell
rm -f /data/dalvik-cache/*.*
I just cleared my dalvik-cache with that command
very quick, very effective.
If you just tried that, please reboot your phone now
Ok....this leaves us with the final topic: logcat
logcat allows us to log what the OS is doing, and possibly delve information for when things are not working
its quite simple Reading it is another.
To use logcat
Code:
adb shell
logcat
To logcat to a certain file do
Code:
adb shell
logcat > /sdcard/logcat.txt
Now we let the log settle down to a reasonable amount of data coming in and not a wall of scrolling, then start the app in question. When it gives an error, we hit ctrl-C and kill the adb shell session.
This should have captured enough data to see the error. Now, I prepared an example. A user came to me on IRC, and Google Maps was force closing. Clearing data didnt fix it, Clearing dalvik-cache, and fix permissions did not fix it. In this case, the user did not know how to use adb So I had him grab an app called alogcat from the market and email me the log. This is also a very valid method.
this file explains what the problem was, and highlights what to look for as an example.
http://adrynalyne.us/files/logcat.pdf
___________________________________________________________________
This concludes the guide from Adrynalyne, there will be more workshops such as this one in irc.freenode.net #android-learning.
Thanks to everyone in #samsung-fascinate !
Reserved for possible extension of topic
Great, saves a lot of questions/answers & search
Every new user should read this!!
Thread stuck as valuable reference thread
Just to add, if I may, a little about the permissions...
============================================================
File permissions for Unix... which Android is based, just so those who tinker with the file permissions may know what they are getting into.
============================================================
Use the chmod command to set file permissions.
The chmod command uses a three-digit code as an argument.
The three digits of the chmod code set permissions for these groups in this order:
1.Owner (you)
2.Group (a group of other users that you set up)
3.World (anyone else browsing around on the file system)
Each digit of this code sets permissions for one of these groups as follows. Read is 4. Write is 2. Execute is 1.
The sums of these numbers give combinations of these permissions:
0 = no permissions whatsoever; this person cannot read, write, or execute the file
1 = execute only
2 = write only
3 = write and execute (1+2)
4 = read only
5 = read and execute (4+1)
6 = read and write (4+2)
7 = read and write and execute (4+2+1)
Chmod commands on file apple.txt (use wildcards to include more files)
Command Purpose
chmod 700 apple.txt Only you can read, write to, or execute apple.txt
chmod 777 apple.txt Everybody can read, write to, or execute apple.txt
chmod 744 apple.txt Only you can read, write to, or execute apple.txt Everybody can read apple.txt;
chmod 444 apple.txt You can only read apple.txt, as everyone else.
Detecting File Permissions
You can use the ls command with the -l option to show the file permissions set. For example, for apple.txt, I can do this:
$ ls -l apple.txt
-rwxr--r-- 1 december december 81 Feb 12 12:45 apple.txt
$
The sequence -rwxr--r-- tells the permissions set for the file apple.txt. The first - tells that apple.txt is a file. The next three letters, rwx, show that the owner has read, write, and execute permissions. Then the next three symbols, r--, show that the group permissions are read only. The final three symbols, r--, show that the world permissions are read only.
Compliments and full credit from:
http://www.december.com/unix/ref/chmod.html
Amazing thread just what I needed lol thanks!
cooolone2 said:
Just to add, if I may, a little about the permissions...
============================================================
File permissions for Unix... which Android is based, just so those who tinker with the file permissions may know what they are getting into.
============================================================
Use the chmod command to set file permissions.
The chmod command uses a three-digit code as an argument.
The three digits of the chmod code set permissions for these groups in this order:
1.Owner (you)
2.Group (a group of other users that you set up)
3.World (anyone else browsing around on the file system)
Each digit of this code sets permissions for one of these groups as follows. Read is 4. Write is 2. Execute is 1.
The sums of these numbers give combinations of these permissions:
0 = no permissions whatsoever; this person cannot read, write, or execute the file
1 = execute only
2 = write only
3 = write and execute (1+2)
4 = read only
5 = read and execute (4+1)
6 = read and write (4+2)
7 = read and write and execute (4+2+1)
Chmod commands on file apple.txt (use wildcards to include more files)
Command Purpose
chmod 700 apple.txt Only you can read, write to, or execute apple.txt
chmod 777 apple.txt Everybody can read, write to, or execute apple.txt
chmod 744 apple.txt Only you can read, write to, or execute apple.txt Everybody can read apple.txt;
chmod 444 apple.txt You can only read apple.txt, as everyone else.
Detecting File Permissions
You can use the ls command with the -l option to show the file permissions set. For example, for apple.txt, I can do this:
$ ls -l apple.txt
-rwxr--r-- 1 december december 81 Feb 12 12:45 apple.txt
$
The sequence -rwxr--r-- tells the permissions set for the file apple.txt. The first - tells that apple.txt is a file. The next three letters, rwx, show that the owner has read, write, and execute permissions. Then the next three symbols, r--, show that the group permissions are read only. The final three symbols, r--, show that the world permissions are read only.
Compliments and full credit from:
http://www.december.com/unix/ref/chmod.html
Click to expand...
Click to collapse
Thanks! Added
ih4ckback said:
Amazing thread just what I needed lol thanks!
Click to expand...
Click to collapse
Thanks, all goes to Adrynalyne
Thanks for the guide. Helped me pick out the stupid stupid mistakes I was making...so just a problem. I'm able to use fastboot easily but I seem to be unable to use ADB still on my windows 7. It says there are no devices and I'm dang well sure I have USB debugging on. Is it because Windows 7 is missing drivers for the nexus one or something else?
wonderful guide. I would like to add it to the guides thread.
Really awesome work, thumbs up.
But we should also take a guide on installing adb with Ubuntu/Linux, which isn't a very difficult thing...
mm7490 said:
Really awesome work, thumbs up.
But we should also take a guide on installing adb with Ubuntu/Linux, which isn't a very difficult thing...
Click to expand...
Click to collapse
If I got time tomorrow I could do that. I work primarily in Linux also
Sent from my Samsung Fascinate using Tapatalk Pro
This is good but I have a problem, when I try to remove an .apk file from /system/app it fails and says 'rm failed, Directory not empty'
I have followed exact instructions many time but never succeeded :s any help!!
(I am runnging these commands in device mod)
when I am in recovery mod I get this prompt ~ # and I am not able to enter su mod. how to get rid of this??
Well when the $ changes to # it means you have SU access
mustafa.aziz said:
This is good but I have a problem, when I try to remove an .apk file from /system/app it fails and says 'rm failed, Directory not empty'
Click to expand...
Click to collapse
Please give us the exact command(s) you entered
Here are the commands I entered after adb shell;
su
mount -o rw,remount /dev/block/stl9 /system
rm /system/app/mytouchmusic-signed.apk
exact message returned is 'rm failed for mytouchmusic-signed.apk, Directory not empty'
mustafa.aziz said:
Here are the commands I entered after adb shell;
su
mount -o rw,remount /dev/block/stl9 /system
rm /system/app/mytouchmusic-signed.apk
exact message returned is 'rm failed for mytouchmusic-signed.apk, Directory not empty'
Click to expand...
Click to collapse
Ok i think you need to do a recursive force delete which should be rf but i am not too sure! could somebody please confirm/ correct this?
Well, I don't think so ^^ As he doesn't want to erase a whole directory, but only a file.
What surprises me the most is the returned message... You're trying to delete an apk, and it says it's a directory :/
Could you please give us the output of this :
Code:
su
mount -o rw,remount /dev/block/stl9 /system
ls -l /system/app/mytouch*
Perhaps you don't even need the su and mount lines, but I'm not sure about that, and that can't harm your system ^^
Khoral said:
Well, I don't think so ^^ As he doesn't want to erase a whole directory, but only a file.
Click to expand...
Click to collapse
I know he doesn't want to delete a whole directory, but since the apk isn't compressed perhaps android looks at is as a directory and not a file? i don't know since what was returned suggested that it was a directory i presumed it was a directory! :S
mustafa.aziz said:
Here are the commands I entered after adb shell;
su
mount -o rw,remount /dev/block/stl9 /system
rm /system/app/mytouchmusic-signed.apk
exact message returned is 'rm failed for mytouchmusic-signed.apk, Directory not empty'
Click to expand...
Click to collapse
rm -rf /blah/blah
here is your desired output:
sh-3.2# su
su
sh-3.2# mount -o rw,remount /dev/block/stl9 /system
mount -o rw,remount /dev/block/stl9 /system
sh-3.2# ls -l /system/app/mytouch*
ls -l /system/app/mytouch*
-rw-r--r-- root root 299838 2008-08-01 18:00 mytouchmusic-signed.apk
sh-3.2#

[Guide] Change default orientation to portrait!

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!

[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

[Q] build.prop edits for 803

I'm trying to edit the build.prop file on the G2 803 model. It's rooted and unlocked on a stock Bell Rom. The phone has the wi-fi forgetting problem. everytime I reboot it I have to reset the wifi password. I've tried editing the build.prop file to change the wifi.lge.patch line to=false but I can't seem to enter more than 4 characters after the = on that line. Am I missing something?
Use build prop editor free on playstore
_____________________________________Read more write less and be smart
siggey said:
Use build prop editor free on playstore
_____________________________________Read more write less and be smart
Click to expand...
Click to collapse
Thanks, I tried that but the changes don't appear to stick.
Fraggle_Shamy said:
Thanks, I tried that but the changes don't appear to stick.
Click to expand...
Click to collapse
Reason 1: Some build.prop values get their values from the ramdisk on each boot, so that's why some values wont stick.
Reason 2 (requires root): build.prop is located in /system. Your /system may be read-only, we want it to be read-write to make changes, so.. run the following command in a Terminal Emulator downloaded from the play store. Run the following commands,
Code:
su
mount -o rw,remount /system
Now make your build.prop changes. Once finished run the following command to get your system back to how it was,
Code:
mount -o ro,remount /system
If the app isnt helping you, download a file explorer such as ES and navigate to /system/build.prop, open the file and edit the values you want.
Note: It's nice to hit the "Thanks" button under our posts if you indeed are thankful. Saying thanks and not hitting the thanks button is a slap in the face .
Thanks for the suggestion, but the emulator didn't help. I'm guessing it's because it's locked to the boot rom (your first suggestion)? Any way around this? I have anohter 803 that doesn't have this issue. Can I copy the ROM from that phone to the problematic one?
Fraggle_Shamy said:
Thanks for the suggestion, but the emulator didn't help. I'm guessing it's because it's locked to the boot rom (your first suggestion)? Any way around this? I have anohter 803 that doesn't have this issue. Can I copy the ROM from that phone to the problematic one?
Click to expand...
Click to collapse
Try this. (Pretty much the same as a previous suggestion, doubt it will work)
Get a root capable browser. Jrummy has one that's free, I think it's called Root Browser.
Browse to /system there should be a button to mount it r/w, if not it may prompt you when you go to edit the file... Long click the file, and try to open for editing. (it may be some other combination, I don't have my phone handy right now). Make the a change or two, reboot and see if they stick.
Or the other thing you cna do is:
The other thing you can try is to do is check if they're being set on boot.
adb pull /*.rc
which will pull all of the ramdisk's initialization scripts into your current folder on your computer. Look through them and see if the values are indeed being set by the boot image. If they are, you'll need something like AIK (android image kitchen) to extract the ramdisk, either change or delete those lines, rebuild the boot.img and flash it (using flashify or manually using adb and dd). You have to rebuild them into the boot.img, any changes you make to them directly on the phone will never stay as they get re-created every boot. It's a pretty roundabout way to do it, but it's entirely possible to do.
A much easier, and less likely to cause you issues would simply be to create an init.d script that sets it. This will occur after whatever is setting it in your boot.img so there would be no need to recreate that.
create a file in /etc/init.d called something like... "Set_wifi_pass" set the permissions so that it can be executed and read by everyone.
Then enter the following:
Code:
[B][I]#!/system/bin/sh[/I][/B]
setprop wifi.lge.patch = WifiPassword
You can check that it worked by going through adb shell with
adb shell
getprop wifi.lge.patch
which should return that value you set. Same thing that build.prop is ultimately doing, just in a different way.
Hope that helps.

Categories

Resources