yashsingh1/xdaforums huggingface dataset:
[Miscellaneous Android Development] yuweng:
Just a crazy idea, use MTK Droid Tools to generate a new scatter.txt & see if there is any changes to SPFT... :cowboy:

Plugin your device, start MTK Droid Tools & wait for scatter from file & it will change to Blocks Map

Click at Blocks Map -> Create scatter file

Does D3 has META-mode if it does then you are safe to do a Firmware -> Upgrade i think, since you are flashing your Stock ROM with it... :fingers-crossed:
[Miscellaneous Android Development] farenheith:
Thanks!

I'll try it tonight, but yesterday I did something like it... I compared the scatter extracted from the mzf with the one generated by MTK Droid Tools, but just recovery and bootimg partitions, not all the files. At least these mappings was the same, can't say about the rest.

About the META-mode, I think the D3 have it too. When I flash the firmware through the RSD, I have to turn off the phone and hold Vol - before plugin the USB.

Well, we'll see what I got tonight, dude. If we can't find an "easy" way to flash the recovery, I think I'll start to read the source code of the phone. Maybe I can understand why it's not booting checking the bootable_bootloader_lk or the bootable. mmmm... this "_lk" in the bootable_bootloader is quite suspect... Maybe this mean "locked"? XD

Oh, and something I didn't explored well... If I do a cat /proc/emmc, the recovery and bootimg partitions starts at the same address (0x0060000 I think). You can see in some image [MENTION=4182895]vbdss[/MENTION] posted but I couldn't find it now XD. When we look at the scatter file, there's no conflicts between recovery and bootimg, that's why a possibility is that we can't trust in the /dev/recovery. Maybe when we try to write on it we're actually overwriting the bootimg, what can explains the bootloop in that case, maybe if we write directrly to a physical address we can succeed in replace the recovery partition. I don't know if it's possible, but I friend of mine told me that it's very dangerous, as the mapping table in the MTK is not very consistent

Edit: Sorry, the command is not cat /proc/emmc... It's another one XD... I'm finding out

Edit2: cat /proc/dumchar_info :)

Oh... I'm stupid xD Now I saw the header... it's the size, not the start address
[Miscellaneous Android Development] yuweng:
No worries, all MT65xx with emmc uses mmcblk0... :D

if you see properly that is the size; Start Address for D3 bootimg is C88000 & recovery is 1288000 :cowboy:

On MTK dd command /dev/recovery or /dev/bootimg works... :cool:

You can try below since you have root access... :cowboy:

[U]For boot.img[/U]
[COLOR="Blue"]adb shell su -c "mkdir /data/tmp/"
adb shell su -c "dd if=/dev/bootimg of=/data/tmp/boot.img bs=6291456c count=1"
adb pull "/data/tmp/boot.img"
adb shell su -c "rm -r /data/tmp/"[/COLOR]

[U]For recovery.img[/U]
[COLOR="blue"]adb shell su -c "mkdir /data/tmp/"
adb shell su -c "dd if=/dev/recovery of=/data/tmp/recovery.img bs=6291456c count=1"
adb pull "/data/tmp/recovery.img"
adb shell su -c "rm -r /data/tmp/"[/COLOR]
[Miscellaneous Android Development] farenheith:
This commands is to dump the current recovery, right?
[Miscellaneous Android Development] yuweng:
Yes, use this app to unpack it if you're on Windows & you shall be able to see what is inside rmdisk folder... :good:

Below dd command to push it back...

For boot.img

adb shell su -c "mkdir /data/tmp/"

adb push boot.img "/data/tmp/boot.img"

adb shell su -c "dd if=/data/tmp/boot.img of=/dev/bootimg bs=6291456c count=1"

adb shell su -c "rm -r /data/tmp/"

For recovery.img

adb shell su -c "mkdir /data/tmp/"

adb push recovery.img "/data/tmp/recovery.img"

adb shell su -c "dd if=/data/tmp/recovery.img of=/dev/recovery bs=6291456c count=1"

adb shell su -c "rm -r /data/tmp/"

These dd command will also work while at custom recoveries then take out the su -c command ( but you don't have custom recoveries now... )
[Miscellaneous Android Development] vbdss:
Hey guys, i am back, so how are things going with the custom recovery for D3 ?
[Miscellaneous Android Development] farenheith:
No success yet... I did some tests today but the phone is still getting bootloop.

Also... I have some driver conflict problem with the motorola drivers in my machine... I take hours to successfully flash the firmware again... it's very annoying...

I want to do more tests right now, but I can't. If you want to help:

What I did:

* I got an image from the recovery and then I flashed it again without any changes. The phone boots successfully. This tests was to make sure that the writing operation was not screwing something

* I tried to edit myself the ramdisk of the image I got before and then I flashed it. I got a bootloop again...

What I need now:

FIRST TEST

* Get an Image from recovery with these adb commands

adb shell su -c "dd if=/dev/recovery of=/storage/sdcard1/recovery.img bs=6291456c count=1"
adb pull /storage/sdcard1/recovery.img

* Unpack and repack the image without any change and try to flash again. Commands:

adb push new_image.img /storage/sdcard1/recovery2.img
adb shell su -c "dd if=/storage/sdcard1/recovery2.img of=/dev/recovery bs=6291456c count=1"
reboot

* Look if the phone will boot normally. If not, re install the firmware with RSD

The idea of this test is to check if the phone needs a padded recovery, ie, with exact 6291456 bytes, to boot properly.

SECOND TEST

Do exact as the test above, but, before repack the recovery, add the following parameters in the default.prop in the ramdisk:

ro.testtest=1

This test is to check if the phone will do a validation, like a checksum, in the partition to make sure it can boot. If the phone doesn't boot with this change, then we know that any recovery we put there will not work. If it boot, then the problem is something inside the recovery.

I also saw some differences between the recovery provided by [MENTION=4478781]yuweng[/MENTION] and the stock one, differences related with the mounting of the partitions. I don't know if it was right but, for sure, something like that should screw just the recovery, not the whole boot
[Miscellaneous Android Development] vbdss:
Since we dont have a problem when flashing the stock recovery, i will try to unpack and repack, but i think this wont generate a different checksum (i have no idea, only thinking with myself)

Maybe if we add a file, like a .txt with some text just to make the recovery have a different checksum
[Miscellaneous Android Development] farenheith:
Nice...

The idea about the repack without change I got from here. Some spreadtrum devices, that also have some version of mtk, have problems when you try to use a non-padded recovery. If you see, the stock recovery extracted with the commands I said to you have 6166 kb (more or less), but the repacked will have a little more than 4 k. I think too the checksum will not change, that's why this test is important, maybe we just need to pad the partition to fit the size

But I did another test... and I don't have good news...

I unpacked the bootimg.img and changed the default.prop as stated in the OP, then I repacked it and tried to flash again. The phone didn't booted anymore. Look that I just changed a text file of properties. In theory the changes should not cause any bootloop, but they did. If it's not happening for a checksum of the partitions I don't know why then...

Look that I didn't tried to pad the bootimg.img yet

Maybe the approach we can do is detect exactly what is causing the bootloop in the source code, then we need to change it, compile and flash the new part for the cellphone. Maybe this validation is made by the uboot and, if we're lucky (not the case so far :P) then we can flash a patched one using adb and then this block will not be a problem anymore.
[Miscellaneous Android Development] farenheith:
I got some time in the job and I did the tests :/

I repacked the recovery without change anything, and the phone doesn't boot after that.

Then I tried to repack without changes and then fill the file with ASCII 0 until it reach the max size, and again the phone didn't boot.

The repack operation can indeed change the checksum, as nothing can guarantee that the order of the files in the repacked img will be the same of the original one.

So, The only way I can imagine is to find what validation is happening and how to disable it... source code.

If anyone have some other idea we can try... I can only study the code in August
[Miscellaneous Android Development] rnovino:
auto port working

Finally this is the answer been looking for this that is why it is not working you need to open the MTK Droid Tools :laugh: activate the temporary root and click the adb terminal and let it run on the background and now click the AUTO PORT CWM.exe
[Miscellaneous Android Development] ercea:
I tried to port TWRP to Jiayu G3S (MKT6589) without success (freeze on logo). I executed MTK Droid Tools, activated temporary root and click the adb terminal, on it, I executed 2500.exe and click AUTO PORT.. but, when I rebooted the system freezes on logo. Any suggestion?

regards!!
[Miscellaneous Android Development] spit85:
You executed 2500.exe? Did you used "Auto Port CWM"? If you used michfood port tool for TWRP V2.5.0.0, you must place the original recovery in the folder where the V2.5.0.0.exe is. You don't have to connect your phone to the computer if you use that tool. But if the ported recover is bigger then 6MB and you flash it, you have got a region overlap, that's the reason that your phone freezes. Pull your battery out the phone, to power your phone down. Put it back and flash the original recovery. If you can't pull out the battery, press the power button and hold it until your phone power down.
[Miscellaneous Android Development] ercea:
Hey thanks for your help ;)

I rebuild recovery partition, following this link:

http://www.mediafire.com/view/?7humxw5eb99404u

Then I use michfood port tool for TWRP v2.5.0.0 and used Auto port and Manual port (Selecting emmc partition and 720x1280 screen res) In both cases, when I try to enter recovery, screen flash with a blue sky screen color and then loads Jiayu logo and freezes :(.

I can put my old CWM recovery flashing again with SPFlashtool.

Regards!
[Miscellaneous Android Development] spit85:
And after that there was enough space for the sec_ro partition? I have the problem that my sec_ro partition don't have enough space after downloading it to the phone, because my secro.img was to big. The problem was that then the sec_ro partition cause a region overlap. But you used the download button? Don't use the firmware button.

Use the original scatter file and use michfood v2.4.4.0, and it will run on your phone, because that version isn't bigger than 6 MB. It's not the latest version of it, but it works. Ore you can try to unpack the recovery image, delete the files in the supersu folder. Then repack everything, with some luck your recovery is now smaller then 6MB. You only lose the function to root the phone with TWRP.

Verstuurd van mijn P6_Quad met Tapatalk
[Miscellaneous Android Development] ercea:
Oopps I haven't verified sec_ro partition. I repeated the process and sec_ro partition start and end sections in the same hex dir (starts at 0x3480000 and end at 0x3480000), I supose that it's like doesn't exists sec_ro partition :rolleyes: The document linked before looks like that has similar problem (screen capture on last page we can see the TWRP with all partitions and sec_ro has 0mb), should I get anomalies for this? :confused: , I used "Download" button, not update firmare ;).

Really I'm very noob and inexperienced for this kind of modifications :P, so I think that is better to restore all the system and wait that someday can get a functional TWRP on my Jiayu :P

Regards and thansk for you help! ;)
[Miscellaneous Android Development] spit85:
What you see is the android_secure folder that is on the internal or external SD-Card, not the sec_ro partition.

But have you tried this version from michfood. Its TWRP version 2.4.4.0, and with that version there is no need to change the recovery partition size. Its not the latest version, but you can back-up and restore with it.
[Miscellaneous Android Development] ercea:
Ok, now i'm on job, later I'll work on TWRP 2.4.4.0. A noob question, I've a CWM backup with all my system, If I reflash my original ROM (without resize recovery partiton), can I use this backup to recover my data??

regards and thanks!
[Miscellaneous Android Development] spit85:
If you download everything back with the original scatter file, you can use the backup from CWM. But remember you cant restore CWM backups with TWRP, and also you can't restore TWRP backups with CWM. If you want to port a CWM backup to a TWRP backup, you restore a CWM backup with CWM, flash the TWRP recovery to your phone and backup everything. If you have another CWM backup you want to port, you must flash back the CWM recovery and restore the other backup you want to port to TWRP, and then flash back the TWRP recovery and back-up your phone again.
[Miscellaneous Android Development] ercea:
Yes, yes I know it, I mean reinstall my original ROM without resize recovery partition, then restore my CWM backup and, then, work with TWRP 2.4.4.0. If the process if sucessfull I have to make other backup with TWRP :D

Thx and regards ;)
[Miscellaneous Android Development] timesarchangel:
CWM Recovery Installed!

Hey Madkhaz,

Sorry for such a delay I have been trying to figure this out myself as well. It took me a while but I was finally able to get it.

After connecting the phone in Camera mode I found out that it was a Taiwan made phone called the Haipai N7102 I was able to locate the original Recovery.img from 4Shared. After doing some more research I was able to download and install an English recovery. The recovery was by CWM Version 5.0.2.0 for the HTC Ace http://download2.clockworkmod.com/recoveries/recovery-clockwork-5.0.2.0-ace.img I used the program called Recovery Installer which can be found on the Google PlayStore

https://play.google.com/store/apps/details?id=acr.recovery.installation.utility

I renamed the file recovery.img (all lowercase!!) and placed it on the root of the SD Card. I then opened the program and installed! I then clicked "reboot into recovery" then I pushed both volume up and down at the same time to bring up the menu. I hope this helps. And I am sorry if this is redundant information that some have already found.

:)

Edit: Original Factory Recovery file(s) http://dc597.4shared.com/download/ggaayOFv/Taiwan101_Haipai-N7102_DATA2G_.rar

John :victory:
[Miscellaneous Android Development] ercea:
Well, this night I ported twrp 2.4.4.0 to my Jiayu G3S... but screen doesn't work :S, only power button (that show a lockscreen). I supose that TWRP 2.4.4.0 doesn't support drivers for my screen :(.

Regards and thansks a lot for your help :D
[Miscellaneous Android Development] spit85:
Do you have place the original recovery in the same folder? Not the CWM recovery? I thought i read something about that, somewhere, that some one hat the same problem after using the CWM recovery instead of the stock recovery from the phone. I just can't remember which forum or website it was.
[Miscellaneous Android Development] ercea:
Oops, sorry, I made the port with a functional ported CWM for my phone. Now I made the port with my original stock recovery, but twrp 2.4.4.0 has 6.09mb... more space that recovery partition :(, including making with the less resolution possible... 6.00mb and SPFlashtool show me overlapping message. So I retire for this :P my knoledge is very poor for this jeje.

Regards!!
[Miscellaneous Android Development] spit85:
try this version, its TWRP v2.4.2.0. Maybe its a little bit smaller.

Or place the original recovery here, then i will look at it.
[Miscellaneous Android Development] ercea:
Here you have my original recovery.img, with TWRP 2.4.2.0, first, doesn't appear MTK6589 chipset and the size is bigger than 6mb. Thanks for your time and pacience ;)

regards!
[Miscellaneous Android Development] spit85:
I Changes the images DPI, so the are a few kb smaller. And i deleted the files in the supersu folder. That means that you cant root your phone with TWRP, but i think your phone is already rooted, so that is no problem.

Now it is 6.140 KB, that is 5,99 MB
[Miscellaneous Android Development] ercea:
:| amazing!!! that's work! only one problem, images are inverted so when I press "Install" really I'm pressing "Reboot", etc XDD, but recovery it's working fine!. I supose that inverting dpi images are enough, right?

Regards, and many many thanks spit85 for all your help :) now I've my perfect jiayu rom xD
[Miscellaneous Android Development] spit85:
Just click on the thanks button on the left, lol.

But i rebuild it again, and hopefully the problem with the switches buttons is now solved.

I assume that your pixel size form the screen is 720x1280? That's how i rebuild it.

With the DPI i mean the colors from the png files from the TWRP theme, not the recover image, haha. That give you only 50kb free space, but remove the files in the supersu folder gives more space, because there is the supersu.apk installed, with some more kb. But that isn't needed if your phone is already rooted.
[Miscellaneous Android Development] ercea:
lol, sorry, you right, thx. Yes my screen is 720x1280... but this recovery has the same effect :S images shows inverted but pressed buttons is "original" position :S. I tried reduce dpi images but I have 6.08mb result :P

Regards!
[Miscellaneous Android Development] spit85:
You are sure you download it, because the views for the attachment "recovery_Jiayu_G3S_version2.img" is still 0 :cyclops: or xda is working slow :silly: I rebuild a second version
[Miscellaneous Android Development] ercea:
Hey spit85, sorry I'm out home but I can confirm that I downloaded your second recovery and get the same result. Maybe its a singular problem of my phone :(. Other solution could be edit the ui xml file to put the buttons position inverted

Regards and,as always, many thanks!!
[Miscellaneous Android Development] spit85:
Chance the ui doesn't help. I think it have something to do with the keys, which position a button have. You can change the name in the ui, but not the action form, so I think you will mes up all the buttons in TWRP. It's a xml file, the same thing you use if you are scripting a website, how the website is built up. I will look at the evening at it, if I can find the problem.

Verstuurd van mijn P6_Quad met Tapatalk
[Miscellaneous Android Development] ercea:
Yes you're right, I think that is a difficult problem to solve and it could be neccesary edit TWRP sources because it's seem a render screen problem :S

Regards!
[Miscellaneous Android Development] spit85:
Copy the log to your SD-card. Somewhere in the menu from TWRP you will see the button that you can copy the log to the SD-card.

Maybe there be some errors reported in the log.
[Miscellaneous Android Development] ercea:
Here the log, repeat many times a error message about mount /emmc partition, I don't know if it's this important :S

Regards!
[Miscellaneous Android Development] spit85:
That is the internal storage that he can't mount. Can you mount the internal storage manual in the mount menu from TWRP? Its strange, he can see that it is a fat partition, but can't mount it. But that is not the problem of the switched buttons.

I'm no expert in Linux, but in php scripting, haha.

I will take a look at it if i have the time, but now i'm now lazy on this sunday:p
[Miscellaneous Android Development] ercea:
Ok no problem hehe sunday is for relax ;) thanks anyway for your attention, time and help ;)

regards!
[Miscellaneous Android Development] cmoegele:
Did you make some progress ?
[Miscellaneous Android Development] ercea:
Well, I see that TWRP has following options:

BOARD_HAS_FLIPPED_SCREEN := true -- flips the screen upside down for screens that were mounted upside-down

RECOVERY_TOUCHSCREEN_SWAP_XY := true -- swaps the mapping of touches between the X and Y axis

RECOVERY_TOUCHSCREEN_FLIP_Y := true -- flips y axis touchscreen values

RECOVERY_TOUCHSCREEN_FLIP_X := true -- flips x axis touchscreen values

So, I need to compile a TWRP activating some of these options (I supose that with the first option is enough)... the problem is that I don't know how compile TWRP :(. I followed many guides without success, the main problem is that in all guides sais "lunch (Your device)".... and, or my device doesn't exists.... or I don't know what device select to compile.

javum, in a russian forum, explains how he did it... i'm following now this guide:

http://translate.google.es/translat...y-project-twrp-dlya-platformi-mtk-t24012.html

But I would like to contact with javum if he can compile a TWRP with the options posted before... is very complicated for me but i like this "world" and I would like to learn how do this kind of mods/dev/... :P

Regards!!
[Miscellaneous Android Development] ercea:
Finnally I could contact with javum and he said me that he already knows the inverted screen problem on Jiayu G3S. The solution is in progress so, soon, we can get a functional TWRP on our Jiayu G3S :D

Regards!
[Miscellaneous Android Development] SammaelAkuma:
Used all the tools for the MT6573. TWRP and CWMTouch both work except for the /data mount issue for my Alcatel OT-918 which if I understand is fixable with a recovery.fstab edt.

CWM standard boots, but because of the camera button issue, is unusable. Any idea how to reconfigure the buttons so it goes back to the power button for selections?
[Miscellaneous Android Development] yuweng:
Lately i'm very frustrated & sad at the same time & i pour all my frust... at Brick3d, an xda friend, thanks so much for listening me out, buddy... :o

Thats why i seldom reply to my threads nowadays... :(

i really wonder why this happens on MTK but not for other devices... All take my mod here, ported it & some post it here on xda while others at their own native language forum & not a word on how they did it or mention credits or whatsoever... :(

Do you know how many DEVs are involved to make all these possible, namely Master Shifu bgcngm, Master Shifu Javum, Master Shifu Michfood & not forgetting Master Shifu Koush & the TWRP Team... :(

More info here & they are giving it to us free of charge & its time for you to do your part !

The least you can do is hit those thanks button to show your appreciation... The worse i've seen is they mention credits to themself only as might as well don't mention anything at all...

When you take the work of others, Credit fully the work of others and refrain from taking undue credit...

To an end-user they wouldn't have know or wouldn't even care if you mention credits. However, to fellow DEV/ modder/ programmer, it means alot to them...When you mention credits at the OP, it means you appreciate, recognize, respect & you truly honored to the original DEV for their work that you have taken from...When you don't include credits, end-user will think you are doing all this work by yourself...You can also notice, even great/ well known DEVs/ modders/ programmers all mention credits at their OP b'cos they give recognition to the original work/ person they have taken from too...

AFAIK, the only way is to compile it from source with BOARD_HAS_NO_SELECT_BUTTON := TRUE then it'll work... :cool:

As said many times, custom recoveries here doesn't support Alcatel's custpack partition so if you corrupted your custpack partition, it wouldn't restore it... :cowboy:

And i really wonder why there are no DEVs using MTK Alcatel devices... :eek:
[Miscellaneous Android Development] cmoegele:
Sorry to make you frustrated and sad, but I think on the web it is always the same. If a problem appears there is a lot activity to get it fixed and afterwards, or removing to another device the feedback goes to Zero. Additional we have summer time and with having holiday and good wheather the same result,...

You and all devs are doing a really good job, but i don´t know how this could be improved in our fast rushing time,...

PS: I know its offtopic ;)