[G Tablet Q&A, Help & Troubleshooting] djab67:
GUIDE - Restore G Tablet after a Failed Recovery Mode "update.zip"

(continued from previous post)

==================================================

K ) SOLUTION STEPS

==================================================

----------------------------------------------------------------------

01 ) FILES NEEDED & LINKS

----------------------------------------------------------------------

These are not direct download links, but rather links to the pages where the download links can be found. The information on these pages is worth understanding as well. List format meaning key - type of files - file description/reference - file name/link.

NVFLASH application & script - roebeet's link to bekit's dropbox files - [RECOVERY] nvflash FULL restore, using either 1.1 or 1.2 based images - [G-TABLET]

NVFLASH bootloader.bin - roebeet's link to bekit's dropbox files - bootloader.bin

NVFLASH image files - rr5678's xda developers post on Utility G Tablet - FORMAT.zip

NVFLASH imgage files - Viewsonic Gtablet For Dummies NVFlash to Stock with CWM pre-installed - gtab.nvflash.1.2.branch.20110508 with cwmv3028.zip

NVFLASH image files - roebeet's Slatedroid forum posted stock NVFlash branch 1.2 files - gtab.nvflash.1.2.branch.20110617.zip

RECOVERY update.zip & command files - roebeet's Slatedroid forum posted Mountain Laurel 1.1.0 files - gtab.Mountain.Laurel.1.1.0.rar

RECOVERY update.zip & command files - roebeet's Slatedroid forum posted Mountain Laurel 1.1.1 files - gtab.Mountain.Laurel.1.1.1.suppl.rar

APK file - Mp4's Slatedroid posted file - 4root.1.3.0.apk

APK file - Titanium Track's - TitaniumBackup_latest.apk

If you need the Android Debug Bridge (adb), then install Google's Android SDK. ADB is a tool within the Android SDK package.

Android SDK download page - Download the Android SDK

Android SDK Install information - Installing the SDK

Additional help with installing the SDK and adb can be found by googling something like "how to install android sdk" or "how to install adb".

----------------------------------------------------------------------

02 ) SET UP

----------------------------------------------------------------------

This is an important part of the process. Setting up the folder structure and placing the tools used within the structure made execution easier for me. Here are a couple of reasons why:

The nvflash shell script files expect the program and bin file to be in the same folder. The same would be true if using windows and the nvflash batch file.

Some of the files used in this process have the same or very similar names. Organizing before execution helped me keep track of where I was in the process and what needed to be done next.

a )

Folders

Create the following folders and sub-folders in your Linux working directory (assumed to be /home/user/):

/gtab/nvflash/format/

/gtab/nvflash/vgdum/

/gtab/nvflash/off12fw/

/gtab/adb/off12fw/

/gtab/adb/ml110/recovery/

/gtab/adb/ml111/recovery/

b )

nvflash - program, bin, and shell scripts

Extract nvflash_linux_2010110500.tar.gz

Create 2 new versions of the nvflash_gtablet.sh shell script.

Open nvflash_gtablet.sh for editing.

File Save As nvflash_complete.sh (do NOT close after save as)

Change the following line:

From

sudo ./nvflash --bct gtablet.bct --setbct --bl bootloader.bin --configfile gtablet.cfg --create --go

To

sudo ./nvflash --bl bootloader.bin --download 9 part9.img --go

Alternative

I learned from burbley's post.

To

sudo ./nvflash -–bl bootloader.bin --sync --go

Note - The dashes in the script lines above are two dashes with no space between. If you try to copy & paste, be sure to double check the syntax.

File Save As nvflash_boot.sh (ok to close now)

Place copies of nvflash, bootloader.bin,nvflash_boot.sh, and/or nvflash_complete.sh in the following file directories as indicated (made execution easier for me):

Folder = /gtab/nvflash/format/ - Files = nvflash, bootloader.bin, nvflash_boot.sh,nvflash_complete.sh

Folder = /gtab/nvflash/vgdum/ - Files = nvflash, bootloader.bin, nvflash_boot.sh, nvflash_complete.sh

Folder = /gtab/nvflash/off12fw/ - Files = nvflash, bootloader.bin, nvflash_boot.sh, nvflash_complete.sh

Folder = /gtab/adb/ml110/ - Files = nvflash, bootloader.bin, nvflash_boot.sh

Folder = /gtab/adb/ml111/ - Files = nvflash, bootloader.bin, nvflash_boot.sh

c )

File movement and extraction

gtab.nvflash.1.2.branch.20110508 with cwmv3028.zip

Move to /gtab/nvflash/vgdum/, extract contents.

Move contents of extracted folder /gtab.nvflash.1.2.branch.20110508 with cwm up to /gtab/nvflash/vgdum/.

Delete the /gtab.nvflash.1.2.branch.20110508 with cwm/, folder (it should be empty now).

FORMAT.zip

Move to /gtab/nvflash/format/, extract contents.

Move contents of extracted folder /FORMAT/ up to /gtab/nvflash/format/.

Delete the /FORMAT/ folder (empty).

gtab.nvflash.1.2.branch.20110617.zip

Move to /gtab/nvflash/off12fw/, extract contents.

Move contents of extracted folder /nvflash1.2/ up to /gtab/nvflash/off12fw/.

Delete the /nvflash1.2/ folder (empty).

gtab.Mountain.Laurel.1.1.0.rar

Move to /gtab/adb/ml110/, extract contents.

You should now have - /gtab/adb/ml110/update.zip and /gtab/adb/ml110/recovery/command.

gtab.Mountain.Laurel.1.1.1.suppl.rar

Move to /gtab/adb/ml111/, extract contents.

You should now have - /gtab/adb/ml111/update.zip and /gtab/adb/ml111/recovery/command

z4root.1.3.0.apk

Move to /gtab/adb/off12fw/.

TitaniumBackup_latest.apk

Move to /gtab/adb/ml111/.

----------------------------------------------------------------------

03 ) CHECKLIST

----------------------------------------------------------------------

Double check the folders and files established in “SETUP”.

Use the terminal for running nvflash and adb (I had two terminal windows open at the same time; one for nvflash commands and the other for adb commands).

Check the permissions on all nvflash (5 copies in 5 different folders), nvflash_boot.sh (5 copies in 5 different folders), and nvflash_complete.sh (3 copies in 3 different folders) files using your file browser:

right-click, select "Properties",

left-click "Permissions" tab,

make sure the check box for "Allow executing file as a program" is checked,

left-click "Close".

----------------------------------------------------------------------

04 ) EXECUTION

----------------------------------------------------------------------

a )

Terminal command line

All commands are run in a terminal session window. Open two terminal session windows, keep both visible if possible.

“nvflash terminal” - In one terminal Navigate to /gtab/nvflash/.

From here on I will refer to this as the “nvflash terminal”.

“adb terminal” - In the other terminal Navigate to /gtab/adb/.

From here on I will refer to this as the “adb terminal”.

b )

Flash FORMAT.zip utility

“nvflash terminal” - Navigate to /gtab/nvflash/format/, put tablet in APX mode.

“nvflash terminal” - Type ./nvflash_complete.sh; Press enter (do NOT hold any volume keys)

Once the script completes, the tablet should display the “Magic Value Mismatch” error, which is ok.

Press the power button to turn the tablet off.

c )

Flash gtab.nvflash.1.2.branch.20110508 with cwmv3028 rom

“nvflash terminal” - Navigate to /gtab/nvflash/vgdum/, put tablet in APX mode.

“nvflash terminal” - Type ./nvflash_complete.sh; Press enter (do NOT hold any volume keys)

Note - The tablet should boot all the way into the gtab.nvflash.1.2.branch.20110508 with cwmv3028 rom. If for some reason is does not, make sure the tablet is off and skip down to step "e )" below.

d )

Tasks in gtab.nvflash.1.2.branch.20110508 with cwmv3028 rom

Nothing really, just go to the home screen, press the power button, and select power off.

e )

Boot gtab.nvflash.1.2.branch.20110508 with cwmv3028 rom

“nvflash terminal” - Navigate to /gtab/nvflash/vgdum/, put tablet in APX mode.

“nvflash terminal” - Type ./nvflash_boot.sh, BEFORE pressing enter, hold down the Volume plus key on the tablet. Keep holding until the tablet has booted into Stock Recovery, press enter

If all went well you should now be in ClockworkMod recovery.

ClockworkMod tasks -

wipe cache partition,

wipe data/factory reset,

partition SDCARD 2048 and 0,

reboot system

Comment - You are now back where you started, a blank screen. No worries, not done yet.

f )

Flash FORMAT utility

(yes we are going to do this again)

“nvflash terminal” - Navigate to /gtab/nvflash/format/, put tablet in APX mode.

“nvflash terminal” - Type ./nvflash_complete.sh, press enter (do NOT hold any Volume keys)

Once the script completes, the tablet will display the “Magic Value Mismatch” error again.

Press the power button to turn the tablet off.

g )

Flash gtab.nvflash.1.2.branch.20110617

“nvflash terminal” - Navigate to /gtab/nvflash/off12fw/, put tablet in APX mode

“nvflash terminal” - Type ./nvflash_complete.sh, press enter (do NOT hold any Volume keys)

The tablet should now boot all the way into the stock gtab.nvflash.1.2.branch.20110617 rom.

Before powering down, there are a few tasks to do in the gtab.nvflash.1.2.branch.20110617 rom:

tablet - Turn on “USB Debugging” in settings, applications

computer - Navigate to “adb terminal” to /gtab/adb/off12fw/; Type adb install z4root.1.3.0.apk, press enter

tablet - launch the z4root app and select Temporary. When done, return to home screen.

tablet - launch esFileExplorer and navigate to SDCARD/

computer - go to your “adb terminal”, you should still be in the /gtab/adb/off12fw/ directory. Type adb shell and press enter;

Note -To verify you are in the adb shell, Type ls. If the result is a tablet directory and file listing, then you are in.

computer -Type su and press enter.

Look at the tablet, “Superuser” should be prompting you for permission. Make sure the “always allow” box is checked and press "ok". The adb shell session should now display the # (pound sign) prompt instead of the $ (dollar sign) prompt.

computer -Within the adb shell as superuser complete the following:

cd sdcard and press enter

mkdir recovery and press enter

exit and press enter (backs out of superuser)

exit and press enter (exits adb shell).

computer -Now do the following in the “adb terminal”

Navigate to /gtab/adb/m110/

Type adb push update.zip /sdcard/update.zip and press enter (wait until it finishes, big file – takes time)

Type cd recovery and press enter

Type adb push command /sdcard/recovery/command and press enter

tablet - using esFileExplorer, confirm that the "pushed" files are in the right location; /sdcard/update.zip and /sdcard/recovery/command

computer - execute the following commands:

Type adb shell and press enter

Type su and press enter

Type reboot recovery, HOLD the Volume plus key on the tablet and press enter

You are now back to the blank screen. Still ok, more to do. If by chance you actually landed on the Stock Recovery screen, then skip down to step "h ) 3." below.

h )

Boot gtab.nvflash.1.2.branch.20110617 Stock Recovery

“nvflash terminal” - Navigate to /gtab/nvflash/off12fw/, put tablet in APX mode

“nvflash terminal” - Type ./nvflash_boot.sh (note - we are using the “boot” shell script this time), BEFORE pressing enter, hold down the Volume plus key on the tablet. Keep holding until the tablet has booted into Stock Recovery. Press enter

You should now be in Stock Recovery and it should have immediately started applying the update.zip file from gtab.Mountain.Laurel.1.1.0.rar you pushed earlier with adb. Once the update completes, you will still be in Stock Recovery.

Do the following in Stock Recovery:

wipe cache partition

wipe data/factory reset

select "reboot system" (do NOT hold any volume keys).

Comment - I think this boot was the first time I saw the three birds since messing the tablet up! However, I still had more to do before testing a power button boot.

The tablet should now boot into roebeet's Mountain Laurel 1.1.0 rom (good signs to note - “3 birds”, “Mountain Laurel” splash, “Honeycomb” animation. Be patient, booting a new rom can take some time.)

i )

Tasks to complete in booted Mountain Laurel 1.1.0 rom

tablet - make sure USB Debugging is on.

tablet - launch esFileExplorer and navigate to the internal SDCARD.

Complete the following:

delete the existing update.zip file;

Navigate into the /SDCARD/recovery folder;

delete the existing command file

computer - select your “adb terminal” and do the following:

Navigate to /gtab/adb/m111/;

Type adb push update.zip /sdcard/update.zip and press enter (wait until it finishes, big file – takes time);

Type cd recovery and press enter;

Type adb push command /sdcard/recovery/command and press enter

tablet - using esFileExplorer, confirm that the "pushed" files are in the right location; /sdcard/update.zip and /sdcard/recovery/command

computer - execute the following commands:

Type adb shell and press enter

Note - Since this rom already has root, you should be superuser upon entering the shell (should see the # prompt). If not ($ prompt instead), then type su and press enter. Confirm with tablet's superuser permissions request if prompted.

computer - Type reboot recovery, HOLD the Volume plus key on the tablet until the tablet boots into recovery, press enter.

Comment -If successful, you are now back to Stock Recovery and this is the first time you haven't been stuck in APX mode. However, we are still not done.

You should now be in Stock Recovery and it should have immediately started applying the update.zip file from gtab.Mountain.Laurel.1.1.1.suppl.rar you pushed earlier with adb. Once the update completes, you will still be in Stock Recovery.

Do the following in Stock Recovery:

wipe cache partition

wipe data/factory reset

select "reboot system" (do NOT hold any volume keys)

Tablet should now boot into the Mountain Laurel 1.1.1 rom. Again, no halt in APX mode. Still not done, we need to do some cleanup.

j )

Tasks to complete in booted Mountain Laurel 1.1.1 rom

tablet - make sure USB Debugging is on.

tablet - launch esFileExplorer and navigate to the internal SDCARD.

Complete the following:

delete the existing update.zip file;

Navigate into the /SDCARD/recovery folder;

delete the existing command file

Note - Some apps were not showing up in Google's Android Market, so I followed roebeet's "Market fix" instructions that are documented in the Mountain Laurel rom posting.

Since we already have adb up and running, let's use it to push the TitaniumBackup_latest.apk.

computer - “adb terminal” - Navigate to /gtab/adb/ml111/; Type adb push TitaniumBackup_latest.apk /sdcard/Download/TitaniumBackup_latest.apk and press enter

Note - I just "pushed" the apk to the tablet's /sdcard/Download/ folder instead of installing it like we did with the z4root.1.3.0.apk previously. I then used esFileExplorer on the tablet to navigate to the folder, then pressed the TitaniumBackup_latest.apk, and selected install.

Follow roebeet's Mountain Laurel instructions for the rest of the fix.

----------------------------------------------------------------------

05 ) TESTING

----------------------------------------------------------------------

Power off your tablet.

Wait a couple minutes to be sure it is off.

Press the power button to turn the tablet on (do NOT hold any Volume keys unless you intend on entering APX Mode or Recovery)

Tablet should boot into Mountain Laurel 1.1.1 rom

----------------------------------------------------------------------

06 ) DONE!

----------------------------------------------------------------------

======================================================================

L ) FINAL THOUGHTS

======================================================================

I have only applied this solution once to one tablet. I do not plan on recreating the APX Mode problem to run through this again. Why? Our household only has one G Tablet and it has since been given to my wife as a birthday present.

I do not know exactly why this sequence worked for me when nothing else I tried did. I leave it to the wonderful expert developers who created the tools and documentation I used to figure out the whys (if they so desire).

Why Mountain Laurel? Because it was coming from a respected and well published developer and it was based on 1.2 branch. It worked in my restore attempt, so it needed to be in my steps. You can try a different custom rom if you want, but I would recommend against anything Honeycomb (only until your tablet is restored). After restoration, I followed roebeet's Brilliant Corners rom instructions and successfully flashed Brilliant Corners over Mountain Laurel with no issues. I have also successfully followed roebeet's instructions in the Brilliant Corners rom post to switch back and forth between Stock and ClockWorkMod Recovery with no issues.

I truly hope these instructions help someone else restore their Viewsonic G Tablet. Good Luck!

djab67

(appendix in next post)