[Q] ADB sideload how to install/update a specific file in a specific directory - Android Q&A, Help & Troubleshooting

Hello guys,
so i have messed up my ZenFone 5's booting configuration. good thing is, i know where i have messed up, unlike other noobs like myself. i have been modifying the adbon.sh file, where i added a conditional to check if a file(/dev/keycheck) exists and if it exists(will always return 'true'), to extract the contents of a recovery.tar(custom recovery). problem is, now i cannot boot normally into my device. if anyone can help me with three things, i'd be grateful.
1. How to modify the adbon.sh file using:
(a) preferred choice: using adb sideload <filename> ( i need to update THAT SPECIFIC FILE ONLY) ->(the file is in /system/bin/)
(b) secondary choice: using fastboot flash command. is it possible to update a single file using fastboot flash? (probably not, i think) should i have to flash the entire system partition with a stock/custom ROM? (i already know most about this, but a clear good guide can help me)(i know it will overwrite the total /system partition)
2. Give me a link to the original(stock) adbon.sh file if method 1(a) is possible.
3. Give me a compatible link to a CWM recovery for my device, ASUS_T00J (the recovery in my recovery.tar is a stock recovery, i got f**** fooled into downloading a stock one where i thought it was a custom CWM recovery)

Related

[Q] MTK6573 custom recovery and backups / Stock Boot, Recovery + Scatter included

Phone is a Star X19i
Now I'm looking at getting a system to allow me to back up the rom and re-flash if needed.
Post 4 has attachments of my boot, recovery and scatter files.
Old issue: (Solved)
Stupid thing I did I renamed the mtklockscreen.odex to mtklockscreen.odex1 just as a test in a half asleep phase to see if I would get the stock lockscreen loading.
Suffice to say the phone no longer boots.
Really don't think I can get into ADB and rename the file to get the phone booting again unless anyone knows a way.
Android was 2.3.6 and I asked the seller if it was possible to get the rom incase anything like happened which they didn't.
So anyone have any ideas?
I have attached the stock recovery and boot images made with cat and a scatter file I made to post 4.
As I have no idea about modifying these for hard root can anyone take a look?
I don't know the specifics of the phone, but if you can go into recovery mode maybe you can get adb working, or use a flashable zip to rename the file by installing it from recovery (just need to edit the zips' updater script)
dxppxd said:
I don't know the specifics of the phone, but if you can go into recovery mode maybe you can get adb working, or use a flashable zip to rename the file by installing it from recovery (just need to edit the zips' updater script)
Click to expand...
Click to collapse
I got into built in Factory mode and can see the file I renamed through ADB and android commander but cannot rename it back due to not having hard root access.
I also have a copy of the boot and recovery partitions 5 and 6 respectively I made in the adb shell yesterday as I was half looking at getting hard root access.
ren mtklockscreen.odex1 mtklockscreen.odex
ren: permission denied
I read you can do a custom recovery with root using SP Tools still so can anyone help me do this?
I know about system root etc and stuff and have flashed roms before on other tablets and have been a PC I.T tech (wouldn't think it due to the stupid mistake) but this recovery and scatter files etc is kinda new to me.
I have a scatter file now I just made if anyone is interested in helping me.
Yes I have a MTK6573 but the scatter file came from the MT6516 Rom Studio which I read works the same for the 6573.
Attached is also my stock boot and recovery partitions I made with cat yesterday if there usable to anyone to help.
Well I got it working and fixed.
I had to go into adb shell and su and mount the file system as writable, as I have used linux before I didn't know about android and what needed to be done and permission locks etc.
The stock boot, recovery and scatter files will remain on this thread if anyone wants to help create or find a recovery which can allow me to create backups and flash custom roms.
I may be able to provide a dump of android 2.3.6 for those that want it once I'm provided with a backup solution as I have read a few people wanting this updated android rom.
This got too close to what I would like liked with bricking this phone.
And I'm not comfortable unless I have a rom backup of this.
Rooting Advice: For anyone with a MTK6573 on Android 2.3.6 trying to root but having issues with super one click make sure you only turn on USB debugging after Android has loaded and just before you plug the usb cable in to run super one click.
I have seen a few thread and posters here about not being able to root the phone and this is the cause that debug needs to be switched on right before you connect and try to root.
Original seller has agreed to send the firmware and flashing stuff on cd for me so I can upload it for you all.
This is a win for MTK6573 Star X19i owners as I'll have the updated 2.3.6 Gingerbread firmware to release for you all root modify etc in a week or so.
Be careful with ROM studio. I believe it is not compatible with MT6573.
You want to read this: http://bm-smartphone-reviews.blogspot.com/2012_04_01_archive.html
cybermaus said:
Be careful with ROM studio. I believe it is not compatible with MT6573.
You want to read this: http://bm-smartphone-reviews.blogspot.com/2012_04_01_archive.html
Click to expand...
Click to collapse
That's what I read and did to get my scatter as I used cat then used the program linked in that thread to generate the scatter.

[Q] Some questions about Android Recovery Mode

Recently I was studying android recovery mode, and I have some questions. Anyone knows the answer? Thanks very much.
1. Can recovery flash bootloader?
From this link====>http://forum.xda-developers.com/showthread.php?t=2321310, I think it can do that. But I'm not sure.
2. Can recovery flash recovery partition itself?
I think it can not do this. Not confirm that.
3. We know in update.zip, boot.img is corresponding boot partition, but why system is a folder, not system.img? There is a system partition also.
4. While OTA upgrade system, why the update package downloaded under /cache path? Can we change it to sdcard?
5. Most important, what exactly update-script do things under recovery mode? How the command executed?
BTW, there are other questions, but not related to Recovery Mode.
1. How can I see the flash partitions? I know to use the command cat /proc/mtd, but as Samsung, it use emmc flash, while I type that command, no results printed. How to see?
2. About userdata partition, we know that when first run android OS, system will copy files from /system to /data, but does it do it every time that we turn on the phone or just do it once after the first booting after we update our system?
Hello,
I can answer some questions, and I hope someone else can fill the blanks.
1. Can recovery flash bootloader?
=> Yes, you have to modify your boot image, but it still possible, just include the modified boot image in the update file, and give good command in update.zip
2. Can recovery flash recovery partition itself?
=> I am not sure, but I think its possible, I saw code of recovery in Android code, so if you modify it, and include the good image in update.zip, I think you will see the modification. Never tried for now.
3. We know in update.zip, boot.img is corresponding boot partition, but why system is a folder, not system.img? There is a system partition also.
=> In fact is depend witch compilation system you use. For Cyanogen, yes in fact its a folder, but for AOSP its System.img
The difference comes from the command file in update, theire not the same. But finally the result in the same. We have a system partition.
4. While OTA upgrade system, why the update package downloaded under /cache path? Can we change it to sdcard?
=> Reasons I can see :
--> In past, sdcard was not mounted by default in recovery mode, so can't see the update.zip file
--> sdcard can be removed at any time, its dangerous, when do the update to loose the file
--> To be sure have right to remove the update.zip when installation done
--> Old phone didn't have all a sdcard, cache is sure to exists
=>Yes we can change it, but we have to be sure the sdcard is mounted on recovery mode. And be sure of the path of sdcard on recovery mode. For exemple in Nexus one it is /sdcard, in Samsung Galaxy S2 is /emmc/, in Samsung S4 mini its /sdcard/0/ ... So it could be a reason why its not in sdcard, because the path is not generic.
5. Most important, what exactly update-script do things under recovery mode? How the command executed?
=>It does lot of stufs, like mount partitions, copy system files, ...
The update-script is in elf script. Generally, an elf interpreter is given just next to the update-script.
I hope it helped you,
JHelp
1 yes, but flashing firmware from recovery can be dangerous and all though unlikely I have seen many brick there phone doing so
2. Yes, rather easily so long as the .zip is put together properly. But like bootloader, it is safest so flash through fastboot or download mode but a very unlikely brick so mostly safe
3. This is how a ROM gets built from source but it needs not be in this setup. At the same note I can't see a better way to flash through recovery than like it is. Using flash_raw_image would work but due to size a system.img shouldn't be flashed in recovery rather through fastboot, bootloader or download mode
4 mostly because you couldn't have an oem ota update without an SD card which isn't a prerequisite for using a phone. Also I believe there is some added safety flashing directly from nand, but in truth this is all speculation. Yes with a rooted phone this could be changed but most often it isn't wise to flash an oem ota on a rooted device
5 lots of things, take a look at my threads for a guide I made explaining this
1 cat /proc/partitions
mount
ls -l /dev/block/
And then keep searching until you get /by-name which many phones have, but this isn't always the same path so if you need further help ask and I'll walk you through it
2 I think this depends on a lot of things, but I don't have a good answer so rather than speculating I'll choose not to answer
Feel free to ask other questions
Sent from my Nexus 4 using XDA Premium 4 mobile app
demkantor said:
1 yes, but flashing firmware from recovery can be dangerous and all though unlikely I have seen many brick there phone doing so
2. Yes, rather easily so long as the .zip is put together properly. But like bootloader, it is safest so flash through fastboot or download mode but a very unlikely brick so mostly safe
3. This is how a ROM gets built from source but it needs not be in this setup. At the same note I can't see a better way to flash through recovery than like it is. Using flash_raw_image would work but due to size a system.img shouldn't be flashed in recovery rather through fastboot, bootloader or download mode
4 mostly because you couldn't have an oem ota update without an SD card which isn't a prerequisite for using a phone. Also I believe there is some added safety flashing directly from nand, but in truth this is all speculation. Yes with a rooted phone this could be changed but most often it isn't wise to flash an oem ota on a rooted device
5 lots of things, take a look at my threads for a guide I made explaining this
1 cat /proc/partitions
mount
ls -l /dev/block/
And then keep searching until you get /by-name which many phones have, but this isn't always the same path so if you need further help ask and I'll walk you through it
2 I think this depends on a lot of things, but I don't have a good answer so rather than speculating I'll choose not to answer
Feel free to ask other questions
Sent from my Nexus 4 using XDA Premium 4 mobile app
Click to expand...
Click to collapse
I've got /by-num, but no /by-name, device is Sansumg GT-9288
not sure what a Sansumg GT-9288 is, gsmarena and google dont give me results
what happens with
cat /proc/partitions
or just
mount
?
demkantor said:
not sure what a Sansumg GT-9288 is, gsmarena and google dont give me results
what happens with
cat /proc/partitions
or just
mount
?
Click to expand...
Click to collapse
Sorry, type wrong, should be GT-9228, it's a customer made smartphone only for CMCC.
I can get the partition info by GT-9220, so I think it's because of the customer made that I can not get the by-name folder.
Thanks again.

[Q] Cube U27GT - Help with Rooting a Stock Rom and can we get a forum?

Dear Admins,
Could we get a forum setup for the Cube U27GT WiFi version? I dug around on the site a bit beforehand but didn't see one, I apologize if I missed it and please direct me there if I did.
I have this tablet and I am doing some initial basic firmware development for it and want a proper place to start putting threads.
Dear Dev Community,
I can't root this bloody thing... At least, not the rom itself. Let me explain...
I can flash the stock rom from Cube and that can be rooted using Kango Root. --Fine...
However, I can't figure out how to replicate this when I make my own rom.
Thus far, here is what I have attempted...
1. Setup dsixda's excellent kitchen on my Ubuntu workstation.
2. Unpack the rom, clean things up, manually put the boot image into the dsixda unpacked working rom folder, run dsixda's root functionality (which add SU binary to xbin and SuperSu apk file to app folder as well as do some things with the boot image file).
3. Rather than using repack with Dsixda (which makes an update.zip image which I can't use because the stock recovery environment on this device can't flash zip update files and I can't for the life of me figure out how to get and or make a working CWM or TWRP recovery image for this unit)...
4. What I do is I run commands in linux to unpack the stock rom to another directory and mount that directory, then clear out a bunch of folders and then manually copy in my files from dsixda's working folder, then repackage up my unpacked stock rom into a new system.img file.
5. Then copy my now modified boot image, system image, and also userdata image (I modify that as well as that is where most all of the chinese bloatware is loaded from) to my SP_Flash_Tool, generate new checksum.ini file and flash normally...
What I get as a result...
1. As long as I am really careful with how I copy files into my new image, the new system flashes okay (if I am not careful, after flash USB storage for some reason has a format error and the system will boot but can't mount USB storage and other odd issues ensue as a result).
2. Assuming everything flashes okay, and no issue with USB storage partition, I have SuperSU installed and when I go to use an app (ES File Explorer or Root Checker) that require's root, I do get the prompt. However none of the root functions actually work and Root Checker tells me I am not rooted.
That is as far as I have got. So as a result, I have a really nice, westernized, cleaned up rom but with no root.
Anyone have any ideas?
This is my first adventure into mod'ing MTK roms so I am sure I am doing all kinds of things wrong . I had a good bit of experience on Rockchip SoC's before this though.
Kind regards and thanks in advance!
Roman
Figured it out!
So I finally did the following rather hackish work-around...
1. Flash stock firmware...
2. Root with Kingo Root
3. Enabled ADB
4. Attach to PC and fire up MTK Droid Tools
5. Take a full backup
6. Modify the system image from the backup and make changes
7. Put that in new firmware flash package
8. Flash new firmware
YAY - Cleaned up rom, modified, with root!
Once I get it all packaged up and uploaded to mtkfirmware.com I will post a link for anyone that wants a cleaned up rom with root!
The only downfall of the above method is that it absolutely requires that the developer have a device on hand because you can't just root the stock image file (at least, I couldn't figure out how... - bleh...
Kind Regards,
Roman
Dear roman,
Thanks for your hard work.
I have a simple question (I think) and if you have the time to reply or -any other android guru- I would be thankful.
My later issue was with a U27GT cube tablet, but I have others, one for each kid, and this is more of general question.
I am reading this and other forums about how to flash tablets from PC. My question is:
Can the flashing process be done from a SD card?
Thanks a lot and regards,
Fernando
SKorea

Flash boot.img using TWRP openrecoveryscript

Hey,
is there a simple way to flash a new kernel / boot.img using TWRP by script / openrecoveryscript? I can select "Install Image" in the UI and flash the boot.img just fine, but I want to script that so I can flash devices easily or even remotely just by uploading the openrecoveryscript and the image to flash.
The documentation at https://twrp.me/faq/openrecoveryscript.html is pretty useless, it doesn't even mention that '/cache/recovery/openrecoveryscript' will be executed by TWRP.
The install command expects a zip file, the restore command a TWRP backup.
Any ideas? Thx
TWRP's OpenRecoveryScript ( read: command line ) support is great.
It's source code here:
Team-Win-Recovery-Project/openrecoveryscript.cpp at android-5.0 ยท TeamWin/Team-Win-Recovery-Project
Core recovery files for the Team Win Recovery Project (T.W.R.P) - this is not up to date, please see https://github.com/TeamWin/android_bootable_recovery/ - Team-Win-Recovery-Project/openrecoverysc...
github.com
IMO the mentioned TWRP recovery command line guide isn't useless as you claim.
Using a simple text file, saved in the /cache/recovery/ directory with the name openrecoveryscript, the TWRP recovery can be instructed to execute the described set of commands during the startup, e.g. the installation of a ZIP archive such as a ROM, or the deletion of a partition.
@jwoegerbauer I think you want to refer to https://github.com/TeamWin/android_bootable_recovery/blob/android-10.0/openrecoveryscript.cpp instead, as https://github.com/TeamWin/Team-Win-Recovery-Project ist not maintained if I understand it correctly.
However, I don't want to read the source to find out how to (not) flash a boot.img using TWRP without the UI.
If I understand the docs correctly, TWRP does not support flashing images. It supports restoring backups and installing zips.
I've also tried to find out if there is an easy way to convert the boot.img to an installable zip or TWRP recovery, but so far I've not succeeded.
Do you know an answer to this?
Use Fastboot to flash boot.img
I can't use fastboot as the device (Samsung) does not support it and it would also require physical access.
So far my workflow is to flash the image to a device I have by hand (manually), create a backup of the boot partition with TWRP (manually), download it and then deploy the backup to remote devices via adb and restore them on reboot via the openrecoveryscript.
My workflow would be simplified if could remove the need for the manual process that creates an image/backup that can be flashed remotely.
Well, I found a simpler way to flash the kernel / boot.img directly within the os. I can simply overwrite the partition:
adb push boot.img /sdcard/boot.img
adb shell su -c "dd if=/sdcard/boot.img of=/dev/block/mmcblk0p14"
Don't even have to reboot the device...
For those wondering from where to get the block-device... See ls -l /dev/block/platform/msm_sdcc.1/by-name/ ("msm_sdcc.1" part may be different)

Guide for Updating RUI2 via TWRP

this is a guide for some user running stock Realme UI 2 on rooted device. while stock recovery wont work after unlocking bootloader and magisk installed (UPDATE: apparently stock recovery are working but you have to wait around 30minutes in order to boot into it). the only option for us is using custom recovery. but custom recovery wont recognize the updates because it's unusual format and its unusual location. Be careful!! I'm not responsible for any damage you may encounter doing this guide. I will try to help as far as I could do
(this guide are documentation from rui2.0 c.09 to c.15 update. where rui1.0 to rui2.0 upgrade im using stock recovery )
first of all, we need to download updates from ota server. simply enter Settings app, scroll down and select Software update. wait untill finished, you'll be prompted to install when it's done. but don't have to do that, it only reboot to recovery doing nothing.
now preparing the updates.
the downloaded files are located inside
Code:
/data/ota_package/OTA/.otaPackage
there are 6 files (may vary) and all of them are flashable zips except system_vendor that needs slight modification. copy or move those files to internal or external storage (i personally put those files on /sdcard/updates/). then add .zip extension by renaming (put ".zip" in the end of file name).
modifying system_vendor.zip
extract system_vendor into separate folder. after that, navigate to META-INF/com/google/android/ now edit updater-script replace RMX2151L1 (or similar) with RMX2151 to avoid installation errors. on TWRP, this phone is only recognized as RMX2151 regardless it's actual phone model ( it needs confirmation from other realme 7 users ).
now back to system_vendor folder and replace vbmeta.img file with vbmeta from attachment. after doing all steps simply repack all files and folder into zip with normal compression parameter. (you don't have to replace vbmeta file, but you have to flash modified vbmeta after that to avoid bootloop)
all files are ready to flash using TWRP (or your own preferred custom recovery). flashing this zip might replace bootloader with stock so flashing Magisk are preferred or you'll lose root access.
the intention of making this thread are opening discussion about realme updates. maybe someone out there could make all those steps simpler and easy enough

Categories

Resources