FORUMS
Remove All Ads from XDA

[CWM Recovery][Root]Alcatel Onetouch 997D

449 posts
Thanks Meter: 190
 
By jman0, Senior Member on 14th December 2012, 09:52 AM
Post Reply Email Thread
ROOT:

We've been discussing about this for about a month, and I think it's time to sum it all up and open a new cleaner thread.

First, how do you root the Alcatel Onetouch 997D?

This phone is quite new (less than 2 months in the market) and is one of the few phones which can't be rooted by the script developed by Bin4ry or the other well-known methods, such as Unlockroot or SuperOneClick, but it is not unrootable.

In order to root this phone, you must first boot it into Factory mode, a special menu, present in all Mediatek based phones, which can be used to test the various parts of the phone. You get to this menu by turning the phone on while pressing the volume down batton and power button at the same time, until it appears.

Once in factory mode menu, you can connect the phone to a pc, which, if the appropiate adb drivers are installed, will detect it. At this point, the phone can be rooted, by the use of an app called MTK Droid tools. I've succesfully tested versions 2.2.8 and 2.2.9.

After MTK Droid Tools finds the phone, you just have to press the "root" button. The phone will be rebooted two times, and after the second reboot, MTK Droid Tools achieves a temporary root which enables it to install Superuser, su and busybox, so the root is permanent.

During this process, MTK Droid Tools asks whether you want to make a backup. You'd better answer no, since this process is very buggy and fails on this phone, so it's a complete waste of time.

When "Task is complete" message appears, you can reboot the phone, but it won't work right away. Due to a problem not yet identified, it's mandatory to wipe data from recovery for the phone to work. Some people have reported the loss of Google Play Store, and others have lost a lot of apps. Anyway, a wipe solves the problem and the phone remains rooted.

MTK Droid Tools 2.2.8 can be found here: http://www.4shared.com/zip/NyHaro3-/MTKdroidTools.html

CWM Recovery:

We have a 99% working CWMR. I compiled it myself with the help of the dsixda kitchen and the MT6577 CWMR porting plugin developed by Bruno Martins.

I say it's 99% working because backup doesn't work 100%. Alcatel phones have a non standard partition called "custpack", which contains a lot of apps bundled with the phone and whose deletion prevents OTA updates from working, so it's not something one would like to remove. My knowledge of Android is not enough to try to dig inside CWMR source code, to see if I can modify the backup process and make it recognize the custpack partition, so I left it as is. Instead, I decided to develop a shell script which can make CWMR-compatible backups, which can at least be restored from it.

Everything else is fully functional. It's version 6.0.1.2.

To flash it, you need to root the phone, using the method explained above, and flash the recovery image using Mobileuncle Tools utility, which can be freely downloaded from Google Play Store. It's very important to download the latest version from Google Play, since previous versions lying around, and the version MTK Droid Tools installs during the root process can't flash a recovery on MT6577 processors.

To flash the recovery with Mobileuncle tools, you have to place it on the root of the external sd card and open Mobileuncle tools. After granting root permissions, if you haven't done yet, you choose "change recovery" and choose the corresponding .img file. Once the process is done, the phone will automatically reboot into the new recovery. It may fail, which you'll notice because the phone boots into the stock recovery, and you may need to do it again. I've noticed that, at least in mine, it works best if I do it while the phone is unplugged from the computer.

As I said abpove, everything, except backup, works well. Restore works, if you have the correct backup (more on this later).

My CWMR can be downloaded from my Mediafire account: http://www.mediafire.com/?v7wfjr6v1t7b0z5

NANDROID BACKUP:

After noticing the backup process in CWMR can't backup the Alcatel exclusive custpack partition, I began trying to solve this. I guess the best way to do it should be modifying the source code of CWMR to adapt the backup process, but, since that exceedes my current knowledge level, I tried differemt approaches. I downloaded the app Online Nandroid backup from Google Play, and learnt that a nandroid backup can be easily done using a shell script, given you have a rooted phone and a way to execute shell scripts. The good news is that it's done, and I have achieved my goal, and now have a working shell script, which creates backups that can later be restored from CWMR.

This script creates 7 files, like the standard CWMR backup process does. The files are:

1) boot.img
2) recovery.img
3) system.ext4.tar
4) cache.ext4.tar
5) data.ext4.tar
6) .android_secure.vfat.tar
7) nandroid.md5

Files 1, 2, 4, 5 and 6 are exactly what you now get if you use my CWMR port and perform a backup. The difference lies in file 3.

In a backup created from our current CWMR, this are the contents of the tar archives:

system.ext4.tar: files under /system, and all its subdirectories
cache.ext4.tar: files under /cache, and all its subdirectories
data.ext4.tar: files under /data, and all its subdirectories
.android_secure.vfat.tar: files under /sdcard/.android_secure

In a backup created by my script, it's slightly different:

system.ext4.tar: files under /system, and all its subdirectories, and also files under /custpack, and all it's subdirectories
cache.ext4.tar: files under /cache, and all its subdirectories
data.ext4.tar: files under /data, and all its subdirectories
.android_secure.vfat.tar: files under /sdcard/.android_secure

On both backups, boot.img and recovery.img are images compatible with Mediatek Flash Tool or Mobileuncle Tools (in the case recovery.img), and nandroid.md5 contains the md5 sum of every file, so the restore process can validate the integrity of them, to prevent you from ever restoring a corrupt archive.

In order to use my script, you need an app which can execute them. My preference (and the only one I have fully tested the script with) is GScript, which can be freely downloaded from Google Play Store.

There's also a paid version, but the only difference between them is that the paid version is updated more often than the free one.

How to install the script:

1) Download and install GScript, free or paid. You can use the apk file provided by me inside the attached zip.

2) Download the attached zip file with the scipt, if you haven't done so to install GScript.

3) Put the script on the external sd card, under a folder called "gscript". Use lowercase characters for the name and never change the name, as this would result in GScript not working or finding your scripts. The resulting structure should be:

/sdcard/gscript
|
------------> bin

Inside /sdcard/gscript you have the script itself, called "Alcatel_OT_997D_nandroid.sh" and inside /sdcard/gscript/bin, you have the busybox
binary, used by the script. Even if you have busybox already installed, don't delete this binary, since it's the only one the script will use, and
the only one it's been fully tested with.

4) Open GScript.



5) On the GScript main window, you can see a pair of sample scripts already included. You need to touch the menu button and then on "Add script".






6) Browse for the .sh file on /sdcard/gscript, and tick "Needs SU?" if it's not already ticked, since this script needs a rooted phone.





7) Once the new script is in the list of installed scripts, you only need to touch its name to launch it. The first time you do it, GScript will ask for root permissions. Allow it.



Once you open the script, it will run automatically, and will end around 5-10 min. later, depending on how loaded your phone is. In order to be able to see every message shown by the script, it's better to raise the screen timeout, to at least 10 minutes. After execution, the output window will auto close, unless you cancel auto closing by touching anywhere on the screen except, of course, the close button.

The backups are stored under the /sdcard/clockworkmod directory (the script will create it if its not already there), under which it will create a new subdirectory, with the date and time of the backup, just in the same format CWMR uses.

During the execution of the script, you may see two error messages, which are not really errors, but warnings you can ignore. These errors are:

1) Errors creating directories at startup. If the script has already been used, or you have tried the backup inside CWMR, sdcard/clockworkmod/backup already exists. The script will tell you that, but it will keep working.

2) Removing leading "/" from member names: tar utility removes "/" from the input parameters, just that.

3) XXXXXXXX: socket ignored, where XXXXXXXX is the name of a file. Sockets are temporary files Unix apps use to communicate with other apps. Since they are temporary, tar just ignores them, so you can also ignore the error message.

On mi phone, after I close the results window, GScript force closes, but this doesn't affect the execution of the script. As I've read somewhere, it
looks like this is a problem common to a lot of users.

DISCLAIMER:

This script is offered AS IS, with no warranty. It has been successfully tested on my own phone, and the generated backup was then perfectly restored from recovery with no issues, but I can't say it won't fail on other people's phones.

It's the first version, fully functional, but with some room for improvement. As it is right now, it's not error free, since it doesn't check if you have enough space left on the sdcard, or if you don't have any apps moved to the sd card. In fact, I have not tested it in such a situation, and I don't know what would happen if you backup your phone with no apps moved. On the other hand, it doesn't bakcup sd-ext, so if anyone has a second partition on the sdcard, to use Link2SD o a2sd, that partition won't be backed up, although data for apps linked to the second partition will. Anyway, even if it fails, you don't have to worry, since it won't change anything inside the phone. If you later restore a backup made with this script, you are doing it AT YOUR OWN RISK. I will not accept any responsibility for damage or data loss caused by the use of this script or restoration or any backup created with it.

Don't forget this script needs a rooted phone, and that performing some things on rooted phones is risky. If the worst case, you will always be able to recover the phone using Alcatel One Touch Upgrade on your pc.

Any comments or improvements are welcome, but if you change / improve anything, don't forget to share it with the community, so everyone can take advantage of it.

IMPORTANT:

This script is only suitable for the Alcatel OT-997D, and probably other phones by the same brand, if they have the "custpack" partition, exclusive to Alcatel. It won't work, unless code regarding the custpack partition is modified, in other phones, and I will not give support to users complaining the script doesn't work on their non Alcatel phones, or their Alcatel phones without s custpack partition.

FINAL NOTE:

Ok, that's it. Now, I'm going to have a rest, maybe until Alcatel release the long waited Jelly Bean update.

EDIT:

I had forgotten the "thanks" section:

Thanks to:

@dsixda, for the great kitchen

Bruno Martins (@bgcngm) for his valueable advice and his scripts to unpack/repack recovery of any MT657x based device

@yuweng, who developed the great kitchen plugin to port CWMR to any MT657x based device. and also pointed me in the right directory when I was trying to root the phone

@ameer1234567890, author of the great onandroid script. I haven't used your code, but it taught me I had to unmount and remount the sdcard on a different location to be able to backup .android_secure
Attached Files
File Type: zip gscript.zip - [Click for QR Code] (502.9 KB, 1704 views)
The Following 14 Users Say Thank You to jman0 For This Useful Post: [ View ] Gift jman0 Ad-Free
 
 
14th December 2012, 11:41 AM |#2  
OP Senior Member
Thanks Meter: 190
 
More
Reserved
The Following 2 Users Say Thank You to jman0 For This Useful Post: [ View ] Gift jman0 Ad-Free
14th December 2012, 11:43 AM |#3  
OP Senior Member
Thanks Meter: 190
 
More
Reserved too
15th December 2012, 10:39 AM |#4  
Member
Flag Antwerpen
Thanks Meter: 16
 
More
Any chance of working on a custom rom? i would love to get the standard google theme instead of the alcatel icons
maybe i try to get this done, changing the icons is'nt that hard normally

btw i'm still looking to cleanup this phone, you know the partitions pretty wel, where is the location of all the stock apps like chrome etc, i would love to make the phone as close to googles standard as i can get it

edit: you can always pm me, i don't want to ruin this topic
The Following User Says Thank You to robin-sips For This Useful Post: [ View ] Gift robin-sips Ad-Free
18th December 2012, 09:48 PM |#5  
Senior Member
Thanks Meter: 47
 
More
Hey jman10 thank you very much for your awesome tutorial.

But i still have to ask, if the restore works 100%, because of lack of gps signals i made a cwm backup of my current stock-rom(4.0.4) and tried, if the newest update(4.0.4-01001) still has problems with gps signals. Well actually it didn't get any better, so i decided to go back to the old version with the help of my backup.
CWM said there were no errors while restoring, so also thought it. But i get a few bugs using the old version, the stock camera-app gets force closes, even after reboots or a data wipe. The stock e-mail app shows weird artefacts on the email subjects, a very large 'x'. It seems, like a lot of system files are missing or sth.

Can you help me?
Thanks!
19th December 2012, 11:01 AM |#6  
OP Senior Member
Thanks Meter: 190
 
More
Quote:
Originally Posted by kassipopassi

Hey jman10 thank you very much for your awesome tutorial.

But i still have to ask, if the restore works 100%, because of lack of gps signals i made a cwm backup of my current stock-rom(4.0.4) and tried, if the newest update(4.0.4-01001) still has problems with gps signals. Well actually it didn't get any better, so i decided to go back to the old version with the help of my backup.
CWM said there were no errors while restoring, so also thought it. But i get a few bugs using the old version, the stock camera-app gets force closes, even after reboots or a data wipe. The stock e-mail app shows weird artefacts on the email subjects, a very large 'x'. It seems, like a lot of system files are missing or sth.

Can you help me?
Thanks!

If you use my script to backup your rom, restore from CWMR will work 100%. So, your way to go is to start from scratch. Download Alcatel Onetouch Upgrade to a pc, connect the phone and get the latest full version rom on their servers (which sometimes is not the latest one available). Then, connect via wifi and get the latest OTA update. After that, you can root the phone, flash CWMR and make a working backup. From that moment, you'll be able to restore whenever you want and not risk anything.

By the way, which problems are you having with the gps? Mine is working like a charm, even indoors. Where are you from and what kind of tests have you done with it?
The Following User Says Thank You to jman0 For This Useful Post: [ View ] Gift jman0 Ad-Free
19th December 2012, 12:13 PM |#7  
Senior Member
Thanks Meter: 47
 
More
Unhappy
Hey thanks for your quick answer, actually i did the whole process that way:
-root stock firmware 4.0.4
-installed cwm per mobileuncle tools
-created image per script
-updated with the help of one touch manager to 4.0.4-01001
-tried gps, didnt work
-rooted
-installed cwm per mobileuncle tools

and then i wanted to return to point 1, but as soon as i restored the backup, my camera doesnt work and i get random fc's of several apps. i would like to return to stock 4.0.4, because since the new update the system is more laggy
do you know a way? do you have a *.img of the old version?

my gps is really weird, i would say it works at 10%. in my home city i couldnt make it work, then i tried it randomly in 2 other cities and it worked instantly, but then i try it again at the same spot, where it worked a couple of hours earlier and it doesnt work anymore its really weird.

thanks man!
19th December 2012, 11:38 PM |#8  
OP Senior Member
Thanks Meter: 190
 
More
Quote:
Originally Posted by kassipopassi

Hey thanks for your quick answer, actually i did the whole process that way:
-root stock firmware 4.0.4
-installed cwm per mobileuncle tools
-created image per script
-updated with the help of one touch manager to 4.0.4-01001
-tried gps, didnt work
-rooted
-installed cwm per mobileuncle tools

and then i wanted to return to point 1, but as soon as i restored the backup, my camera doesnt work and i get random fc's of several apps. i would like to return to stock 4.0.4, because since the new update the system is more laggy
do you know a way? do you have a *.img of the old version?

my gps is really weird, i would say it works at 10%. in my home city i couldnt make it work, then i tried it randomly in 2 other cities and it worked instantly, but then i try it again at the same spot, where it worked a couple of hours earlier and it doesnt work anymore its really weird.

thanks man!

Did you do a factory reset after rooting? It's really important to do so, and the phone doesn't work if you don't.
20th December 2012, 07:47 AM |#9  
Senior Member
Thanks Meter: 47
 
More
Hey mate,
sure i did, i have no problems with root at all. My problem is to restore my cwm backup i did with the old firmware, because i really want it back badly. Do you have a image file of the "roll out" stock firmware?
Thanks in advance!
20th December 2012, 09:41 AM |#10  
Roland_SGN's Avatar
Senior Member
Flag Baden/Wien (Vienna)
Thanks Meter: 92
 
More
Hi,

it seems like I am missing something.

I installed the MTK-Tools 2.2.8, connected the phone but the phone is not recognized. I see there is missing some MT65xx AndroidPhone-Driver. Where can I get one?

The installation of the OneTouchManager does not help. Any ideas?
20th December 2012, 09:46 AM |#11  
OP Senior Member
Thanks Meter: 190
 
More
Quote:
Originally Posted by kassipopassi

Hey mate,
sure i did, i have no problems with root at all. My problem is to restore my cwm backup i did with the old firmware, because i really want it back badly. Do you have a image file of the "roll out" stock firmware?
Thanks in advance!

The system image I have is vastly modified by me, so it might not be suitable for you. If you did the backup using my script, it should work right away. Can you tell me what files (names, sizes, etc.) you have in your backup?
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes