[WIP] Camera enabled CM9 ICS - Happy New Year - Nexus One Android Development

Here is a ROM which has a very alpha and proof of concept working camera in CM9 ICS. It crashes a lot too (as expected). The ROM is based on CM9 and is a mini ROM with very basic apps and the required camera stuff. It should work fine with stock HBOOT, as it is pretty small. The ROM is just a vehicle for showcasing this work. It is not meant to be a replacement ROM of any sort.
http://www.mediafire.com/?d71119l3liv9iq3
Here is another zip file which has just the camera related stuff, that people can use in their ROMs (new/existing).
http://www.mediafire.com/?udyqa0aggncqobv
The boot.img has a modified ramdisk to allow the Camera HAL to work properly.
What works:
1) Preview - Trust me this is a big deal
2) Take picture
3) Flash enable/disable.
What does not work:
Everything else like video recording and other fancy stuff.
I have spent a lot of time on the internet and IRC, trying to find the sources for nexus one's libcamera.so used in CM7, but have not been able to. If someone knows the whereabouts, please send me the link. It would be really useful.
With out the proper sources, I had to spend a lot of time reversing the CM7 libcamera.so to match with the sources from code aurora and code for other devices and modify/build stuff to get to this point.
Credits are due to everyone involved in CM and whose code is included.
Enjoy!!

Nice work!

If you add this one with a (nearly) stable build like the texasice one (maybe a parallel build), it will be enough for me as a daily use

Menelkir said:
If you add this one with a (nearly) stable build like the texasice one (maybe a parallel build), it will be enough for me as a daily use
Click to expand...
Click to collapse
Agreed.
Sent from my Nexus One using XDA App

Me too!
BTW, is it possible to flash this on texasice - 2.1.0p3-miniskirt?

I can try to build another ROM. There are many variants with different HBOOTs etc., which is the one you would like to have?
With the other zip file I posted, you can do this very easily yourself. All you need to do is push the files using adb or copy using some file explorer from your sd card after putting it in there. The details of where the files need to go is in the README file as part of the zip.

thanks bro, i try it and using in the rom

This is ground breaking. Nice work!

texasice said:
This is ground breaking. Nice work!
Click to expand...
Click to collapse
Hell yea!
Sent from my Nexus One using XDA App

Happy new year bro great work( hard work)!!!!!
sent from the home of the "WIRE"

Awesome stuff!! Happy 2012 !
Sent from my Nexus One using XDA App

rapmv78 the ramdisk is identical to mine so im guessing you had to mod the init binary? you got a patch for that somwhere?

Ive switched all files do i need to use your boot.img or can i use the one that is included in my zip already?,im still learning just want to be sure for i start to flash,im on the mytouch 4g port???
sent from the home of the "WIRE"

rapmv78 said:
I can try to build another ROM. There are many variants with different HBOOTs etc., which is the one you would like to have?
With the other zip file I posted, you can do this very easily yourself. All you need to do is push the files using adb or copy using some file explorer from your sd card after putting it in there. The details of where the files need to go is in the README file as part of the zip.
Click to expand...
Click to collapse
To be honest, I don't care, I'm not afraid to use a custom hboot, since they work.

Dont know why this don't work on texasicss rom. Can you look ?

Hi Texasice,
The only changes are these extra lines in the init.rc file, but it is absolutely required for camera to work without additional commands on every boot,
# Add permissions for camera access
chmod 0666 /dev/msm_camera/config0
chmod 0666 /dev/msm_camera/control0
chmod 0666 /dev/msm_camera/frame0
chmod 0666 /dev/graphics/fb0
So, if you add these to your ramdisk, then no need to flash my boot.img.
Thanks.

jwhood said:
Ive switched all files do i need to use your boot.img or can i use the one that is included in my zip already?,im still learning just want to be sure for i start to flash,im on the mytouch 4g port???
sent from the home of the "WIRE"
Click to expand...
Click to collapse
You will need the ramdisk changes and hence the boot.img
Or, if you are okay with command line, after reboot, before using the camera app, run these
adb shell
su
chmod 0666 /dev/msm_camera/config0
chmod 0666 /dev/msm_camera/control0
chmod 0666 /dev/msm_camera/frame0
chmod 0666 /dev/graphics/fb0
Thanks.

No WiFi now
HI i flashed this camera mod over texasice's ICS rom and the camera works beautifully but now wifi will not turn on. before modded it wifi was fine now nothing. Any thoughts, ideas, or anyone else having this problem?

kwambewright said:
HI i flashed this camera mod over texasice's ICS rom and the camera works beautifully but now wifi will not turn on. before modded it wifi was fine now nothing. Any thoughts, ideas, or anyone else having this problem?
Click to expand...
Click to collapse
I am assuming you also flashed the boot.img and so most likely the wifi module is not compatible with the kernel. texasice is building a new boot.img with the ramdisk changes I posted in the previous comments. Until he builds a new one, you can get both camera and wifi, if you are willing to run the chmod commands by hand after every boot. You will have to flash the boot.img from texasices's ROM again or reflash the update.zip if you are using clockwork recovery. Another method is to use the wifi module from the update-ics-cam.zip file I posted.

rapmv78 said:
You will need the ramdisk changes and hence the boot.img
Or, if you are okay with command line, after reboot, before using the camera app, run these
adb shell
su
chmod 0666 /dev/msm_camera/config0
chmod 0666 /dev/msm_camera/control0
chmod 0666 /dev/msm_camera/frame0
chmod 0666 /dev/graphics/fb0
Thanks.
Click to expand...
Click to collapse
Can i use terminal emulator to run cmds frm phone ???
sent from the home of the "WIRE"

Related

[Q] Enable Development Mode on SGS2 custom-ROM by carrier

I just bought an SGS2 from a carrier in Brazil (TIM) but it came full of crappyware and most importantly: without the Development Mode option in Settings > Applications !!
So basically, although I could root it by replacing the kernel, I'm still not able to adb shell on it because of this issue.
Does anyone have an idea on how to enable the Development Mode through ConnectBot?
Also, how do I remount the SD from ConnectBot with 'rw'? You know... to remove all the crappyware...
Thank you
bruno.borges said:
I just bought an SGS2 from a carrier in Brazil (TIM) but it came full of crappyware and most importantly: without the Development Mode option in Settings > Applications !!
So basically, although I could root it by replacing the kernel, I'm still not able to adb shell on it because of this issue.
Does anyone have an idea on how to enable the Development Mode through ConnectBot?
Also, how do I remount the SD from ConnectBot with 'rw'? You know... to remove all the crappyware...
Thank you
Click to expand...
Click to collapse
dont you have cwm with replacing the kernel? so cant you flash a custom rom and with that everything you want? (still not dev relevant )
Sorry, I forgot to mention that I don't want to replace the stock ROM... not for now.
I'm waiting for CM7
bruno.borges said:
Sorry, I forgot to mention that I don't want to replace the stock ROM... not for now.
I'm waiting for CM7
Click to expand...
Click to collapse
ah okay. cm7 is already available almost everything is working. there are stock roms available for download in intratech's thread. without replacing your current rom it'll be difficult. I cant help more :-/
This thread should be in Q&A.
The first steps you need to take (rooting & custom recovery) are available in the CF-Root thread
Rawat said:
This thread should be in Q&A.
The first steps you need to take (rooting & custom recovery) are available in the CF-Root thread
Click to expand...
Click to collapse
he already did that: So basically, although I could root it by replacing the kernel, I'm still not able to adb shell on it because of this issue.
My question is: how to enable Development Mode from ConnectBot (terminal) directly from inside Android? Remembering that I have root
Again not dev and I'm not sure about connectbot but why don't you just replace settings.apk? Wouldn't t that take care of it instantly?
To replace settings.apk I need adb shell, or read-write access to mounted SD.
The reason I'm posting this to Dev question, is because devs are probably the ones with knowledge on how to do this.
I have root, I have terminal access to root (ConnectBot for example) and that's all.
I cannot adb shell into it because Development Mode option is not present on Settings > Applications.
How do I remount with read-write access the SD ? This way, I can download a settings.apk (new question: any hint from where I can get the stock-stock version?) and cp to /syste/app through ConnectBot
Use terminal emulator and remount system rw and then replace settings? Won't that work ?
Sent from my GT-I9100 using XDA App
Remounting with +rw worked. Carrier specific apps deleted. Now any hint on what settings.apk should I use? The one from CM7 ?
Must I replace SettingsProvider.apk too?
bruno.borges said:
Remounting with +rw worked. Carrier specific apps deleted. Now any hint on what settings.apk should I use? The one from CM7 ?
Click to expand...
Click to collapse
afaik different framework --> wont work. if you have a fast internet connection download a custom rom(based on samsung i.e. not miui or cm7), extract it and pick the settings.apk
take care. should match your present firmware. probably 2.3.3 and most of the users are on 2.3.4 or 2.3.5(miui+cm7)
or if anybody is so kind he could upload his settings.apk (i'm on miui so sorry)
http://forum.xda-developers.com/showthread.php?t=1182498
Flash that kernel with odin.
Download just about any rom, minus cm7, grab SettingsProvider.apk and Settings.apk from the zip file (/system/app/SettingsProvider.apk)
put them somewhere you can find them, open a command prompt in that directory.
(if you haven't setup adb properly you will need to drop everything in with the adb.exe file, but I would suggest setting it up properly.)
adb shell
su (accept on phone)
mount -o remount,rw /system
exit
exit
adb push SettingsProvider.apk /system/app
adb push Settings.apk /system/app
designgears said:
http://forum.xda-developers.com/showthread.php?t=1182498
Flash that kernel with odin.
Download just about any rom, minus cm7, grab SettingsProvider.apk and Settings.apk from the zip file (/system/app/SettingsProvider.apk)
put them somewhere you can find them, open a command prompt in that directory.
(if you haven't setup adb properly you will need to drop everything in with the adb.exe file, but I would suggest setting it up properly.)
adb shell
su (accept on phone)
mount -o remount,rw /system
exit
exit
adb push SettingsProvider.apk /system/app
adb push Settings.apk /system/app
Click to expand...
Click to collapse
Im 100% sure that the above WILL work..
But care to explain why you dont want to flash a custom rom?
Just curious..
Sent from my GT-I9100 using XDA Premium App
Which ROM do you recommend, that is mostly closer to stock Samsung TouchWiz 2.3.3 ?
I don't want to install CM7 yet because it still lacks some features.
bruno.borges said:
Which ROM do you recommend, that is mostly closer to stock Samsung TouchWiz 2.3.3 ?
I don't want to install CM7 yet because it still lacks some features.
Click to expand...
Click to collapse
modaco's prebaked ROM offers stock + a few tweaks that most people would find useful.
And although your questions would be best answered by those with developer knowledge, it still doesn't mean it should be posted here.
Also, even if you don't have terminal access, I'm pretty sure with root you can use Root Explorer to copy over the new settings.apk and setting the appropriate permissions.
Alright, thanks a lot!

Flash image gui?

Would this be a possible solution to our kernel flashing problems, I know it works for the evo
Sent from my HTC Amaze 4G using XDA App
DEFINITIONOFREAL said:
Would this be a possible solution to our kernel flashing problems, I know it works for the evo
Sent from my HTC Amaze 4G using XDA App
Click to expand...
Click to collapse
It's possible. In fact I mentioned this about a month ago to a developer.
I would like to see one that has a couple of options such as flashing recovery and flashing boot.img files.
You can easy push the flash_image binary to /system/bin and set the permission to 755. In fact my CWMFaux kernel does just that. Faux stopped using it because it doesn't always work.
In fact I made it so easy that all you need to do is push the boot.img to /system and reboot. Yet... no one uses it. In fact I suggested to a couple of rom developers to simply add the binary file to /system/bin so that you can at least run the command from terminal but they don't even want to do that. I like being able to update my recovery at anytime by entering "flash_image recovery /sdcard/recovery.img" and then just rebooting to recovery. You can easily do that for kernels too. But I suppose it's so much easier to carry a computer around.
Binary100100 said:
It's possible. In fact I mentioned this about a month ago to a developer.
I would like to see one that has a couple of options such as flashing recovery and flashing boot.img files.
You can easy push the flash_image binary to /system/bin and set the permission to 755. In fact my CWMFaux kernel does just that. Faux stopped using it because it doesn't always work.
In fact I made it so easy that all you need to do is push the boot.img to /system and reboot. Yet... no one uses it. In fact I suggested to a couple of rom developers to simply add the binary file to /system/bin so that you can at least run the command from terminal but they don't even want to do that. I like being able to update my recovery at anytime by entering "flash_image recovery /sdcard/recovery.img" and then just rebooting to recovery. You can easily do that for kernels too. But I suppose it's so much easier to carry a computer around.
Click to expand...
Click to collapse
Im going to contact joeykrim and see if I can get him to add support in his app, and Ive been using your method since I got the phone (2 days ago) and started reading, but still a little hassle, and a big htc fail
Sent from my HTC Amaze 4G using XDA App
DEFINITIONOFREAL said:
Im going to contact joeykrim and see if I can get him to add support in his app, and Ive been using your method since I got the phone (2 days ago) and started reading, but still a little hassle, and a big htc fail
Sent from my HTC Amaze 4G using XDA App
Click to expand...
Click to collapse
Keep me posted will ya?
I believe that Faux and other developers would have to use the zImage kernel flashing technique to get it to work with his existing app but I'm sure he can simplify it to accept .img files and the .ko files in the /system/lib directory of a zip file. It actually should be very easy. It took me about ten mintues with testing included to create the script for my method. I just can't code for apps else it would be done by now.
DEFINITIONOFREAL said:
Im going to contact joeykrim and see if I can get him to add support in his app, and Ive been using your method since I got the phone (2 days ago) and started reading, but still a little hassle, and a big htc fail
Sent from my HTC Amaze 4G using XDA App
Click to expand...
Click to collapse
I contacted pershoot, no answer lol!!!
Joeykrim is willing to support the Amaze, he just needs testers, this would be a great backup incase the new script failed to push the kernel. I'll keep everyone posted with updates
Sent from my HTC Amaze 4G using XDA App
I've been working with joeykrim getting his app setup for our device, it looks like it should work, hopefully, within the next couple of days we can get this working and released
Sent from my HTC Amaze 4G using XDA App
DEFINITIONOFREAL said:
I've been working with joeykrim getting his app setup for our device, it looks like it should work, hopefully, within the next couple of days we can get this working and released
Sent from my HTC Amaze 4G using XDA App
Click to expand...
Click to collapse
That would be wonderful!
I'm tired of having to repeat myself.
flash_image boot /sdcard/boot.img
flash_image recovery /sdcard/recovery.img
Binary100100 said:
That would be wonderful!
I'm tired of having to repeat myself.
flash_image boot /sdcard/boot.img
flash_image recovery /sdcard/recovery.img
Click to expand...
Click to collapse
I just wish the devs would use your script, it would make things so much easier
Sent from my HTC Amaze 4G using XDA App
DEFINITIONOFREAL said:
I just wish the devs would use your script, it would make things so much easier
Sent from my HTC Amaze 4G using XDA App
Click to expand...
Click to collapse
Once I see that they do I can work out something else like:
kernelupdate
recoveryupdate
kernelupdate would be
flash_image boot /sdcard/kernel/*boot*.img
recoveryupdate would be
flash_image recovery /sdcard/recovery/*recovery*.img
So that if you place ANY of the appropriate img file in the perspective folders on the sdcard partition it would flash the .img by just entering either of the two commands from adb shell or terminal.
But I'm not going to waste my time if the devs don't want to use it.
Binary100100 said:
Once I see that they do I can work out something else like:
kernelupdate
recoveryupdate
kernelupdate would be
flash_image boot /sdcard/kernel/*boot*.img
recoveryupdate would be
flash_image recovery /sdcard/recovery/*recovery*.img
So that if you place ANY of the appropriate img file in the perspective folders on the sdcard partition it would flash the .img by just entering either of the two commands from adb shell or terminal.
But I'm not going to waste my time if the devs don't want to use it.
Click to expand...
Click to collapse
could a script be written to automatically flash these while installing/flashing the custom rom? This would cut down atleast the step for flashing kernels for a lot of noobs!!
seansk said:
could a script be written to automatically flash these while installing/flashing the custom rom? This would cut down atleast the step for flashing kernels for a lot of noobs!!
Click to expand...
Click to collapse
Actually, yes! I did add it to the init.d script but since xboarder had removed the init.d scripts from his rom it doesn't work anymore. But you sure could. It was basically how I was setting up my CWMFaux kernels. However it didn't seem to work 100% of the time. Couldn't figure out why.
It basically worked like this...
Flashing the CWM custom kernel .zip via recovery.
copies boot.img to /system
copies init.d 06tweaks script to init.d folder.
copies and set permissions for flash_image binary and kernelupdate script to /system/bin directory.
You then boot your phone up which triggers the init.d script which commands the kernelupdate script to initiate. The kernel update script is simply using the flash_image binary command "flash_image boot /system/boot.img" and it automatically updates the kernel. Then the init.d script removes the boot.img file from the /system directory to keep it from flashing upon every boot.
I would like to change it to /sdcard directory but there's the problem that the sdcard doesn't get mounted until the very end. WAY after the system. Which is why I stored it there. The system gets mounted even before the data partition so I couldn't even store the file in data because the script would run even before the data partition could mount. Basically the script is initiated while your still looking at the boot animation. Pretty much when your softkey backlights and led light comes on it flashes the new kernel. It's a pretty neat workaround if I must say but unfortunately nowhere near perfect and not even close to having an s-off workaround.
Now if you don't mind the fact that it won't be initiated upon boot I could make it so that it will flash any file in a perspective folder on the sdcard.
example:
kernelupdate would update the kernel with any *boot*.img file located in a certain directory... say /sdcard/kernel
recoveryupdate would update the recovery with any *recovery*.img file located in a certain directory... say /sdcard/recovery
The problem:
Some people would want to collect their kernels and recoveries and store them in those directories. That would NOT be possible since using the command "flash_image recovery /sdcard/*recovery*.img would flash any img file with the word "recovery" in it. So if there's more than one it would error out and not flash anything because of the conflict. Same principal with the kernel only MOST kernels are simply named "boot.img" where-as almost all recovery files have a unique name since they are all already custom.
Binary100100 said:
Actually, yes! I did add it to the init.d script but since xboarder had removed the init.d scripts from his rom it doesn't work anymore. But you sure could. It was basically how I was setting up my CWMFaux kernels. However it didn't seem to work 100% of the time. Couldn't figure out why.
It basically worked like this...
Flashing the CWM custom kernel .zip via recovery.
copies boot.img to /system
copies init.d 06tweaks script to init.d folder.
copies and set permissions for flash_image binary and kernelupdate script to /system/bin directory.
You then boot your phone up which triggers the init.d script which commands the kernelupdate script to initiate. The kernel update script is simply using the flash_image binary command "flash_image boot /system/boot.img" and it automatically updates the kernel. Then the init.d script removes the boot.img file from the /system directory to keep it from flashing upon every boot.
I would like to change it to /sdcard directory but there's the problem that the sdcard doesn't get mounted until the very end. WAY after the system. Which is why I stored it there. The system gets mounted even before the data partition so I couldn't even store the file in data because the script would run even before the data partition could mount. Basically the script is initiated while your still looking at the boot animation. Pretty much when your softkey backlights and led light comes on it flashes the new kernel. It's a pretty neat workaround if I must say but unfortunately nowhere near perfect and not even close to having an s-off workaround.
Now if you don't mind the fact that it won't be initiated upon boot I could make it so that it will flash any file in a perspective folder on the sdcard.
example:
kernelupdate would update the kernel with any *boot*.img file located in a certain directory... say /sdcard/kernel
recoveryupdate would update the recovery with any *recovery*.img file located in a certain directory... say /sdcard/recovery
The problem:
Some people would want to collect their kernels and recoveries and store them in those directories. That would NOT be possible since using the command "flash_image recovery /sdcard/*recovery*.img would flash any img file with the word "recovery" in it. So if there's more than one it would error out and not flash anything because of the conflict. Same principal with the kernel only MOST kernels are simply named "boot.img" where-as almost all recovery files have a unique name since they are all already custom.
Click to expand...
Click to collapse
quite a dilemma, I wonder if we could add pause to the script until everything is loaded on the first boot then after the pause the script flahes the recovery and more importantly the kernel!!! if this was possible we could keep the files in a separate place on the SD card.
Still nothing like S-off!!! Thanks HTC for being so dev friendly
seansk said:
quite a dilemma, I wonder if we could add pause to the script until everything is loaded on the first boot then after the pause the script flahes the recovery and more importantly the kernel!!! if this was possible we could keep the files in a separate place on the SD card.
Still nothing like S-off!!! Thanks HTC for being so dev friendly
Click to expand...
Click to collapse
I'm sure there's a way to add a delay timer of some sort. I'm just not that savvy. Easiest way would be through an app like Tasker.
DEFINITIONOFREAL said:
Would this be a possible solution to our kernel flashing problems, I know it works for the evo
Sent from my HTC Amaze 4G using XDA App
Click to expand...
Click to collapse
The short answer is yes!
I've setup the application to support the HTC Amaze 4G, but before I release it publically and officially, I want to have a few testers confirm everything is working properly for them.
Posted all the information in a new thread as this one seems to be covering a few different topics so I didn't want to "hijack".
http://forum.xda-developers.com/showthread.php?p=21574722
Thanks for the request and for reaching out to me DEFINITIONOFREAL.
Binary100100 said:
Once I see that they do I can work out something else like:
kernelupdate
recoveryupdate
kernelupdate would be
flash_image boot /sdcard/kernel/*boot*.img
recoveryupdate would be
flash_image recovery /sdcard/recovery/*recovery*.img
So that if you place ANY of the appropriate img file in the perspective folders on the sdcard partition it would flash the .img by just entering either of the two commands from adb shell or terminal.
But I'm not going to waste my time if the devs don't want to use it.
Click to expand...
Click to collapse
I think my application, Flash Image GUI, will be the best alternative, but of course I have a biased opinion!
Regarding alternatives, I think a simple sh script which takes an argument would make a nice wrapper. The argument would be location to the image file to flash. The script could either bundle the flash_image binary or take the location of it as another argument.
All depends on how the developers want to create some type of standard. Which is another great reason Flash Image GUI will work well as it contains everything required and doesn't rely on developers providing support in their ROM, only relys on developers following the standards for ROMs and kernel .zip files.
Also, in looking through some of the custom ROMs and kernel .zip files for this device, I notice one of the custom kernels does something similar to the suggestions above, it executes a file located in /system/etc/init.d on every boot which automatically flashes /system/boot.img file.
At first glance I was horrified to see this as this is a *major* security issue. If anybody were to place any type of file in /system/boot.img, either a rogue kernel or just a blank file, the script automatically flashed it on boot w/o any type of file verification or user notification!
Wanted to get that off my chest and discourage the use of *automatic* loading of any type of major file, such as kernel or recovery image, especially without at least file verification or user approval/notification.
I'll try and keep up with the thread and help contribute ideas to alternatives for anybody who wants to develop/implement! Great ideas in the thread and always enjoy reading community collaboration efforts, especially in resolution to manufacturer "adjustments" of standards.
ugh, sorry about the double post (too excited for being too early in the morning). if a moderator wants to combine my last two posts, please do. i dont have access to delete a post.
joeykrim said:
I think my application, Flash Image GUI, will be the best alternative, but of course I have a biased opinion!
Regarding alternatives, I think a simple sh script which takes an argument would make a nice wrapper. The argument would be location to the image file to flash. The script could either bundle the flash_image binary or take the location of it as another argument.
All depends on how the developers want to create some type of standard. Which is another great reason Flash Image GUI will work well as it contains everything required and doesn't rely on developers providing support in their ROM, only relys on developers following the standards for ROMs and kernel .zip files.
Also, in looking through some of the custom ROMs and kernel .zip files for this device, I notice one of the custom kernels does something similar to the suggestions above, it executes a file located in /system/etc/init.d on every boot which automatically flashes /system/boot.img file.
At first glance I was horrified to see this as this is a *major* security issue. If anybody were to place any type of file in /system/boot.img, either a rogue kernel or just a blank file, the script automatically flashed it on boot w/o any type of file verification or user notification!
Wanted to get that off my chest and discourage the use of *automatic* loading of any type of major file, such as kernel or recovery image, especially without at least file verification or user approval/notification.
I'll try and keep up with the thread and help contribute ideas to alternatives for anybody who wants to develop/implement! Great ideas in the thread and always enjoy reading community collaboration efforts, especially in resolution to manufacturer "adjustments" of standards.
ugh, sorry about the double post (too excited for being too early in the morning). if a moderator wants to combine my last two posts, please do. i dont have access to delete a post.
Click to expand...
Click to collapse
I look forward to tryin out your app.
It was basically what this thread was all about in the first place.
The clockwork method that you mentioned is the only workaround that I was able to come up with for custom kernels (like Faux123) because a kernel cannot be flashed through recovery without s-off. Really stupid. So I started thinking "How can we flash a boot.img file from recovery without the typical means?" Then came up with the solution to flash_image the boot.img file automatically IF the file is detected. But how to start a script automatically upon boot? init.d is the only way I could think of. Okay... so where to put the boot? I tried the sdcard but it failed to mount until it was way too late. So... data. Nope... still didn't mount in time. Cache? Well... how many developers will include a cache file into their roms? So the only other option was /system and it seemed convenient since /system mounts BEFORE the script can run (obviously) so that's why it is as it is. I also figured "If someone wants to flash a new kernel all they need to do is push the boot.img to /system and reboot." Must easier than using the EKF method (requiring PC access) and I don't know about you but I'm not around a computer 24/7.

RE-Odex your custom ROM (Speed/RAM benefits and more)

Wanted to share this with fellow amaze users. It's a collection of scripts/binaries that will seamlessly reodex your /system/app and /system/framework folders. This will give you a noticeable increased in overall speed/fluidity, boot times, ram usage... I generally prefer to re-odex anything I use. Major downside to re-odexing is that you can't easily modify the APK. But honestly, it's not that difficult to simply deodex the APK in question, mod/theme it, then reodex it. I find the benefits are well worth it.
The original script was created by tommytomatoe. All credit goes to him for the actual creation of this script. I simply made a windows batch file to ease the setup and execution of said script.
Please PLEASE PLEASE make a NANDROID backup before you run this. I've never had it mess anything up, but who knows... just back up and be safe!..
ZIP is attached below. Unzip into any directory (make sure the files stay together) and run Dexo.bat - You MUST HAVE BUSYBOX, WORKING ADB (Wireless ADB support is built into the batch file), and ROOT!
I originally had a quick batch file made for just myself.. but I changed things around and made it a bit more user friendly and other things.... I've only tested it ONCE on my own device once (the modified one).. so just be warned.. and make a backup first!
The batch file will not close on its own, when it's done the device will reboot on its own. You can simply just close the window.
Hope this helps some people! Good luck.
--------------------
[What is Odex?]
During the build process, Android can be built with the flag “WITH_DEXPREOPT=true”. This means that the dex files are preoptimized in the build environment using a dalvikVM on the host, as opposed to optimized during boot on the device. The dex-preopt process results in two files per apk or jar – the jar/apk file and its accompanying .odex file.
----------------------
[What is so tricky about reodexing?]
Due to the nature of the dalvik VM (according to documentation in AOSP), the VM expects the optimization process to follow the strict BOOTCLASSPATH.
/* There are some fragile aspects around bootclasspath entries, owing
* largely to the VM's history of working on whenever it thought it needed
* instead of strictly doing what it was told. If optimizing bootclasspath
* entries, always do them in the order in which they appear in the path.
*/
So that is the dex-preopt during the build time. All the vendors ship devices with Odex, ie, stock ROMs are odex. What about ROMs that have been deodexed? Or how do you go about editing the smali code from the odex files? Thank goodness for JesusFreke, we have baksmali and smali. Using the two in sequence, one can successfully convert the optimized dalvik executable (odex) and dissemble it into a human readable (sorta) language called “smali”, created by JesusFreke and resembles the Jasmin language. Anyways, carrying on. Using the dexopt-wrapper binary, you can re-odex your ROM after it has been deodexed. This sounds pretty simple but as stated above, the VM expects the optimization to follow the BOOTCLASSPATH. You cannot silly nilly deodex android.policy.jar and then re-odex it. Your device will not boot. You must transfer the original “signature” from the original odex file to the newly created (Hint, dd if=original.odex of=new.odex bs=1 count=20 skip=52 seek=52 conv=notrunc). This can be done on a Linux machine or with the busybox binary.
OK. So what is this tool? I just wanted to give a brief (or not so brief) overview of the process. This tool doesn’t deal with partially odexed ROMs. This tool is for odexing a ROM that is completely DEODEX.
The benefits? Faster boot, smaller imprint on /data/ partition, overall faster feeling. The phone will generally just run a little bit faster, system apps will launch quicker..
The myths? I can’t theme ODEX! WRONG! You can theme odex just fine! Just use baksmali and smali.
This requires BUSYBOX.
This requires ADB.
Again HUGE THANKS to tommytomatoe for the original script and his original efforts.
THIS ZIP FILE IS NOT FLASHED IN RECOVERY! You simply extract it to a folder on your hard drive. Then run Dexo.bat, follow on screen instructions. Make sure to nandroid as well as having phone plugged in VIA USB with debugging enabled, or have wireless ADB ready to go.. batch file supports wireless. Just have to follow prompts and enter IP.
ericdjobs said:
Wanted to share this with fellow amaze users. It's a collection of scripts/binaries that will seamlessly reodex your /system/app and /system/framework folders. This will give you a noticeable increased in overall speed/fluidity, boot times, ram usage... I generally prefer to re-odex anything I use. [/B][/SIZE]
Click to expand...
Click to collapse
Tried this on my ICS ROM and it works fine.
Thanks!
Doesn't work for me :/
Sent from my HTC Ruby using xda app-developers app
avenged_sevenfold27 said:
Doesn't work for me :/
Sent from my HTC Ruby using xda app-developers app
Click to expand...
Click to collapse
Oh! It's not supposed to be flashed in recovery!
Sorry if I wasn't clear on that.
It's a script and a batch file. The batch file will make uploading the script, changing permissions, etc etc etc, a lot more intuitive and easier.
You simply need to extract the ZIP anywhere on your harddrive (Have to be using windows for the batch file to work.. if you're running Linux i'm sure you can figure out how to do it manually anyways) Make sure to keep all the files in the same folder.
Then simply execure dexo.bat and follow the prompts. Make sure you have the phone plugged in via USB and USB debugging enabled.. or have Wireless ADB running (batch has built in support for wireless ADB)
You can run it while the phone is on. The phone will reboot itself when the script is finished.
ericdjobs said:
Oh! It's not supposed to be flashed in recovery!
Sorry if I wasn't clear on that.
It's a script and a batch file. The batch file will make uploading the script, changing permissions, etc etc etc, a lot more intuitive and easier.
You simply need to extract the ZIP anywhere on your harddrive (Have to be using windows for the batch file to work.. if you're running Linux i'm sure you can figure out how to do it manually anyways) Make sure to keep all the files in the same folder.
Then simply execure dexo.bat and follow the prompts. Make sure you have the phone plugged in via USB and USB debugging enabled.. or have Wireless ADB running (batch has built in support for wireless ADB)
You can run it while the phone is on. The phone will reboot itself when the script is finished.
Click to expand...
Click to collapse
It goes through all the prompts for me, but then on the final "Press any key to continue" when I press any key, the batch file just closes with nothing being done to my phone.
Guess I should add, I'm using windows xp, and yes, usb debugging is enabled
masondoctorjt said:
It goes through all the prompts for me, but then on the final "Press any key to continue" when I press any key, the batch file just closes with nothing being done to my phone.
Guess I should add, I'm using windows xp, and yes, usb debugging is enabled
Click to expand...
Click to collapse
Hmm strange. I guess I should add instructions to do it manually, just in case something like this happens
Basically just open a command prompt, navigate to wherever you unzipped everything...
adb root
adb remount
(adb connect again here if using wireless)
adb push dexo /system/bin
adb push dexopt-wrapper /system/bin
adb push zip /system/xbin
adb push zipalign /system/xbin
adb shell chmod 755 /system/bin/dexo /system/bin/dexopt-wrapper /system/xbin/zip /system/xbin/zipalign
then the final command
adb shell dexo
let me know where at in this process it's getting snagged if that doesn't work.
ericdjobs said:
Hmm strange. I guess I should add instructions to do it manually, just in case something like this happens
Basically just open a command prompt, navigate to wherever you unzipped everything...
adb root
adb remount
(adb connect again here if using wireless)
adb push dexo /system/bin
adb push dexopt-wrapper /system/bin
adb push zip /system/xbin
adb push zipalign /system/xbin
adb shell chmod 755 /system/bin/dexo /system/bin/dexopt-wrapper /system/xbin/zip /system/xbin/zipalign
then the final command
adb shell dexo
let me know where at in this process it's getting snagged if that doesn't work.
Click to expand...
Click to collapse
Thanks... It might be a couple of days before I have a chance to try this again, but I'll let you know if this way works.
Sent from my HTC_Amaze_4G using xda app-developers app
Just ran the manual instructions since I had the same error noted above and all goes well until after the last adb shell dexo command; I get a message saying everything is installed but I also see this: Please install these binaries to continue: sed cp unzip. What does that mean?
Edit: I went ahead and rebooted anyway and nothing happened, still deodexed.
How can you tell if the custom rom you're on is dedoxed or redoxed? I'm on the ViperA
Sent from my HTC_Amaze_4G using xda app-developers app
kevinrubio1 said:
How can you tell if the custom rom you're on is dedoxed or redoxed? I'm on the ViperA
Sent from my HTC_Amaze_4G using xda app-developers app
Click to expand...
Click to collapse
Use root explorer or some similar app and go into system/apps and if you see any files right next to the app files that say .odex then you are not deodexed.
Also most custom ROM's state right in the OP if the are deodexed or not.
Sent from my HTC_Amaze_4G using Tapatalk 2
I don't have access to computer so can I run commands through terminal emulator?
Sent from my gt-1900 using xda premium
Doesn't work as of yet...
Followed the instructions
BusyBox Rooted S-off on ViperAmaze 1.7.1 ran the script as Admin and phone restarted after completion of script and stuck on bootscreen.
running fix permission and wiping dalvik+cache just in case if it works will report back EDIT: doesn't work had to recover nandroid
Can anyone dumb this thread down to what deodex/odex means to a person with no dev skills or
What can I do with deodex apks?
Is this a significant boost in speed etc?
Dumb and Dumber (remember the movie?)
blindskater39 said:
Can anyone dumb this thread down to what deodex/odex means to a person with no dev skills or
What can I do with deodex apks?
Is this a significant boost in speed etc?
Click to expand...
Click to collapse
When a Carrier releases a version of software it is ODEXED meaning you have an app like camera.apk, and you have a camera.odex
It's a file that contains the libraries and other things to support the apk.
When you DE-ODEX you build all of the stuff into the apk file so you don't need the .odex files.
it reduces the nuber of files in the rom. Meaning you now only have a camera.apk with no .odex file.
RE-ODEXING the apps and files makes it run faster.
That is taking the files back out of the apk file so you have two files again.
It seems easier to take DE-ODEXED files from one rom and use them in another rom, but you cannot just copy an apk that hasn't been DE-ODEXED into another rom without its' associated odex file.
How's that?! Hope it helps!
Looks like.... IT WORKS on Super Sense 3.2 (coming very soon)! This will speed it up big time!
chevycowboyusa said:
When a Carrier releases a version of software it is ODEXED meaning you have an app like camera.apk, and you have a camera.odex
It's a file that contains the libraries and other things to support the apk.
When you DE-ODEX you build all of the stuff into the apk file so you don't need the .odex files.
it reduces the nuber of files in the rom. Meaning you now only have a camera.apk with no .odex file.
RE-ODEXING the apps and files makes it run faster.
That is taking the files back out of the apk file so you have two files again.
It seems easier to take DE-ODEXED files from one rom and use them in another rom, but you cannot just copy an apk that hasn't been DE-ODEXED into another rom without its' associated odex file.
How's that?! Hope it helps!
Click to expand...
Click to collapse
For the most part its much easier to comprehend, thanks! But why can't you copy a de-odexed apk to another rom if it doesnt which doesnt need the .odex files anymore?
blindskater39 said:
For the most part its much easier to comprehend, thanks! But why can't you copy a de-odexed apk to another rom if it doesnt which doesnt need the .odex files anymore?
Click to expand...
Click to collapse
You can. I'm sorry if I complicated that part..
Sent from my HTC_Amaze_4G using xda app-developers app
this may be a stupid question but will this work on cm11?
dtr145r said:
this may be a stupid question but will this work on cm11?
Click to expand...
Click to collapse
No, CM11 is already deodexed.
SuperAfnan said:
No, CM11 is already deodexed.
Click to expand...
Click to collapse
well yea,
i know that.
thats the point, to 'RE-Odex' it....

(L5 II) CWM for Locked Bootloader(Beta 2)

Hey guys
I finished building CWM Recovery for locked bootloaders.
its still in the beta phases.... actually there was no alpha tests because no one on my team has a l5 II.
Due to forum rules I cannot choose who I want to give this recovery or exclude anyone from using it. so if you are a noob I cannot stop you from using it but please dont blame me if you brick your device!!!!!
The recovery as far as I know has no errors.
I have tested flashing Mother of all ad blocking and it worked perfectly.
How Does It Work?
the recovery uses 2nd int.
when your phone boots It is hacked to load scripts from init.d folder.
inside the init.d folder there is a script called 1.unsecure
this stops the system an kills process and launches the recovery.
How Do I Install?
Busybox must be installed
Extract the zip(attached)
Run the init.bat
Enjoy
How Do I Enter Recovery?
Reboot
after the lg logo before your boot animation starts repetitively hit the Vol + key
or run the reboot recovery app
Who do I thank?
ME for all the hard work testing and retesting
@IGGYVIP for giving me hope that its possible and all the support he has given me so far.
Optima Team for being such a great team
Can I port this to my device?
Yes!!
Port this to as many devices as possible. If you need advice or need to know how to port feel free to PM me.
It doesnt work for me?
some user experience problems when the script applies permissions
to fix this
Change permissions to all files in /system/bootstrap/* to 775
Download
DOWNLOAD
Great work man! Optima Team is proud of you!!!
Sent from my GT-I9300 using Tapatalk
slipsystem said:
Hey guys
I finished building CWM Recovery for locked bootloaders.
its still in the beta phases.... actually there was no alpha tests because no one on my team has a l5 II.
Due to forum rules I cannot choose who I want to give this recovery or exclude anyone from using it. so if you are a noob I cannot stop you from using it but please dont blame me if you brick your device!!!!!
The recovery as far as I know has no errors.
I have tested flashing Mother of all ad blocking and it worked perfectly.
How Does It Work?
the recovery uses 2nd int.
when your phone boots It is hacked to load scripts from init.d folder.
inside the init.d folder there is a script called 1.unsecure
this stops the system an kills process and launches the recovery.
How Do I Install?
Busybox must be installed
Extract the zip(attached)
Run the init.bat
Enjoy
How Do I Enter Recovery?
Reboot
after the lg logo before your boot animation starts repetitively hit the Vol + key
Who do I thank?
ME for all the hard work testing and retesting
@IGGYVIP for giving me hope that its possible and all the support he has given me so far.
Optima Team for being such a great team
Can I port this to my device?
Yes!!
Port this to as many devices as possible. If you need advice or need to know how to port feel free to PM me.
Download
https://dl.dropboxusercontent.com/u/51036208/Android/Stock/cwm.zip
Click to expand...
Click to collapse
why not mod one of the 2nd-init recovery apks with this?? Make much simpler for n00bs as well as give the reboot to recovery option.
Modding the apk I have exp with, I just never had any success building a working 2nd-init binary.
PlayfulGod said:
why not mod one of the 2nd-init recovery apks with this?? Make much simpler for n00bs as well as give the reboot to recovery option.
Modding the apk I have exp with, I just never had any success building a working 2nd-init binary.
Click to expand...
Click to collapse
The apk pushes the script to a different location and only executes on the l3 ii. So the app doesn't work on the l5 ii. I would have to do allot of editting. Enable init.d and change where the files get pushed to.
But it's pretty simple for noobs.
And this is not ment for noobs as I said on my thread its still on beta testing.
slipsystem said:
The apk pushes the script to a different location and only executes on the l3 ii. So the app doesn't work on the l5 ii. I would have to do allot of editting. Enable init.d and change where the files get pushed to.
But it's pretty simple for noobs.
And this is not ment for noobs as I said on my thread its still on beta testing.
Click to expand...
Click to collapse
ahh, I've just messed with 2nd-init on the LG Motion & Spirit and the same apk works on the F3, F6, & F7 (I think). The Spirit no longer needs 2nd-init tho.
PlayfulGod said:
ahh, I've just messed with 2nd-init on the LG Motion & Spirit and the same apk works on the F3, F6, & F7 (I think). The Spirit no longer needs 2nd-init tho.
Click to expand...
Click to collapse
Ya I think the apology works on most devices. If not then mine should work pr you will just have to change the key. It's pretty simple to port. I will try make. A guide tommorow
Awesome Work Mate !!!
@slipsystem
Great Job
You have made so much more out of that apk then i ever would
I can see Newsworthy thread when porting to other devices works
I can't reboon in recovery mode
Hello, I can not reboot in recovery mode, I was run the init.bat, then, reboot my L5 II (e450f) and pressed repetitively the Vol + key. But I never reboot in recovery
Could you help me?
PS. Your team is awesome!!
jamonazo3000 said:
Hello, I can not reboot in recovery mode, I was run the init.bat, then, reboot my L5 II (e450f) and pressed repetitively the Vol + key. But I never reboot in recovery
Could you help me?
PS. Your team is awesome!!
Click to expand...
Click to collapse
Check
/data/local/tmp
There is a file called init.d_log_test
Check if you have that file
Open it check if the date and time matches your last reboot.
Great! Now we only need custom roms and android updates.
jamonazo3000 said:
Hello, I can not reboot in recovery mode, I was run the init.bat, then, reboot my L5 II (e450f) and pressed repetitively the Vol + key. But I never reboot in recovery
Could you help me?
PS. Your team is awesome!!
Click to expand...
Click to collapse
Sorry its dues to permissions
Change permissions to all files in /system/bootstrap/* to 775
slipsystem said:
Sorry its dues to permissions
Change permissions to all files in /system/bootstrap/* to 775
Click to expand...
Click to collapse
the init.sh has chmod rules to 755
the attached one has 775
Updated Version in first post!
Now Includes Reboot Recovery app
and hopefully fixed permission problem.
slipsystem said:
Check
/data/local/tmp
There is a file called init.d_log_test
Check if you have that file
Open it check if the date and time matches your last reboot.
Click to expand...
Click to collapse
Hello, I was open /data/local/temp/ and only can see a file recoverylog.txt
I will check your new update.
Thanks for all
IGGYVIP said:
the init.sh has chmod rules to 755
the attached one has 775
Click to expand...
Click to collapse
sorry my math is bad. the permission are meant to be 755. for some reason when shell is changing permissions it gets permission denied.
I think that the script 001unsecureboot doesn't kill the bootanimation, in fact when I reboot to recovery there is the bootanimation (deformed and with strange colors) on the screen, and only when I press a key the recovery appears for one second.
After adding the line "$BB killall bootanimation" after "$BB mount -o remount,rw /system /system", the issue is solved.
ownership ?
slipsystem said:
sorry my math is bad. the permission are meant to be 755. for some reason when shell is changing permissions it gets permission denied.
Click to expand...
Click to collapse
May be try changing owner to root before changing permissions ?
in the .sh add this code before chmod but after the remount,rw
Code:
chown -R root /system/bootstrap
in theory as its owner it must allow change of permission
Let me know
IGGYVIP said:
May be try changing owner to root before changing permissions ?
in the .sh add this code before chmod but after the remount,rw
Code:
chown -R root /system/bootstrap
in theory as its owner it must allow change of permission
Let me know
Click to expand...
Click to collapse
I actually had the script setting permission for
/System/etc/bootstrap
And not
/System/bootstrap
@HandyMenny
Thanks For that. I added that in a update.
slipsystem said:
I actually had the script setting permission for
/System/etc/bootstrap
And not
/System/bootstrap
Click to expand...
Click to collapse
with system as System? never had em capped b4.

KPPD - Configure post-processing settings of your display! [2015/08/09]

Hello all! If you're familiar with KCAL and suffer from symptoms such as a locked bootloader or non-loadable kernel modules then you may be interested in KCAL Post-Processing Daemon, or KPPD - the all-in-one display tuning tool that you can use to customize your color calibration on the fly!
This does NOT require an unlocked bootloader, custom kernel, or even a kernel that supports module loading, just run the daemon and you're good to go!
To install on a device with a locked bootloader, you'll need to download the kppd release below, and unpack it to prep for some adb fun... (If you have TWRP, you can also flash this in recovery)
Code:
adb push /path/to/kppd /data/local/tmp/
adb push /path/to/postproc.conf /data/local/tmp/
adb shell
su
mount -o rw,remount /system
cp /data/local/tmp/kppd /system/bin/
cp /data/local/tmp/postproc.conf /system/etc/
chmod 0755 /system/bin/kppd
chmod 0644 /system/etc/postproc.conf
reboot
Now at this point, you can use any scripting app to start the daemon on boot, I use ROM Toolbox... http://i.imgur.com/0juzfug.png
And you're done! To edit your display settings, just edit the postproc.conf file... http://i.imgur.com/pjOPbIr.png
Download KPPD
Thanks, works great. Now we need some custom configs
any chance you can update your KCAL Color Control app to support KPPD? Easy way to set the values
Thanks Savoca! I have followed all of your work fairly closely and am very glad we have you around the forums!
This is amazing. Would it work for other LG tablets such as the LG X8.3 with the snapdragon 610?
My G4 is pretty decent but my tablet is super red. Once you get it setup, you constantly have to have Rom Toolbox installed to make this work or do you only need the app for the initial setup?
I think I can answer the second part of this. The rom toolbox thing is just one of many ways to run this script on boot. But you will need SOMEthing to start it no matter what. This could be init script (I think that's what its called, which some roms have built in) Or any custom rom could include it by default.
So no, Rom toolbox isn't really necessary, its just the way he recommended to get it running on boot if you don't know another way.
I am more curious to seen if it will work on my LG tablet. I'll just have to test it out. I guess worst case scenerio is you dont have it auto start on boot. If you mess it up you just reboot.
player911 said:
I am more curious to seen if it will work on my LG tablet. I'll just have to test it out. I guess worst case scenerio is you dont have it auto start on boot. If you mess it up you just reboot.
Click to expand...
Click to collapse
Yes it should work, however it depends on each device's version of the MDSS (Qualcomm display driver). If it doesn't work, let me know so I can add support for it.
I'm wondering if this would work on my G Flex 2 ? Is there any chance that it can break anything if it doesn't work?
---------- Post added at 03:37 PM ---------- Previous post was at 03:05 PM ----------
I've just installed it on my G Flex 2 and it works great. Thanks a lot!
how control this mod with KCAL apk???
armsar1978 said:
how control this mod with KCAL apk???
Click to expand...
Click to collapse
You can't (yet?). Only via the config.
New version uploaded significantly reduces CPU load and removes any delay between modifying the postproc.conf and applying the display settings.
I've read a little and I remember making rgb adjustments regularly with my old gnex years ago...
Wondering if there are suggested settings/values one can recommend for use with the G4 please.
I second this g4 question, any recommended values?
dontbeweakvato said:
I second this g4 question, any recommended values?
Click to expand...
Click to collapse
I'm using these right now: http://imgur.com/UKkOt7x
If you're editing the file at runtime, I recommend you use either FX File explorer or ES File Explorer to edit the config, root explorer and ROM toolbox editors delete the original file and rewrite a new one for some reason (maybe they can fix this in their apps) and kppd looses the original from the kernel.
Does this have an option for sharpness?
"su" doesnt work -> not found
Z900 said:
"su" doesnt work -> not found
Click to expand...
Click to collapse
You need to root your device.
savoca said:
I'm using these right now: http://imgur.com/UKkOt7x
If you're editing the file at runtime, I recommend you use either FX File explorer or ES File Explorer to edit the config, root explorer and ROM toolbox editors delete the original file and rewrite a new one for some reason (maybe they can fix this in their apps) and kppd looses the original from the kernel.
Click to expand...
Click to collapse
"Error occurred while trying to save file. File will not be saved." - using es file explorer. I seem to not have issues with rom toolbox. What's the deal with it not saving after editing?
dontbeweakvato said:
"Error occurred while trying to save file. File will not be saved." - using es file explorer. I seem to not have issues with rom toolbox. What's the deal with it not saving after editing?
Click to expand...
Click to collapse
Sounds like an issue with the app. You could always move the config file to somewhere on /data where you would have write access. Just point kppd to the config location in the init script.

Categories

Resources