10mb ram hack script Idea - G1 General

In my opinion it would be much easier to add a script to the sd then to flash a entire new rom. is it possible for the rom to boot and read a script on the sd enabling the 10mb hack so we dont have to wait for WG to release a rom.

NO 10MB hack has to be in the boot.img a script will not cut it.

It definitely can not be done as a script itself, but you also do not have to wait for a new ROM. If you either compile the boot image yourself, or obtain one from someone else, that is compatible with your ROM, just put the boot.img on your sd and enter into the terminal:
Code:
su
flash_image boot /sdcard/boot.img
reboot

Related

[HACK] Run scripts at boot-time on stock rooted 3.2 without reflashing (nfs modules)

Hi,
When you want to perform some scripts at boot-time, there is two possibilities :
- modify init.rc, but it requires to reflashing the rootfs image (modification in / does not hold after a reboot),
- using an android app like script manager, which will load your scripts at java/dalvik platform boot-time.
I've managed to find a way based on activating tf-daemon, which is a script called by the asus/ventana initrc, but disabled at boot-time. Basically, we're re-enabling this daemon by setting the property tf.enable to yes, and then creating a script called tf-daemon and put it in /system/bin. Since this script is called by init.ventana.rc as root, you can put whatever you want inside this script.
I don't know what is the original purpose of this daemon, but probably it's used by the asus team for internal and debugging purpose.
Be aware that in the next firmware update, this possibility could disappear.Let's hope the asus team does not read this post. Or at least they could allow power users to call custom scripts at boot-time.
As a case study, you will find as attachment a script for loading nfs modules at boot-time.
PS: damn, can't upload. Here is a temporary link : http://dl.free.fr/hwTZ0YBq2
Untar the archive, then su, and sh install.sh
At reboot, you should have nfs modules loaded.
Good find:
I gave this a try just to load a couple of my own modules that work with the kernel I'm using. Works fine -- Thanks, -
Another method is to make a script and just call it in the init.rc. After a firmware update you only have to add the "exec myscript.sh" line to init.rc. I personally prefer this method because it allows me to control when the script is executed, whereas the tf-daemon method is always executed at the same point(AFAIK). Good research though, always nice to know all the boot calls.
Modifying the init.rc was my first shot, but the problem is that init.rc lies in ramdisk. So when trying to modify, the modification does not hold
after reboot. So a real modification involves to reflash rootfs with nvflash, too much hassle for me. The method I'm providing is for lazy ones. ;-)
nice find, but the link is dead, could you please provide a new link for the script?
also, how do I load nfs module for there is none under /lib/modules, compile the kernel myself?

[Q] how can re-root the offical update?

hi.. after following the instructions on how to downgrade my phone, and obtain root, i have, and after i had my foryo rooted, i downloaded RUU_Vision_Gingerbread_S_HTC_WWE_2.42.405.2 because my original intent was to have a rooted gingerbread and it didn't make much sense to have roms provided by htc itself.
but now i see i don't have root, so oops, i guess i was wrong.
so do i have to go though the whole kaka procedure again, and then find a custom rom, because my end game, is to have as close as possible a rooted gingerbread as close as possible to the original HTC rom. where can i get one?
oh, and what's the difference between the asia and wwe? does any of them handle hebrew bidi writing correctly (without applying the patch?)
I think there is a way to root gingerbread, or you have to downgrade. At either rate, you want to get to a place where you can flash your own ROM. Having clockworkmod installed would be just fine.
Then you would take the stock gingerbread, extract and unzip it, add Superuser and su, make the boot insecure, repack it for flashing, flash via CWM, and presto- rooted stock gingerbread. If you want to build in hebrew bidi writing, you can add that too.
There might be a few rooted stock gingerbread roms out there, but it seems that the trend is toward cooked up versions, rather than stock.
AFAIK i don't there's a way to root gingerbreak, it's un-rootable, that's why i downgraded in the first place. i think i can do it again, question is:
where do i find the stock gingerbread rom? is it in the RUU exe? if so, how get it out from there, without installing it
second, how on earth would i do all the things you said (add su,make boot insecure,repack,flash cwm).
is there a guide out there for all there above?
I think there is a some software for windows that will allow you to extract the rom from the RUU. I don't use windows, so I don't know anything about it. I've seen some posts about it, so I can say it seems to involve using the RUU to almost install the ROM, but at the last minute, just stop and the ROM will be extracted into one of the temp directories. You just use the RUU to extract the rom, not install it.
As far as all those other steps, I think all the information is scattered about xda.
Here's some information about the insecure boot image. It's for the transformer, but it's essentially the same thing, except for the blob parts. You'll have to use something like splitbootimg or bootunpack, and mkbootimg (search for them) instead of blobunpack.
http://forum.xda-developers.com/showthread.php?t=1193737
This might be more helpful:
http://forum.xda-developers.com/showthread.php?t=1100189
As for the other parts, you can use some of the other updates and zip files as a guide to figure out how to unpack, mod them, and repack them. I think there might be a rom kitchen script that will do this too, but I can't speak to that either.
Sorry if this sounds so complex- it's not that bad once you've done it once. I have a rooted stock GB that I made this way from the GB update, but it's the US version. Let me know when you have the WWE version extracted.
ok, let's take it one step at a time, (maybe we'll make a guide out of it
i activated the but i never continued instead i used process explorer to find out which files it's holds, so i got the temp directory and extracted rom.zip a 260 mg file (containing various img files)
now what?
btw is this relavent? http://android-dls.com/wiki/index.php?title=HOWTO:_Unpack,_Edit,_and_Re-Pack_Boot_Images
yea, i've seen it is, but one issue is that where do i get the cpio and makebootfs, (if i need to compile stuff, this is where i stop, i allready downloaded the perl scripts, as well as GZIP
ok, so far so good.
That link is exactly what you need. You can use that info to unpack the boot.img and make it insecure "ro.secure=0" by editing the default.prop file in the ramdisk.
I think some of the links to the tools might not work, but these will work instead - https://github.com/AndroidRoot/BootTools
Use the guides to mod and then repack the ramdisk
put the kernel and the modded ramdisk back together with makebootimg. There might be some specific command lines and kernel addresses- the hdrboot tool will show you want they should be from the original boot.img
Also, could you upload the zip file or PM me a link? This would be a perfect project for a guide.
ok wait, which tools am i missing? i have a windows machine (ultimate 7 64 bit) and the boottools needs to be compiled, (i don't have developer studio installed just eclipse)
so far i have the following tools:
repack-bootimg.pl
unpack-bootimg.pl
split-bootimg.pl
cpio for windows
gzip
what zip file?
(i'm going to sleep now as i'm in israel,i will "boot" in 6 hrs, luckily i have a vacation tommorow, so i hope we'll have time to finish this.
I think you might need gunzip to extract the ramdisk. unzip might work, but I'm not sure with Windows.
The zip is the rom.zip which has the rom.
I seem to recall there being at least 2 rooted stock ROMs in the dev forum. I think the one I've used was posted by either suilmagic (may be siulmagic), or rmk40. Xboarder56 posted one some time ago, but he started stripping things out that I used, like QuickOffice. If nothing else, this finally drove me to use Titanium backup...
Sent from my HTC Vision using Tapatalk
Yeah, I guess a search would take some of the fun out of it....
http://forum.xda-developers.com/showthread.php?t=1169004
actually i DID google "rooted stock rom desire z"
but i could find anything for sure, that's why i posted this, is this rom appear in the developer list of roms linked in the downgrade wiki? because i couldn't find it there either, would be nice if it was added.
No worries- I didn't actually search for it- I just paged through some of the dev sections.
I think you'll have flash it using CWM recovery.
great, i'm assuming CWM is Clockwork something?
Yup- look for the 3.x version. There was a 5.x, but i think it has some issues.
ok, so now, i must re-downgrade, root,
http://forum.xda-developers.com/wiki/ClockworkMod_Recovery
get rom manager, and ah... wait, what's the update.zip? is that actual image i need to place on the sdcard?
That wiki seems kinda old- I don't think the stock recovery will flash the update.zip
This is more up to date and specific for the G2/DZ:
http://forum.xda-developers.com/wiki/HTC_Vision#Rooting_the_Vision_.28G2.2FDZ.29_and_DHD
yea i've read that one (that's how i rooted in the first place.
isn't there a way to short ciruit this somehow and instead of pc10img have the update itself installed ? or is it because it's a an OTA, i have to do the whole thing?
looking at the image, i think i'm missing someting it looks like i can somehow use the scripts inside the image when i get temp_root (meaning i won't have to update the original image. am i wrong?
ok i've gone through the motions over and over, finally rooted it, have rom manager, clicked flash recovery, copied the zip file for rom i wanted to the root of sdcard, selected it rom manager, rebooted, now i selected apply update from sdcard,
now i see the hat signal and nothing happens, (i also selected backup rom and wipe cache and data)
i also noticed that i have install zip from sdcard, but i didnt' select it, how long should it take?
ok i FINALLY managed to install (it actually i pressed power button again and immdietly returned the cwm main menu, from then on, i chose reboot, i think it's moved on.
problem is, some things looked odd, for example the phone bar on the buttom, looks distorted, when i click on the application list i can only see half the list (meaning half the screen shows the list although i can scroll up and down the buttom half remains blank..
never mind it's ok now after re-boot..
btw i tried creating a batch file like so:
adb shell cat /dev/msm_rotator
rem expected output
rem /dev/msm_rotator: invalid length
pause
rem temp_root
rem adb push fre3vo /data/local/tmp
rem adb shell chmod 777 /data/local/tmp/fre3vo
rem adb shell /data/local/tmp/fre3vo -debug -start FAA90000 -end FFFFFFFF
echo wait for device to reconnect
pause
adb push misc_version /data/local/tmp/misc_version
adb shell chmod 777 /data/local/tmp/misc_version
adb shell /data/local/tmp/misc_version -s 1.00.000.0
adb shell sync
adb shell dd if=/dev/block/mmcblk0p17 bs=1 skip=160 count=10
rem expected output is:
rem 1.00.000.010+0 records in
rem 10+0 records out
rem 10 bytes transferred in 0.001 secs (10000 bytes/sec)
pause
rem downgrade
rem wget http://www59.multiupload.com:81/fil...118187CA1236F3BA6767A7/1.34.405.5_PC10IMG.zip
adb push 1.34.405.5_PC10IMG.zip /sdcard/PC10IMG.zip
adb reboot bootloader
but it didn't workout so much, don't know why it said something about it couldn't write recovery img file
Umm if you already rooted via the xda wiki then you should've had a bootloader that was engineering s-off right? Just saying because you could've flashed a custom rooted rom through bootloader and not had to re-root, that is unless the ruu applied an updated bootloader with s-on. Maybe boot into bootloader and see if the top line says PVT ENG S-OFF, worth a look anyway, could save you some headache
Sent from my Bulletproof G2
actually i'm haveing another headache a couple actually, for some reason, during the restore, it failed to download google maps among the gailion apps i downloaded, now i can't download no matter, i tried installing it manually, and it worked, but i can't see in the market.
the market on the web site says the application is not compatible.
also when i tried using anysoft keyboard and use the hebrew fonts, even though it installed i still couldn't get the keyboard.
right not i have no idea what's the state of my phone.

Port ICS to Motorola Defy Mini

I open this thread to motivate to carry ice cream sandwich to our Motorola Defy Mini, and now we need to update root our devices and enjoy the latest versions of android.
Let's see if we can all get something.
I searched the internet and found yesterday that the Motorola Defy mini and htc xplorer have the same hardware, and the latter has adapted cyanogenmod 9.1, we can start there.
Let's try in this thread and with the help of all get a fully functional ics rom.
Please someone can move thist post to defy development
davis15 said:
Please someone can move thist post to defy development
Click to expand...
Click to collapse
Have you found new informations about the CM for defy mini? I am really impatient !!
You can find some kind of hw comparison on wikipedia's Snapdragon chipset:
http://en.wikipedia.org/wiki/Snapdragon_%28system_on_chip%29
and look at similar models what for support they got
.
CM10 HTC Explorer (Pico) port
First thing: What SystemROM size showing in Titanium Backup?
Model name will show as A310 (Explorer). Try that because I don't have Defy Mini. Build contains stock defy mini kernel. Defy Mini recovery: http://forum.xda-developers.com/showthread.php?t=2187074. Make nandroid of stock rom. Tell if you can boot to it. If yes i will try made custom kernel (kexec or 2ndboot) & simpler cwm usage (2ndinit or 2ndboot) ,Model name will show as A310 aka Pico. If not, when restore nandroid or reflash stock rom via RSD Lite.
LINK: http://www.gigasize.com/get/g3kc53g7o7d
Also: if it boots make screenshot (better photo cause i will know if you didn't faked) of About Phone.
new stock roms
I just got a new Motorola Defy Plus phone with gingerbread 2.3.x stock rom.
Where can I find a Motorola Defy Plus ICS or Jellybean stock rom?
Not Cyanogenmod or AOKP/AOSP.
Is there any such thing as a stock ICS or Jellybean for Motorola Defy Plus rom?
So far all I see is cyanogen/aokp/aosp ics and jellybean roms.
Does this means that most likely there are no stock ics/jellybean roms for the phone?
Thanks
Misterjunky said:
I just got a new Motorola Defy Plus phone with gingerbread 2.3.x stock rom.
Where can I find a Motorola Defy Plus ICS or Jellybean stock rom?
Not Cyanogenmod or AOKP/AOSP.
Is there any such thing as a stock ICS or Jellybean for Motorola Defy Plus rom?
So far all I see is cyanogen/aokp/aosp ics and jellybean roms.
Does this means that most likely there are no stock ics/jellybean roms for the phone?
Thanks
Click to expand...
Click to collapse
http://forum.xda-developers.com/showthread.php?t=1795647
created kernel for defy mini
For who is interested:
I created an ICS kernel based upon the motorola sources merged with some stuff from a 3.4 kernel from code aurora.
You can find it on https://github.com/de-wolff/android_kernel_motorola_xt320.git
I think it is capable of everything you need, but I am still working on the CM stuff for it.
(At this moment my phone can start using fastboot, into a CM9 version.I have a working touch screen, a working volume button, audio, when I touch the screen, and a working shutdown. I will commit this also soon, so anyone who is interested, can create his own CM9 version)
If someone can point me to how 2nd boot is supposed to work, I would be very thankful.
de-wolff said:
For who is interested:
I created an ICS kernel based upon the motorola sources merged with some stuff from a 3.4 kernel from code aurora.
You can find it on https://github.com/de-wolff/android_kernel_motorola_xt320.git
I think it is capable of everything you need, but I am still working on the CM stuff for it.
(At this moment my phone can start using fastboot, into a CM9 version.I have a working touch screen, a working volume button, audio, when I touch the screen, and a working shutdown. I will commit this also soon, so anyone who is interested, can create his own CM9 version)
If someone can point me to how 2nd boot is supposed to work, I would be very thankful.
Click to expand...
Click to collapse
2nd-boot is similar to how 2nd-init works where it uses a hijack to and it boots the custom kernel on top of the Motorola Stock kernel. It basically consists of a miniature bootloader to execute 2nd-boot. Can please upload what you have so far? I can help you to debug it. Thanks.
more progress
I am able to make a booting system, using code at:
https://github.com/de-wolff/android_device_motorola_xt320
I produced images and kernel:
http://dewolff.home.xs4all.nl/system.tar.gz
http://dewolff.home.xs4all.nl/kernel
http://dewolff.home.xs4all.nl/recovery.img
http://dewolff.home.xs4all.nl/boot.img
It boots (using fastboot), display working, touchscreen working, onscreen keyboard working.
I am convinced the kernel is complete, but I have still to create a correct camera.lib, and correct audio libs.
Also the gpu is not used (yet), but that is a matter of finding the right egl adreno libraries, and creating the correct libgsl.
If anyone wants to explore it: In system/lib/egl is egl.cfg.
This is a text file. When you remove the # on the second line, after reboot the system will try to use the adreno gpu.
The way to put system on the phone is extract on your system (eg using) remove all files in the existing system, create all directories on the system, and then transfer all files using adb push.
de-wolff said:
I am able to make a booting system, using code at:
https://github.com/de-wolff/android_device_motorola_xt320
I produced images and kernel:
http://dewolff.home.xs4all.nl/system.tar.gz
http://dewolff.home.xs4all.nl/kernel
http://dewolff.home.xs4all.nl/recovery.img
http://dewolff.home.xs4all.nl/boot.img
It boots (using fastboot), display working, touchscreen working, onscreen keyboard working.
I am convinced the kernel is complete, but I have still to create a correct camera.lib, and correct audio libs.
Also the gpu is not used (yet), but that is a matter of finding the right egl adreno libraries, and creating the correct libgsl.
If anyone wants to explore it: In system/lib/egl is egl.cfg.
This is a text file. When you remove the # on the second line, after reboot the system will try to use the adreno gpu.
The way to put system on the phone is extract on your system (eg using) remove all files in the existing system, create all directories on the system, and then transfer all files using adb push.
Click to expand...
Click to collapse
Use the Adreno Libs from the Qualcomm website. Is Hardware Acceleration working? How come it's saying its CM7 in the Github
@MauroSZ This is the instructions on how to install the custom ROM.
Use these commands in cmd
Code:
fastboot erase system
Code:
fastboot -w
Code:
fastboot boot recovery.img
Now mount /system
Code:
adb shell
Code:
mount -o remount,rw -t yaffs2 /dev/block/mtdblock11 /system
Code:
exit
Code:
adb push system.tar.gz /sdcard
Code:
adb shell
Code:
cd /system
Code:
busybox tar xvzpf /sdcard/system.tar.gz
Code:
exit
Code:
adb reboot-bootloader
Code:
fastboot boot boot.img
And you will boot into the custom ROM.
EDIT: Custom ROM is not BOOTING
@Guitwo2 @Bernd.Defy @wilberfish and @junk031 There is a custom ROM for Defy Mini by @de-wolff
Read the previous post for installation instructions.
@de-wolff, I'm getting a blue screen, is that how it boots up?
Going to try this later. Sounds great!
Sent from my HTC Desire C using xda app-developers app
rootdefyxt320 said:
I'm getting a blue screen, is that how it boots up?
Click to expand...
Click to collapse
No, this is when you use a normal boot (with old kernel)
At this moment you have to boot using fastboot:
$fastboot boot boot.img
When I have everything more working, and the rom is smaller (at this moment it is 136M and the gapps are not even installed on it.) I will try to implement 2ndboot in the rom,
And I will also create a more user friendly way to install it.
de-wolff said:
No, this is when you use a normal boot (with old kernel)
At this moment you have to boot using fastboot:
$fastboot boot boot.img
When I have everything more working, and the rom is smaller (at this moment it is 136M and the gapps are not even installed on it.) I will try to implement 2ndboot in the rom,
And I will also create a more user friendly way to install it.
Click to expand...
Click to collapse
Contact @Hashcode to port 2nd-boot to our device. Upload our stock init.rc and he will find a 2nd-init hijack. Once, we have the hijack, we can boot into 2nd-boot. So I extracted system.tar.gz and adb pushed all the files to it and already did a fastboot boot boot.img to the phone and it gives me a blue screen. I already formatted /system how come I keep getting running out of space. Please give us a tutorial on how to install CyanogenMod to our phone. Just adjust the updater-scripts for gapps so that it flashes it to /flex and symlink it to /flex/app and /flex/lib.
rootdefyxt320 said:
Contact @Hashcode to port 2nd-boot to our device. Upload our stock init.rc and he will find a 2nd-init hijack. Once, we have the hijack, we can boot into 2nd-boot. So I extracted system.tar.gz and adb pushed all the files to it and already did a fastboot boot boot.img to the phone and it gives me a blue screen. I already formatted /system how come I keep getting running out of space. Please give us a tutorial on how to install CyanogenMod to our phone. Just adjust the updater-scripts for gapps so that it flashes it to /flex and symlink it to /flex/app and /flex/lib.
Click to expand...
Click to collapse
Thanks for your suggestions.
There is a lot to do, and it is a hobby project, so I will do those things one at a time. But when there is progress, I will keep you informed.
Maybe your problem is you are using windows?
(In that case symlinks will be expanded to the whole file)
But there is an alternative way:
Boot into fastboot and do:
Code:
fastboot boot recovery.img
adb shell 'mount -a'
adb shell 'rm -rf /system'
adb push system.tar.gz /sdcard/
adb shell 'tar -xzvf /sdcard/system.tar.gz'
adb reboot-bootloader
fastboot boot boot.img
de-wolff said:
Thanks for your suggestions.
There is a lot to do, and it is a hobby project, so I will do those things one at a time. But when there is progress, I will keep you informed.
Maybe your problem is you are using windows?
(In that case symlinks will be expanded to the whole file)
But there is an alternative way:
Boot into fastboot and do:
Code:
fastboot boot recovery.img
adb shell 'mount -a'
adb shell 'rm -rf /system'
adb push system.tar.gz /sdcard/
adb shell 'tar -xzvf /sdcard/system.tar.gz'
adb reboot-bootloader
fastboot boot boot.img
Click to expand...
Click to collapse
Bugs are Hardware Acceleration but I'm going to try the Qualcomm ICS ARMv7 Libs, wrong DPI, no settings. I will send my logcat and dmesg later.
EDIT: When I try to run a OpenGLES2.0 benchmarks, it crashes. Basically for now it's only a bootup. I suggest you to contact @cute_prince to help you to port CyanogenMod as he has ported it to HTC Pico (Explorer). Also another suggestion is that you use the codename of the Defy Mini which is Tinboost to compile CyanogenMod.
You guys are really amazing!, it won't surprise me that all the information, tutorials and videos all around the web came from all the experiments you made here. Thanks for all the time you spend, and go on guys!
Waiting for the ICS upgrade.
@cute_prince. Would you please help us to port CyanogenMod 9 to our device? As the Defy Mini has the same chipset as the HTC Explorer. I will provide whatever you need to port CM9. Thanks.
So is there a possibility of CyanogenMod on our device?

[Q] Any way to "install" system.img?

I've been tinkering with building aosp framework and kernel from source. I've got it loaded and running on my N7. I've made some changes to an xml file, and the subsequent build resulted in only a new system.img file being generated. Is there any way to "install" the system.img file without wiping the system area first? Or is "fastboot flash system system.img" the only way to update the system area of the ROM? I don't want to have to use Recovery to install gapps and supersu again if I can avoid it.
Try mounting the .IMG file into a folder you created with
sudo(or su) mount -o loop ~/system.img /path/to/created/folder
It may mount it and you should be able to get what you want out of the file and then just replace the individual files and reboot or flash them by themselves in a .zip.
di11igaf said:
Try mounting the .IMG file into a folder you created with
sudo(or su) mount -o loop ~/system.img /path/to/created/folder
It may mount it and you should be able to get what you want out of the file and then just replace the individual files and reboot or flash them by themselves in a .zip.
Click to expand...
Click to collapse
I tried everything I could think of including specifying all different types of filesystems including iso9660 and nothing recognizes the image. I tried it on my Ubuntu 12.04 machine as well as the tablet, no success, I guess I'll just have to flash it with fastboot.
There is ways to do it. Aosp used to include the necessary tools to do it, but I haven't really cloned aosp source since gingerbread so I can t remember exactly where or if they're still there(if I do some digging I can figure it out but you may already have flashed. I'll still look into it cause it may be of use to others).
Maybe try this in the future
Here's a binary that should work, make it executable first--
http://db.tt/OZnlRJ4L
./simg2img system.img output.img
Then
mkdir systest(make this folder anything you want)
mount -o loop output.img systest(or whatever you made the folder above)
I haven't tested this but I may when I get a chance.
Way cool man, it works. I was able to mount the output IMG without issue. . :good: :good: :good:
Sent from my aosp N7 JSS15Q w/A029 TouchScreen firmware

[MOD] No forced encryption on CM12 stock kernel - once and forever

Force-Encrypt Toggler
Disclaimer: I have no experience in Android/ROM development. This is the first time i decided to share something (that i initially made for myself). Flash at your own risk. I am not responsible for boot loops, unexpectedly encrypted partitions, data loses, etc. Make sure you have a backup first!
Click to expand...
Click to collapse
Now that CyanogenMod developers stated that they are going to follow Google's guidelines about forced encryption in their ROM for Nexus 9, those of us who want their tablets unencrypted will have to flash a modified boot image every time they update CM. I hate doing such things manually every time, so i created a patch that disables forced encryption the right way - flash once and forget forever.
force-encrypt-toggler reads and unpacks your boot image, patches the ramdisk, creates a new boot image and flashes it back to the boot partition. And all that is done right on your tablet. Than it uses CM's addon.d framework, so that each time you flash a new CM zip, force-encrypt-toggler is invoked automatically to patch the newly flashed boot image. Thus, you can just upgrade through CM's built-in updater and everything will be patched automatically every time . Also, the script itself can be used on any Linux computer to patch (probably) any boot.img you have.
Thus far i have used it on my Nexus 9 to stay unencrypted starting from 20150216 through 20150224 nightlies. It seems to be quite stable, i believe . See some notes in the second post.
Download
force-encrypt-toggler-1.1-flounder.zip : https://goo.gl/bw7YDq
force-encrypt-toggler-1.1-flounder-dbg.zip : https://goo.gl/95JN34 - this one creates log files in /cache every time
force-encrypt-toggler-1.1-linux.tar.gz : https://goo.gl/3PF6ru - to be used on a desktop to patch arbitrary boot.img
old versions (for CM12): https://goo.gl/125eey
Sorry, it looks like i can not post clickable links yet. Remove space between "https" and colon.
Compatibility
I have tested this script only on my Nexus 9 Wi-Fi with TWRP recovery and CM stock boot image. However, i believe that it should be possible to make it work on other devices (e.g. Nexus 6) by just changing a few constants at the beginning.
Version 1.1 requires TWRP version >= 2.8.7.1 and a CM13 nightly >= 20160110. Version 1.0 will work for CM12.x (but not for recent CM13 nightlies).
Known issues
The addon.d script uses a dirty hack to trick the recovery. While this never happened to me, if you ever encounter a strange recovery behavior regarding installation or backup of boot images after flashing CM zip over CM with this mod, this might be it. Just reboot and it should be ok. See the second post for more info.
If CM changes something in their updater or if something changes in the recovery, this mod may easily break due to the hack mentioned above. Read the disclaimer.
Each time you flash a CM zip over a CM installation with this mod installed, TWRP recovery will hang for 5-10 seconds after reporting successful completion and before showing buttons at the bottom (or before rebooting in case of open recovery script execution). It is possible to fix this easily, but than this mod might be much easier to break.
Installation
First, you should read the disclaimer above and backup your data. Than you just have to flash the zip you downloaded with TWRP recovery. CyanogenMod must be installed first. If your /data is currently encrypted, you will have to do a full factory reset to decrypt it (backup your data first!).
Your current boot image will be patched during installation process (it should not hurt, if it's already patched). In case if something goes wrong, installation script will tell you. In any case you can get force-encrypt-toggler debug output by something like:
Code:
adb pull /tmp/fet.log
Be sure to do this before you reboot, because that file is created in the RAM.
Removal
In order to remove force-encrypt-toggler you have to delete the following files from your /system partition:
Code:
/system/xbin/mkbootimg (v1.1)
/system/xbin/unpackbootimg (v1.1)
/system/bin/force-encrypt-toggler
/system/addon.d/90-force-encrypt-toggler.sh
/system/bin/mkbootimg (v1.0)
/system/bin/unpackbootimg (v1.0)
And than restore your original boot image. You can also just format /system and flash CM again, but that is such an overkill .
Usage
Normally you will not need to run force-encrypt-toggler yourself, but in case you need, you should be able to run it both in Android and in recovery via adb shell. Just run it with --help option to see what it can do. In case you will have to debug some glitches, this command may be useful:
Code:
force-encrypt-toggler --set-not-forced --debug --dry-run --no-cleanup
If you use it on a Linux computer, this is what you will probably need:
Code:
sudo ./force-encrypt-toggler --set-not-forced [ --input path/to/boot.img --output path/to/new/boot.img ]
Note that Android and computer versions are functionally equivalent, so you can theoretically patch boot images for one Android device on another one...
Changelog
Code:
v1.1
+ use toybox instead of busybox because CM now ships only the later
+ mkbootimg and unpackbootimg are now installed to /system/xbin
+ the --help option can now be used without root privileges
v1.0 - initial release
Credits
mkbootimg is built from AOSP source
unpackbootimg is taken from this GitHub page: https://github.com/Dees-Troy/unpackbootimg
update-binary is taken from a CM zip
There is one problem with patching the new boot image from an addon.d script: CM's updater-script flashes boot image after it invokes all addon.d scripts. Therefore at a time, when the script is called, it is possible to patch only the old boot image, and than it will still be overwritten anyway. In order to overcome this, i used a very dirty hack. In short, i replace the device node with a fifo and let the updater write new boot image into it, and than... Ok, so, i think there must be a cleaner solution, so i will appreciate if a more experienced developer takes a look at my code and proposes a better solution.
As for the 5-10 second hang, it is (unexpectedly) caused by that line with "sleep 15" at the end of addon.d script. If it really annoys you, you can comment it out along with the line, where force-encrypt-toggler is called directly (not through the helper script). Updating will be a bit faster than, but if CM devs ever decide to flash boot image prior to calling addon.d scripts, you /data will be silently encrypted.
Download :: For the lazy
force-encrypt-toggler-1.0-flounder.zip : http://goo.gl/N4rZDk
force-encrypt-toggler-1.0-flounder-dbg.zip : http://goo.gl/4nXmkD - this one creates log files in /cache every time
force-encrypt-toggler-1.0-linux.tar.gz : http://goo.gl/hDFNOY - to be used on a desktop to patch arbitrary boot.img
While there was zero discussion in this thread, goo.gl tells me that there was some downloads, so someone might be actually using my small mod. If so, they might notice that it got broken around one month ago. So i decided to share a fixed version. See updated links in the description (links in the USBhost's post above are for the old version, if you wonder).
If you currently have v1.0 installed, you can just flash v1.1 over it. Note however, that if you was flashing recent nightlies while using v1.0, you /data probably have been silently re-encrypted. Also, if you current boot image is patched by v1.0, the initial patching by v1.1 during zip installation will fail, but it should work during system updates afterward. Flash stock boot image and try again if you want to be sure.
The reason for v1.0 malfunction was that around a month ago CM13 stopped shipping busybox in favor of toybox. New version is only compatible with CM nightlies >= 20160110. Also you need TWRP >= 2.8.7.1.
I never took notice to this thread before until your post in the FED thread. I am going to keep an eye on it as I have been issued lately with the FED patch saying that my device is not supported (Nexus 9 Wi-Fi). Hopefully I will have better luck with this. Thank you for sharing your.

Categories

Resources