[Q] CWM recovery doesnt work - Android Q&A, Help & Troubleshooting

Hi guys I am new here and I can write into this topic: http://forum.xda-developers.com/showthread.php?t=1721680
So here is my problem...
I made a zip file following the instructions here. The only difference is I need to put files into data (but there was an answer in the topic how to make it so.. I renamed the folder system to data and changed the script)
My script looks like this
run_program("/sbin/busybox", "mount", "/data");
package_extract_dir("data", "/data");
ui_print("Enjoy!");
I put the .zip file into mnt/sdcard/clockworkmod/backup and tried to use titanium backup to run it...
But it always crashes when I click the file sample.zip
Whats wrong?Can I use other apps to start it?

LetisXXX said:
Hi guys I am new here and I can write into this topic: http://forum.xda-developers.com/showthread.php?t=1721680
So here is my problem...
I made a zip file following the instructions here. The only difference is I need to put files into data (but there was an answer in the topic how to make it so.. I renamed the folder system to data and changed the script)
My script looks like this
run_program("/sbin/busybox", "mount", "/data");
package_extract_dir("data", "/data");
ui_print("Enjoy!");
I put the .zip file into mnt/sdcard/clockworkmod/backup and tried to use titanium backup to run it...
But it always crashes when I click the file sample.zip
Whats wrong?Can I use other apps to start it?
Click to expand...
Click to collapse
what are you trying to do? Install an app?

Related

Anti-theft android system?

Hi there, guys. I don't know if I should ask this here or in the general forum, so... here I go.
I use cerberus in my nexus one since several months ago, and after watching the SassiBoB review of this program, I started to think how could I get it permanently configured into my system, just in case the thief knows how to restore the system configuration of the phone.
She says something about installing it as a system app with... ¿Rom manager?
I can't understand it perfectly, english isn't my mother tongue.
Anyway, I used titanium backup and I was able to get it installed as a system app (I could also add it to the rom zip, but... I know, I'm such a lazy ), so this step is done. Next problem: the configuration. When you do the factory reset, the configuration of the cerberus app is deleted, so it doesn't matter if it's installed or not. It won't work.
Is there any way to keep the configuration in the system, even if you do a system reset?
I know there are several other problems, like the root apps to flash the phone, or even the recovery menu, but I would like to solve all the problems step by step, and I think this is the first one.
Thank you, guys.
Pretty sure this belongs in the question section.
I don't have it cerb but, my friend told me you go to there website https://www.cerberusapp.com/ and there's a flashable zip you download and install with Rom manger.
Yes, you are right. In the cerberus web page there is a zip file which contains the cerberus app, so you can flash it as a rom, and it keeps it installed as a system app, but unfortunately there isn't any difference with the other methods. It keeps the app after a factory reset, but the configuration is deleted, so it's like the app isn't installed. I have already sent an email to them asking if there is a way to keep the configuration, but I haven't received any answer yet (and it's new year, it's weekend...).
OK, step done. They will release another version (2.0) that keeps a copy of the configuration in /etc/system, so if we add the apk and this file to the ROM, it will be safe.
Next step: the app is installed and configured BUT it has to be added to the list of devices administration in the security and privacy option (it has to manage the device). To add it, you must open the app and set the "activate" option, so we have the same problem that we had, so now it's not an app problem, but a ROM problem.
Is there any way to change the apps aded to the devices administrator option? I supose it should be, as the configuration has to be stored somewhere...
A little step more. I think I found the file where the administration params are stored. It's in /data/system/device_policies.xml
New problem: this file is in the installed system, but I can't find it in the ROM.
¿Any idea? Thanks
Another hint: I found this:
http://hi-android.info/src/com/android/server/DevicePolicyManagerService.java.html
It seems this is the class who creates the file. It should be easy to modify it so it adds the required data to the file. New problem: I can't find this class in the ROM file. I'll keep searching...
FOUND!
It's in services.jar, inside the framework directory.
It's necessary to extract the classes.dex, convert it into .jar, extract the DevicePolicyManagerService class and decompile it as java code, and here it is:
Code:
private static JournaledFile makeJournaledFile()
{
File localFile1 = new File("/data/system/device_policies.xml");
File localFile2 = new File("/data/system/device_policies.xml.tmp");
return new JournaledFile(localFile1, localFile2);
}
I think I should be able to modify it. I can't right now, but I'll post it when I try it.
I was trying to change that java file, but it's a real pain in the ass to recompile it and avoid all the errors. Then I realized that I can just modify the update script to copy the file (yes, I'm such an idiot lol).
I was trying to get it done with the update-script in META-INF/com/google/andriod/updater-script, but I can't get it working. A little help would be appreciated
Another update (Were you missing me?). I decided to modify the flasheable zip of the cerberus, so it has all the configuration files. I added the data/system/device_policies.xml and also de etc/cerberus_conf.xml files to this zip. Then, I changed the updater:
Code:
show_progress(1.000000, 0);
ui_print("Mounting /system");
run_program("/sbin/busybox", "mount", "/system");
set_progress(0.125000);
ui_print("Mounting /data");
run_program("/sbin/busybox", "mount", "/data");
set_progress(0.250000);
ui_print("Deleting old APK from /system");
delete("/system/app/Cerberus.apk");
set_progress(0.375000);
ui_print("Deleting old APK from /data");
delete("/data/app/com.lsdroid.cerberus.apk");
delete("/data/app/com.lsdroid.cerberus-1.apk");
delete("/data/app/com.lsdroid.cerberus-2.apk");
set_progress(0.500000);
ui_print("Extracting files to /system");
package_extract_dir("system", "/system");
set_progress(0.625000);
--------------ADDED-------------------
ui_print("Extracting files to /data");
package_extract_dir("data", "/data");
set_progress(0.680000);
---------------------------------------
ui_print("Unmounting /data");
unmount("/data");
set_progress(0.750000);
ui_print("Unmounting /system");
unmount("/system");
set_progress(0.875000);
ui_print("Installation complete!");
set_progress(1.000000);
It's a standalone zip file, so you need to flash your ROM and flash this zip file after it. Anyway,
WARNING
This doesn't work. After flashing the second zip file, the ROM won't boot (It keeps booting, with the boot animation in loop). I suppose I break the data directory or something like that. I'll keep trying.
Yep, I tried several things and the problem is with this line:
package_extract_dir("data", "/data");
It seems it breaks the data directory or something like that. The other files are copied perfectly.
OK, problem found with adb. With this command, it deletes completely the /data/system directory, so it keeps only the new file. Time to fix it...
EDIT: my fault. /data/system is empty until we start the system for first time. We must flash the rom, boot it, restart and flash the patch with cerberus. This is starting to be kinda stupid... If we do this, we can select cerberus in the administrators menu, instead of flashing anything...
Last post for the moment with partial conclussions.
When we do a factory reset, it deletes ALL the content of the data directory. So it's impossible to solve this problem just flashing anything after the ROM. Is the ROM who HAS TO COPY the device_priorities.xml into /data/system/. There isn't any other way, it would be erased after a factory reset.
Now, time to find out how to get it done by the ROM. I'll let you know as soon as I get it.
Work!
I did a full wipe (Wipe Data / Factory Reset + Wipe Cache Partition Wipe Dalvik Cache) and installed the official samsung rom (Android 4.1.2). I installed the flashable ZIP from the site on my galaxy s2 and did not have to reconfigure anything. Everything worked as it should. I believe that the application connects to the user's account based on the information of the device recorded previously.
Avast anti-theft has a Function to protect the configuration after a wipe. Just discover how avast achieves this.
(Translated via google translator)
That's the one thing is that even Avast and Cerberus won't escape if /system is formatted, but Avast did make it through a full SBF followed by factory reset on my phone.

[Q] Automatic installation of Apps LWW

I want to modify a ROM for my personal use, I want to put all my apps in the ROM zip and it will automatically be installed on my sd card after I flashed it. Is that's possible how will I do that?
Thanks
zcedar said:
I want to modify a ROM for my personal use, I want to put all my apps in the ROM zip and it will automatically be installed on my sd card after I flashed it. Is that's possible how will I do that?
Thanks
Click to expand...
Click to collapse
Use this app to create the flashable zip of your apps
Read the instructions in forum carefully . you need to have java 6+ up and running on your PC.
OR
just put all the apk files u want inside system/app in your ROm.zip file. Open system/app on your winrar and drag all apks into it
MoonBlade said:
Use this app to create the flashable zip of your apps
Read the instructions in forum carefully . you need to have java 6+ up and running on your PC.
OR
just put all the apk files u want inside system/app in your ROm.zip file. Open system/app on your winrar and drag all apks into it
Click to expand...
Click to collapse
I want it on my SD card not in system/app....
what if i put a folder data/app where will it go i flash the rom?
zcedar said:
I want it on my SD card not in system/app....
what if i put a folder data/app where will it go i flash the rom?
Click to expand...
Click to collapse
u said u wanted to include the apks inside the ROM before flashing it Right???
zcedar said:
what if i put a folder data/app where will it go i flash the rom?
Click to expand...
Click to collapse
It will go to internal memory, you need to move them to sd card manually after flashing, and you will need to add this to updater script before flashing:
Code:
run_program("/sbin/busybox", "mount", "/data");
package_extract_dir("data", "/data");
run_program("/sbin/busybox", "umount", "/data");
coz without it, your added apps will not be copied
PS: be aware of adding too much apps to system/app, then the rom couldn't fit the /system partition and you will not be able to boot it up!
MoonBlade said:
u said u wanted to include the apks inside the ROM before flashing it Right???
Click to expand...
Click to collapse
Yes, but while the flashing it will be installed in my sd card
pcpepik said:
It will go to internal memory, you need to move them to sd card manually after flashing, and you will need to add this to updater script before flashing:
Code:
run_program("/sbin/busybox", "mount", "/data");
package_extract_dir("data", "/data");
run_program("/sbin/busybox", "umount", "/data");
coz without it, your added apps will not be copied
PS: be aware of adding too much apps to system/app, then the rom couldn't fit the /system partition and you will not be able to boot it up!
Click to expand...
Click to collapse
where should i put this code?
In the zip go to
Code:
META-INF > com > google > android
here you will find the updater-script file, which you need to edit

[GUIDE] dsixda's Android Kitchen now on P760!!

Hi all guys, finally i've found the way to use this very nice tool on our device!!
I've tested it on my P760 with v20b stock ROM and with some little addon it runs fine
First of all i want to clarify that this guide uses a tool made for the xda comunity by dsixda, so the major credit goes to him.
Dont ask me if it works on other variants, i have the P760 only, so try by yourself and let us know.
What you need:
dsixda's Android Kitchen
dsixda Android Kitchen P760 addon
KDZ file or CWM backup of your stock ROM
...a bit of knowledge on what you are doing
_______
Download and install dsixda Android Kitchen from original thread
Download dsixda_Android_Kitchen_P760_addon and extract the contents somewhere to your pc.
You can see two folder "dsixda_edify_defs" and "brocken_sys_files", copy dsixda_edify_defs content to "\Cygwin\home\YourUserName\Kitchen\tools\edify_defs" folder.
Now we need system and boot from our rom. If you have a CWM backup just copy system.ext4.tar.a and boot.img to "original_update" folder of dsixda kitchen and rename "system.ext4.tar.a" to "system.ext4.tar"
If you want to use KDZ stock ROM please refer to this guide provided by kuma82 on how to extract system.img and boot.img
Now run dsixda Android Kitchen and setup your working folder (detailed info on hawto in the original thread).
When setup completed than copy the "brocken_sys_files" contents located in dsixda_Android_Kitchen_P760_addon.zip to the locations specified in the included readme file. I dont know why but dsixda kitchen doesnt process these files correctly so we have to add them manually. They are taken from V20b but should work on other version too.
Ok,now we are ready to apply our mods and cook!!
I've cooked my own ROM from KDZ file and tested some feature, root, deodex, zipalign, init.d, /data/app, all works fine. I've found only one issue releted to deodexing LG keyboard, just replace it with another one and all should be fine.
NOT tested with CM rom.
I'm NOT responsable of any kind of demage caused by using this method, so use it at your own risk.
@moderators
I dont know if this is the right section where to post this guide, if no than feel free to move it to the right one.
Credits:
dsixda (for Android kitchen)
kuma82 and cmahendra (for KDZ extraction)
___
Thanks for sharing the info, Android kitchen was already working but I had to change the updater-script and update-binary manually.
Lol, I didn't think about changing the CWM backup system .tar.a file to .tar I just used the dd command to extract (my current) system.img to my sdcard
Code:
dd if=/dev/block/mmcblk0p10 of=/sdcard/system.img
Note: my internal and external or swapped, so change accordingly
Another thing, thanks for giving me credit for my guide
@- shifu - thanks man! you have two pm!
@kuma82 how you change it?
format("MTD", "system");
mount("MTD", "system", "/system");
package_extract_dir("system", "/system");
....
assert(package_extract_file("boot.img", "/tmp/boot.img"),
write_raw_image("/tmp/boot.img", "boot"),
delete("/tmp/boot.img"));
Click to expand...
Click to collapse
with:
format("ext4", "EMMC", "/dev/block/platform/omap/omap_hsmmc.1/by-name/system", "0", "/system");
mount("ext4", "EMMC", "/dev/block/platform/omap/omap_hsmmc.1/by-name/system", "/system");
...
package_extract_file("boot.img", "/dev/block/platform/omap/omap_hsmmc.1/by-name/boot");
Yup, to tell you the truth I haven't tried it yet, been to busy, to actually flash it, but if I'm not mistaken @Kid_Ding used it (android kitchen) to port pac rom to the P769
Sent from my LGMS769 using xda app-developers app
kuma82 said:
Thanks for sharing the info, Android kitchen was already working but I had to change the updater-script and update-binary manually.
Click to expand...
Click to collapse
for me it never worked, even changing updater-script.. but i've tried with stock ROM only, maybe with CM just made the changhes you've mentioned.
Anyway with my addon it works out of the box, no need to modify updater-script
Lol, I didn't think about changing the CWM backup system .tar.a file to .tar I just used the dd command to extract (my current) system.img to my sdcard
Code:
dd if=/dev/block/mmcblk0p10 of=/sdcard/system.img
Note: my internal and external or swapped, so change accordingly
Click to expand...
Click to collapse
yep, i've tried and it worked
Another thing, thanks for giving me credit for my guide
Click to expand...
Click to collapse
of nothing colleague
Very Useful.
Very useful Thread. Saved lot of time. Thanks

[Q] flashable zip

Hello there , im trying to make a flashable zip to puch an apk on the system , or replace systemui.apk but it always give me this error
"Finding update package...
Opening update package...
Installing update...
Installation aborted."
i tried a lot of ways like this : http://forum.xda-developers.com/showthread.php?t=2163974 but still the same error
btw my cwm version is 5.0.2.8​
mohabmoka said:
Hello there , im trying to make a flashable zip to puch an apk on the system , or replace systemui.apk but it always give me this error
"Finding update package...
Opening update package...
Installing update...
Installation aborted."
i tried a lot of ways like this : http://forum.xda-developers.com/showthread.php?t=2163974 but still the same error
btw my cwm version is 5.0.2.8​
Click to expand...
Click to collapse
Can you upload that flashable zip? I will check it for errors, I will try to solve errors and give it back to you.
Sent from my GT-I9001 Gadget of Mass Destruction with CM11 using XDA Developers App.
hnkotnis said:
Can you upload that flashable zip? I will check it for errors, I will try to solve errors and give it back to you.
Sent from my GT-I9001 Gadget of Mass Destruction with CM11 using XDA Developers App.
Click to expand...
Click to collapse
oky no problem sure here you are , p.s : i tried to replace META-INF with other that worked ob my mobile before
from the attached zip i want to push this apk to system ik that there is alot of ways but i want to make this way is that possible? and also 3 days ago i wanted to replace my systemui.apk with edited and signed one by me , thanks man for help !!
If you get a chance read through this a bit
http://forum.xda-developers.com/showthread.php?t=2290009
It may help understand the structure and how to use edify. I'm on mobile right now so it may be a bit tough to look at your current .zip but if you don't have an answer by the time I get to a PC I'll have a look
But I will say off hand what youre trying to do will be fairly easy.
Grab a ROM that works for your phone
Extract the contents of the zip
Get rid of everything but the META-INF folder
Go to the updater-script
Erase all and write your own (if on windows use notepad++)
What you will need to do is mount system, then say where to take the app from and where to put it
Then have it fix permissions
The unmount system
Now zip it up with your app
Sign
And your good
Sent from my Nexus 4 using XDA Premium 4 mobile app
demkantor said:
If you get a chance read through this a bit
http://forum.xda-developers.com/showthread.php?t=2290009
It may help understand the structure and how to use edify. I'm on mobile right now so it may be a bit tough to look at your current .zip but if you don't have an answer by the time I get to a PC I'll have a look
But I will say off hand what youre trying to do will be fairly easy.
Grab a ROM that works for your phone
Extract the contents of the zip
Get rid of everything but the META-INF folder
Go to the updater-script
Erase all and write your own (if on windows use notepad++)
What you will need to do is mount system, then say where to take the app from and where to put it
Then have it fix permissions
The unmount system
Now zip it up with your app
Sign
And your good
Sent from my Nexus 4 using XDA Premium 4 mobile app
Click to expand...
Click to collapse
well !! frist of all thanks for you help ! and i will try again and tell you , thanks again
mohabmoka said:
well !! frist of all thanks for you help ! and i will try again and tell you , thanks again
Click to expand...
Click to collapse
See HERE.
so just had a look at you .zip
youre missing your updater script and update-binary
so again, take this from a recent rom from your device and put them in META-INF
so file structure
META-INF/com/google/android and here put those two files
and your updater script should be simple, something like
Code:
ui_print("mounting system");
run_program("/sbin/busybox", "mount", "/system");
package_extract_dir("fbutton/system", "/system");
ui_print("setting permissions");
set_perm_recursive(0, 0, 0755, 0644, "/system/app");
ui_print("unmounting system");
run_program("/sbin/busybox", "umount", "/system");
but feel free to edit in whatever or define the actual system partition, your choice
best of luck!
demkantor said:
so just had a look at you .zip
youre missing your updater script and update-binary
so again, take this from a recent rom from your device and put them in META-INF
so file structure
META-INF/com/google/android and here put those two files
and your updater script should be simple, something like
Code:
ui_print("mounting system");
run_program("/sbin/busybox", "mount", "/system");
package_extract_dir("fbutton/system", "/system");
ui_print("setting permissions");
set_perm_recursive(0, 0, 0755, 0644, "/system/app");
ui_print("unmounting system");
run_program("/sbin/busybox", "umount", "/system");
but feel free to edit in whatever or define the actual system partition, your choice
best of luck!
Click to expand...
Click to collapse
well but i aslo used the meta-inf file which is in my root file (attached ) and root file worked well , i uploaded the root file and the file after edit with meta-inf from root file can you check it out?
XperienceD said:
See HERE.
Click to expand...
Click to collapse
oky thanks i will check it out and reply :] thanks for you help ^_^
XperienceD said:
See HERE.
Click to expand...
Click to collapse
demkantor said:
so just had a look at you .zip
youre missing your updater script and update-binary
so again, take this from a recent rom from your device and put them in META-INF
so file structure
META-INF/com/google/android and here put those two files
and your updater script should be simple, something like
Code:
ui_print("mounting system");
run_program("/sbin/busybox", "mount", "/system");
package_extract_dir("fbutton/system", "/system");
ui_print("setting permissions");
set_perm_recursive(0, 0, 0755, 0644, "/system/app");
ui_print("unmounting system");
run_program("/sbin/busybox", "umount", "/system");
but feel free to edit in whatever or define the actual system partition, your choice
best of luck!
Click to expand...
Click to collapse
well , i edited the updater-script and still the same problem :s i attach the final zip and can anyone of you check it out for me :] , also when i enter cwm i selcet install zip for sd card is that right? or i should do anything else ?
mohabmoka said:
well , i edited the updater-script and still the same problem :s i attach the final zip and can anyone of you check it out for me :] , also when i enter cwm i selcet install zip for sd card is that right? or i should do anything else ?
Click to expand...
Click to collapse
you have an extra folder, META-INF ans system folders should not be inside lite
if you open your zip youll see what i mean
so rezip these two folders, sign then flash through recovery
also you may need to add a chmod for permissions in your updater-script - either just for new app or all of system, either way will work
demkantor said:
you have an extra folder, META-INF ans system folders should not be inside lite
if you open your zip youll see what i mean
so rezip these two folders, sign then flash through recovery
also you may need to add a chmod for permissions in your updater-script - either just for new app or all of system, either way will work
Click to expand...
Click to collapse
Yuup finally ! its worked welll !!! thanks alot man :]
well it said success but when i opened my mobile again i found nothing !
Did you add the set_permissions to the updater-script? If not it won't show up
Sent from my Nexus 4 using XDA Premium 4 mobile app
demkantor said:
Did you add the set_permissions to the updater-script? If not it won't show up
Sent from my Nexus 4 using XDA Premium 4 mobile app
Click to expand...
Click to collapse
this is my updater-script , is that right ?
Depending on your file structure it looks good enough to me, what happens when you flash it now?
Sent from my Nexus 4 using XDA Premium 4 mobile app
demkantor said:
Depending on your file structure it looks good enough to me, what happens when you flash it now?
Sent from my Nexus 4 using XDA Premium 4 mobile app
Click to expand...
Click to collapse
it says install form sd card complete but i found nothing ..
Can you upload the whole zip again and I'll see
Sent from my Nexus 4 using XDA Premium 4 mobile app
demkantor said:
Can you upload the whole zip again and I'll see
Sent from my Nexus 4 using XDA Premium 4 mobile app
Click to expand...
Click to collapse
here you are
mohabmoka said:
here you are
Click to expand...
Click to collapse
just took a look at it, you have it searching for flite/system which does not exist so change this
package_extract_dir("flite/system", "/system");
to
package_extract_dir("system", "/system");
in your updater-script
at this point all should work fine, if not let me know!

Chainfire unisntall help

Hello,
I've got problem with cf3d. Im stuck at bootloop. I know all i have to do is use adb and run *uninstall.sh
Problem is with my phone.. I cant use usb (its just not working).
I tried to use updater script cuz i can move sdcard to another device and create update.zip
Code:
run_program("/sbin/mount", "/dev/block/mmcblk0p2", "/system");
run_program("/system/lib/cf3d_uninstall.sh");
run_program("/sbin/unmount", "/dev/block/mmcblk0p2", "/system");
So i run it from here.. But all tuts i saw there was needed " su " soooo do i need it here? How to do it. Help me pls.:angel:
(Sry for bad english ofc..but who cares)

Categories

Resources