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.
Related
I've been running CM nightlies as long as they've been available for my device (Samsung Captivate). After each flash though, I have to go in through Titanium Backup and uninstall a number of system apps (mail, exchange services, music, DSP manager, news & weather, dev tools) that I do not use for various reasons. I know the ROM runs fine without these elements, as I've been removing them for years now. Manually removing them wasn't such an issue until my phone received a TWRP recovery, which effectively gets me much closer to a "one-click" nightly update making the manual cleanup more of a burden to my lazy lifestyle.
My question is, I'd like to create a CWM flashable zip that contains only an update script that removes the system apk's that I specify. Using TWRP I'd like to be able to flash the update, the kernel, and my custom "cleanup" zip in that order. I know the path to all the subject apks, but I know little about scripting or creating CWM zips. Can anyone point me in the right direction to do so? I know my way around a bash script, but I'm not even sure if that's relevant.
Why not open the zip on you pc with, for example Winrar, and remove the apk files from system\app ?
Much easier!
airtower said:
I've been running CM nightlies as long as they've been available for my device (Samsung Captivate). After each flash though, I have to go in through Titanium Backup and uninstall a number of system apps (mail, exchange services, music, DSP manager, news & weather, dev tools) that I do not use for various reasons. I know the ROM runs fine without these elements, as I've been removing them for years now. Manually removing them wasn't such an issue until my phone received a TWRP recovery, which effectively gets me much closer to a "one-click" nightly update making the manual cleanup more of a burden to my lazy lifestyle.
My question is, I'd like to create a CWM flashable zip that contains only an update script that removes the system apk's that I specify. Using TWRP I'd like to be able to flash the update, the kernel, and my custom "cleanup" zip in that order. I know the path to all the subject apks, but I know little about scripting or creating CWM zips. Can anyone point me in the right direction to do so? I know my way around a bash script, but I'm not even sure if that's relevant.
Click to expand...
Click to collapse
Good source is here: http://forum.xda-developers.com/showthread.php?p=17684719
To remove files you'll want:
Code:
mount("ext4", "EMMC", "/dev/block/mmcblk0p22", "/system");
delete("/system/app/blah.apk");
unmount("/system");
Your mount command will probably be different, so check the CM update-script for the equivalent one
RoadXY said:
Why not open the zip on you pc with, for example Winrar, and remove the apk files from system\app ?
Much easier!
Click to expand...
Click to collapse
I rarely use my own PC in the flashing process. Grandfathered in on an unlimited data plan, and I usually flash at work and connecting my phone to my work PC is verboten. Plus it takes about as much time to just uninstall them from TiBu.
Atarii said:
Good source is here: http://forum.xda-developers.com/showthread.php?p=17684719
To remove files you'll want:
Code:
mount("ext4", "EMMC", "/dev/block/mmcblk0p22", "/system");
delete("/system/app/blah.apk");
unmount("/system");
Your mount command will probably be different, so check the CM update-script for the equivalent one
Click to expand...
Click to collapse
That's exactly what I need! Thanks a ton!!
Posted in that other thread linked here but going to ask here as well:
Quick question, for a delete command can you use a wildcard?
Like this:
delete("/system/app/SamsungHub.*");
I only ask because some roms have .apk and some are .odex (for example). Looking to make one script work for any stock rom on my phone.
Also, according to my TWRP log I'm able to mount /system but /data threw an error:
mount: failed to mount /dev/block/mmcblk0p29 at /data: Device or resource busy
Looks right in the partition area:
Symlink_Path: /data/media/0
Symlink_Mount_Point: /sdcard
Primary_Block_Device: /dev/block/mmcblk0p29
Any thoughts why?
script file
airtower said:
I rarely use my own PC in the flashing process. Grandfathered in on an unlimited data plan, and I usually flash at work and connecting my phone to my work PC is verboten. Plus it takes about as much time to just uninstall them from TiBu.
That's exactly what I need! Thanks a ton!!
Click to expand...
Click to collapse
Hello, I'm also looking for same. can you share your remove/delete apk script file. I'll make the necessary changes myself.
Thankyou
jd2050 said:
Hello, I'm also looking for same. can you share your remove/delete apk script file. I'll make the necessary changes myself.
Thankyou
Click to expand...
Click to collapse
I'm not using one anymore. This thread is nearly 5 years old.
hello there! i think this is my first post here but ive been lurking since my evo 4g days. But my question is, is there anyway to remove the full wipe that comes with some roms? sometimes ill flash a kernel that hates my rom or my phone or more likely me. Or some other error happens and i would like to just flash the same rom over top to repair and be on my way. ive been running meanrom gb and it works no problem. but i tried running mikrunny 1.13 and i tried flashing rcmix kernel on it and apparently it wasnt for gingerbread i guess. but since it had full wipe built in i lost all my stuff and had to start fresh. sorry for the drawn out post but just trying to explain what my reasonings are. thanks everyone for being awesome here!
You can always do a advance backup of your data in 4ext recovery, cwm recovery I believe also has that option
(Don't ask me for help as I couldn't care if your phone explodes, eh!
It's a command in the install script. Now where and how to remove, I'm not sure.
jump454 said:
hello there! i think this is my first post here but ive been lurking since my evo 4g days. But my question is, is there anyway to remove the full wipe that comes with some roms? sometimes ill flash a kernel that hates my rom or my phone or more likely me. Or some other error happens and i would like to just flash the same rom over top to repair and be on my way. ive been running meanrom gb and it works no problem. but i tried running mikrunny 1.13 and i tried flashing rcmix kernel on it and apparently it wasnt for gingerbread i guess. but since it had full wipe built in i lost all my stuff and had to start fresh. sorry for the drawn out post but just trying to explain what my reasonings are. thanks everyone for being awesome here!
Click to expand...
Click to collapse
Look at the updater-script in the meta-inf folder you will see something that looks like this at the top of the script
Code:
format("ext4", "EMMC", "/dev/block/mmcblk0p24");
Remove any line that references formatting a partition. I wanna say that's all you'd need to do. If that doesn't work PM me a link to the ROM and I'll play with it and get it how you want it.
Editing the updater-script file
This might be more than you are interested in trying, but maybe not if you've been lurking since Evo 4G days.
All Android ROM and kernel installation scripts ultimately perform the installation using a scripting language called Edify, but some of them also have an Aroma script included as a preprocessor. Here's a good description of the relationship between Edify and Aroma explained by the Aroma developer.
To do what you are asking requires editing the /META-INF/com/google/android/updater-script file within the zip file you are going to flash. I use WinZip and UltraEdit on my PC but there are a number of editors and archiving programs that will work. You have to use an editor that will leave the Unix/Linux end-of-line characters and Notepad++ is a free editor that can do that.
Once you have the updater-script file open, look for lines like this:
Code:
ui_print("Formatting DATA Partition...");
unmount("/data");
run_program("/sbin/erase_image", "userdata");
format("ext4", "EMMC", "/dev/block/mmcblk0p24");
and change them to this:
Code:
# ui_print("Formatting DATA Partition...");
# unmount("/data");
# run_program("/sbin/erase_image", "userdata");
# format("ext4", "EMMC", "/dev/block/mmcblk0p24");
The lines above are from the updater-script file in the MikVirgin 1.01 zip file.
That will prevent your data partition from being formatted, although flashallthetime's suggestion to do an advanced backup of the data partition before flashing and advanced restore afterwards is effectively the same as the above script change. However, you may find other things you want to change in updater-script files if you become more familiar with them.
For more help with editing scripts just do a Google search for "edify script". If it's more than you want to tackle, PM ItzCrooK2UxD and ask him to make the changes for you.
ramjet73
thanks guys for the fast reply. i dont wanna do a backup everytime because the backup alone takes up more time then flashing the rom over itself plus then youd have to reflash the backup after the fact. i will try some suggestions and see if they work.
Not a full back up, just an advance data back up which takes no time at all
(Don't ask me for help as I couldn't care if your phone explodes, eh!
advance databackup? ive never heard of that. im gonna see if i can locate it in 4ext right now!
When you go into recovery you'll see backup/restore and you'll see advance restore
Sent from my PG86100 using Tapatalk 2
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?
Can anybody point me out how to create a CWM flashable zip? i did find a lot of topics, but i've noticed that any ZIP package has to be phone specific, at least a glimpse on the updater-script showed me partition names which i am very unfamiliar with.
The simplest method gives you a zip file where all you have to do is put system.img, boot.img and recovery.img on it, and a very basic script (i think):
Code:
ui_print("Starting ...");
ui_print(" ");
ui_print("Boot Partition Writing ...");
package_extract_file("boot.img", "/dev/block/mmcblk0p8");
ui_print("System Partition Writing ... ");
package_extract_file("system.img", "/dev/block/mmcblk0p15");
ui_print("Recovery Partition Writing ... ");
package_extract_file("recovery.img", "/dev/block/mmcblk0p13");
ui_print("Pass");
ui_print("Wipe data & Cache & Dalvik and reboot system ");
however, the code above, i found it on the GT-i9001 threads, so i dont want to risk anything...especially with the partition blocks.
the point of this thread is to convert our odin packages to cwm flshable zips, though the reason behind it is trying to flash a 4.2 rom from a identical device as ours, in fact, it is the same device, for more info check this thread
i think it's already exist now
PlutoDelic said:
Can anybody point me out how to create a CWM flashable zip? i did find a lot of topics, but i've noticed that any ZIP package has to be phone specific, at least a glimpse on the updater-script showed me partition names which i am very unfamiliar with.
The simplest method gives you a zip file where all you have to do is put system.img, boot.img and recovery.img on it, and a very basic script (i think):
Code:
ui_print("Starting ...");
ui_print(" ");
ui_print("Boot Partition Writing ...");
package_extract_file("boot.img", "/dev/block/mmcblk0p8");
ui_print("System Partition Writing ... ");
package_extract_file("system.img", "/dev/block/mmcblk0p15");
ui_print("Recovery Partition Writing ... ");
package_extract_file("recovery.img", "/dev/block/mmcblk0p13");
ui_print("Pass");
ui_print("Wipe data & Cache & Dalvik and reboot system ");
however, the code above, i found it on the GT-i9001 threads, so i dont want to risk anything...especially with the partition blocks.
the point of this thread is to convert our odin packages to cwm flshable zips, though the reason behind it is trying to flash a 4.2 rom from a identical device as ours, in fact, it is the same device, for more info check this thread
Click to expand...
Click to collapse
The below can be used fro CWM. I didn't try it yet, but it was posted in tools and utilities section.
mohamed_fattoh said:
The below can be used fro CWM. I didn't try it yet, but it was posted in tools and utilities section.
Click to expand...
Click to collapse
Oh, you probably misunderstood me. I needed to know how to create a ZIP so i can flash it through CWM. I already have it, exactly what you've pasted , thnx for trying to help btw.
Check this this out. http://pan.baidu.com/s/1qWyNG8O
Might be a flashable i8558 rom. Muamk1
It semms that download links for i8558 custom roms are removed from their sites.
Got that link fromb http://m.romjd.com/Rom/Detail/35720
Another rom here. http://m.romjd.com/Rom/Detail/27609
Background information:
LG K7 MS330m1 5.1.1 reception is often poor at home for both data and voice and tends to choose the weekest towers available, data is often slow to respond even in areas with good signal strength, wi-fi signal seems weak. Leaving wi-fi often makes data turn off or go into a loop where I have to manually disallow it and then re-allow it to get it to stay on. The update.zip is for a security update and contains a radio.img file, it's assumed that it at least addresses the KRACK exploit but the facts are unknown as to if it actually offers any benefits, research has been futile on this for over two years now so I'm either searching wrong or the answers are not out there.
I have a modified system partition so flashing the OTA update is a bit more than I want to undertake. So I have a few questions regarding the radio.img file in the update.zip.
1. Is it safe to just flash radio.img or could that cause a conflict and leave me with a problem?
2. Assuming it is safe, are there possible benefits to cell and wi-fi reception to be obtained with the newer radio.img, could it make reception better? Could it make it worse?
3. Assuming 1 and 2 are a go, should I bother backing up the current radio.img?
4. If 3 is advisable, what is the procedure for backing the image up?
Thanks
Edit: I think I've been able to answer some of my questions but I could use an expert on this subject matter to verify that my solution is workable.
Actually found one post saying it is completely safe.
Now I'm wondering how hard it would be to create a flashable zip to do it. Looking at their updater-script I think if it's modified leaving only the following code it should do just that?
Code:
mount("ext4", "EMMC", "/dev/block/bootdevice/by-name/system", "/system", "max_batch_time=0,commit=1,data=ordered,barrier=1,errors=panic,nodelalloc");
ui_print("Writing radio image...");
assert(qcom.backup_radio(package_extract_file("radio.img")));
lge.hammerhead.update_gpt();
unmount("/system");
Anyone have any knowledge on this as to if that would work or not? Any formatting errors, lack of needed lines or unneeded lines here?
I assume it could also be flashed via the fastboot command but I'm not certain since in this script I see "extract", anyone know anything about that?
Thanks
This is probably closer to correct...
Code:
if get_stage("/dev/block/bootdevice/by-name/misc", "stage") == "" then
set_stage("/dev/block/bootdevice/by-name/misc", "S-1/3");
endif;
ui_print("Writing radio image...");
if get_stage("/dev/block/bootdevice/by-name/misc", "stage") == "S-1/3" then
ui_print("Step_S1/3");
assert(qcom.backup_radio(package_extract_file("radio.img")));
lge.hammerhead.update_gpt();
set_stage("/dev/block/bootdevice/by-name/misc", "S-2/3");
endif;
if get_stage("/dev/block/bootdevice/by-name/misc", "stage") == "S-2/3" then
ui_print("Step_S2/3");
assert(qcom.install_radio(package_extract_file("radio.img")));
set_stage("/dev/block/bootdevice/by-name/misc", "S-3/3");
endif;
if get_stage("/dev/block/bootdevice/by-name/misc", "stage") == "S-3/3" then
ui_print("Step_S3/3");
lge.hammerhead.recover_gpt();
endif;
ui_print("Wrote new radio image.");
Added that last line but the rest is straight from the original OTA updater-script minus a section that updated the build.prop. Of course the rest of the zip is in it's original format with all of the unneeded parts removed since my goal here is just to flash the new radio.img only the updater binary and script exist in their original proper locations and the radio.img file. Anyone here that can tell me if this will work right?
Thanks
Interesting...
First I got a zip format error, I was zipping the folder instead of the files inside. After fixing that it appeared to work as expected except the baseband version under about phone in settings hasn't changed. ???WTH???