• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Root [Virgin Mobile] Help with MK5 OTA Update Zip Modification

ASJ80

Newbie
Jul 31, 2012
47
11
Eventually I want to install CyanogenMod, but for now I decided I wanted to play around with the 4.3 OTA as a learning experience.

Anyway, I'm trying to modify the OTA update so that when I flash it, it doesn't install Knox.

My phone is rooted stock MG2 and I'm using Philz Recovery.

So far I've modified the updater-script file with these changes.
- Added this line "set_perm(0, 0, 06755, "/system/xbin/su");" after the line where xbin has its permissions set
- Removed the lines where is was patching SSuggest.apk with KLMSAgent.apk
- Removed the line where it was renaming SSuggest.apk to KLMSAgent.apk
- Added a line to delete "/system/app/SSuggest.apk"
- Removed the lines that extract aboot.mbn to /dev/block/mmcblk0p5
- Removed the lines that extract sbl2.mbn to /dev/block/mmcblk0p3
- Removed the lines that extract sbl3.mbn to /dev/block/mmcblk0p4
- Modified the lines that are deleting "recovery-from-boot.p" and "install-recovery.sh" to delete "recovery-from-boot.p.bak" and "install-recovery.sh.bak" instead since mine were renamed to that.


This is what I've done to the zip file.
- deleted aboot.mbn
- deleted sbl2.mbn
- deleted sbl3.mbn
- renamed /recovery/recovery-from-boot.p" to /recovery/recovery-from-boot.p.bak
- renamed "/recovery/etc/install-recovery.sh" to "/recovery/etc/install-recovery.sh.bak"
- deleted KLMSAgent.odex
- deleted KNOXAgent.apk and KNOXAgent.odex
- deleted KnoxAttestationAgent.apk and KnoxAttestationAgent.odex
- deleted KNOXStore.apk and KNOXStore.odex
- deleted ContainerAgent.apk and ContainerAgent.odex
- deleted ContainerEventsRelayManager.apk and ContainerEventsRelayManager.odex

My questions are:
Is it safe to let it extract "tz.mbn" to "/dev/block/mmcblk0p8"?
Is it safe to let it extract "rpm.mbn" to "/dev/block/mmcblk0p6"?
Should I worry about mmcblk0p7 being patched with "boot.img.p"?
Should I not have removed sbl2.mbn and sbl3.mbn?
Are the above files in any way part of Knox?

Is there anything else I need to do to the zip file before I can flash it from the Custom Recovery?
 
Eventually I want to install CyanogenMod, but for now I decided I wanted to play around with the 4.3 OTA as a learning experience.

Anyway, I'm trying to modify the OTA update so that when I flash it, it doesn't install Knox.

My phone is rooted stock MG2 and I'm using Philz Recovery.

So far I've modified the updater-script file with these changes.
- Added this line "set_perm(0, 0, 06755, "/system/xbin/su");" after the line where xbin has its permissions set
- Removed the lines where is was patching SSuggest.apk with KLMSAgent.apk
- Removed the line where it was renaming SSuggest.apk to KLMSAgent.apk
- Added a line to delete "/system/app/SSuggest.apk"
- Removed the lines that extract aboot.mbn to /dev/block/mmcblk0p5
- Removed the lines that extract sbl2.mbn to /dev/block/mmcblk0p3
- Removed the lines that extract sbl3.mbn to /dev/block/mmcblk0p4
- Modified the lines that are deleting "recovery-from-boot.p" and "install-recovery.sh" to delete "recovery-from-boot.p.bak" and "install-recovery.sh.bak" instead since mine were renamed to that.


This is what I've done to the zip file.
- deleted aboot.mbn
- deleted sbl2.mbn
- deleted sbl3.mbn
- renamed /recovery/recovery-from-boot.p" to /recovery/recovery-from-boot.p.bak
- renamed "/recovery/etc/install-recovery.sh" to "/recovery/etc/install-recovery.sh.bak"
- deleted KLMSAgent.odex
- deleted KNOXAgent.apk and KNOXAgent.odex
- deleted KnoxAttestationAgent.apk and KnoxAttestationAgent.odex
- deleted KNOXStore.apk and KNOXStore.odex
- deleted ContainerAgent.apk and ContainerAgent.odex
- deleted ContainerEventsRelayManager.apk and ContainerEventsRelayManager.odex

My questions are:
Is it safe to let it extract "tz.mbn" to "/dev/block/mmcblk0p8"?
Is it safe to let it extract "rpm.mbn" to "/dev/block/mmcblk0p6"?
Should I worry about mmcblk0p7 being patched with "boot.img.p"?
Should I not have removed sbl2.mbn and sbl3.mbn?
Are the above files in any way part of Knox?

Is there anything else I need to do to the zip file before I can flash it from the Custom Recovery?

You should holler at @jdsingle76 to see what he did when creating his stock/rooted/Knox-free version. He is definitely going to be the most knowledgeable forum member for this topic.
 
  • Like
Reactions: ASJ80
Upvote 0
Thanks for the reply.

After further research, I've found out that there are some more files in the zip that I didn't remove that are related to Knox.

Under /system/app/ there are:
- SPDClient.apk

Under /system/containers/framework/ there are:
- KNOXModeSwitcher.apk
- sec_container_1.zzzKnoxLauncher.apk

The .odex file for SPDClient gets created by patching and renaming SlideShow.odex in updater-script.

Anyway, I've removed the above files and references to SPDClient in updater-script.

Also, from various other reading I've done, it looks like I definitely need to keep tz.mbn is I want my wifi to work when the modem gets flashed. rpm.mbn I think is safe as well since from what I've read, it just has to do with power management.

I'm pretty confident now that deleting sbl2.mbn and sbl3.mbn was a good idea.

So I guess now the only things I'm not sure of is patching with boot.img.p and whether or not there is anything else I need to do to the ota zip to make it flashable in custom recovery.

Edit: A few more files I've removed from the zip file
- /system/tima_measurement_info
- /system/lib/libknoxdrawglfunction.so
- /system/etc/secure_storage/com.sec.knox.store/ss_id
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones