[Nexus 7 Q&A, Help & Troubleshooting] Rhian:
Hi,

Just to add my :eek: experience...

I was doing just fine until I wanted to show the oem lock/unlock to a friend. The locking worked fine, the unlocking caused the (user)data to be in a weird state and reported itself as encrypted after booting 'normally'. I did not have the message that it could not be relocked. Relocking worked without errors. My userdata was however inaccessible in TWRP or Android.

I've done a bunch of things but nothing seemed to do the trick except for this sequence...

I decided to blatantly ignore the userdata partition during the whole stock image flashing. I had removed the erase part in the batch-file as well as omitting the -w for the update command (-w = wipe).

It seemed to take aaaaaaages before it was done, but then it booted and rebooted into 4.1.2 with a working userdata!

D:\Temp\nakasi-jzo54k>flash-special.bat
erasing 'boot'...
OKAY [ 0.024s]
finished. total time: 0.026s
******** Did you mean to fastboot format this partition?
erasing 'cache'...
OKAY [ 0.087s]
finished. total time: 0.088s
erasing 'recovery'...
OKAY [ 0.024s]
finished. total time: 0.026s
******** Did you mean to fastboot format this partition?
erasing 'system'...
OKAY [ 0.111s]
finished. total time: 0.112s
sending 'bootloader' (2092 KB)...
OKAY [ 0.265s]
writing 'bootloader'...
OKAY [ 1.250s]
finished. total time: 1.519s
rebooting into bootloader...
OKAY [ 0.020s]
finished. total time: 0.022s
archive does not contain 'boot.sig'
archive does not contain 'recovery.sig'
archive does not contain 'system.sig'
--------------------------------------------
Bootloader Version...: 3.41
Baseband Version.....: N/A
Serial Number........: 015d[COLOR="Red"]<deleted>[/COLOR]
--------------------------------------------
checking product...
OKAY [ 0.040s]
checking version-bootloader...
OKAY [ 0.022s]
sending 'boot' (4896 KB)...
OKAY [ 0.589s]
writing 'boot'...
OKAY [ 0.632s]
sending 'recovery' (5240 KB)...
OKAY [ 0.625s]
writing 'recovery'...
OKAY [ 0.571s]
erasing 'system'...
OKAY [ 0.213s]
sending 'system' (446268 KB)...
OKAY [ 51.824s]
writing 'system'...
OKAY [ 34.980s]
rebooting...

finished. total time: 89.622s
Press any key to exit...

My flash-special.bat:

@ECHO OFF
:: Copyright 2012 The Android Open Source Project
::
:: Licensed under the Apache License, Version 2.0 (the "License");
:: you may not use this file except in compliance with the License.
:: You may obtain a copy of the License at
::
:: http://www.apache.org/licenses/LICENSE-2.0
::
:: Unless required by applicable law or agreed to in writing, software
:: distributed under the License is distributed on an "AS IS" BASIS,
:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
:: See the License for the specific language governing permissions and
:: limitations under the License.

PATH=%PATH%;"%SYSTEMROOT%\System32"
fastboot erase boot
fastboot erase cache
fastboot erase recovery
fastboot erase system
fastboot flash bootloader bootloader-grouper-3.41.img
fastboot reboot-bootloader
ping -n 10 127.0.0.1 >nul
fastboot update image-nakasi-jzo54k.zip

echo Press any key to exit...
pause >nul
exit

Please note that this only seemed to work with flashing 4.1.2 (jzo54k). I tried this with the stock 4.2.2 and it didn't gave me access, it just presented me with the "Enter password" screen. Once in 4.1.2 I could do an OTA into 4.2.2 (jdq39)