I accidently flashed a S4 ROM.
After I noticed that, I tried to flash a factory image, but it booted for a very long time and WiFi, signal and other radio stuff didn't work.
Then I searched for help here, but anything they suggested didn't work, so you might be thinking that the only solution would be to send the device for repair.
But I searched for a solution anyway and found it
So this is what you need to download:
- LGNPST (Mirror)
- Factory Image flashable with LGNPST
- Factory Image flashable with fastboot (Mirror)
- The Universal ADB Driver
For Nexus 4 16GB:
- Modified busybox dd
- 16G Primary GPT(includes MBR)
- 16G Secondary GPT
- CWM Revovery Image
Factory Image flashable with LGNPST: 0dc53827dabc9a5778c20b2afbb07dba/ 28b8c61a9f09398149219d24b3d21a2e51fb3c81
Factory Image flashable with fastboot:
Modified busybox dd:
16G Primary GPT(includes MBR):
16G Secondary GPT: 78458096fe12d9e089f33e6fd1a55835/
CWM Revovery Image: 28156448103f241d80fb517b03144389/ f5b61f39bd4f81eb1a179737295b3205108f1f7f
OK let's start:
First thing we need to do is installing the LGNPST (this is for Windows 8, but I don't see why it shouldn't work on other versions).
- Install "LGUnitedMobileDriver_S4981MAN38AP22_ML_WHQL_Ver_3 .8.1.exe", it's located under "LG_USB_Driver"
- Install "LGNPSTv1.3_Lab_Verison_RightClickReg.exe", located in root of the folder
- Install "LGNPST_GenericModels_Ver_5_0_12_0", located under "NPST Generic Components and Models"
- Install "LGNPST_Components_Ver_5_0_20_0", also located under "NPST Generic Components and Models"
- Copy the Models folder to C:\LG Electronics\LGNPST\
- Start a command prompt as admin
- Type: regsvr32 "C:\LG Electronics\LGNPST\Models\LGNPST_LS970.dll" (yes, I know this is a .dll for the Optimus G)
If you got no ADB or fastboot drivers installed, istall the Universal ADB Driver.
Now extract LGE960AT-00-V10d-NXS-XX-MAR-04-2013-JVP15L-FACTORY+0.zip
Rename the .tot file in it to a .bin file.
Now start the LGNPST.
Now get your N4 into download mode:
- Turn the phone off.
- Make sure the phone is off.
- Plug a USB cable into your PC, AND ONLY INTO YOUR PC. THE PHONE PART COMES NEXT.
- Hold down the volume up and down buttons for 2 (two) seconds on your Nexus, and continue to hold the volume up and down buttons while pluging in the USB cable which is connected to your PC. Continue to hold the buttons until the download mode screen appears. Now step five.
- Once the download mode screen comes up, let go of the volume buttons.
Thanks to @Connor Baker for sharing this method
Now you should get a screen like this:
Now your LGNPST should look like this:
In the bottom center you see DLL and BIN File.
Click on the folder symbol and select LGNPST_LS970.dll (and again, yes, I know it's for Optimus G, trust me I know what I'm doing)
Then select the .bin file you extracted before.
Now click start and it'll flash it.
Your N4 will reboot automatically, but the LGNPST reached only 85%, thats's normal (but please wait until the 67% changed to 85% before you close it)
The LGNPST will say you, that you should reboot again to download mode to finish the process, but the only thing it does is giving you an error message.
So now you have a developer firmware on your device and it's encrypted so you can do nothing.
Reboot into bootloader with Vol - and power button.
Now extract the flashfactory.zip and get into that folder.
Then start flash_all.bat and the programm will do the things by itself.
Now you are completly on stock and should have a completly working device
Next steps for Nexus 4 16GB:
First thing I need to say: No, this doesn't work!
First step is rooting your phone (search through XDA if you don't know how; thanks to Rockstar600 for remembering me)
Copy the files you downloaded for the 16GB Version on your Nexus 4 (without the CWM Image).
If "dd" got renamed to "dd.bin" rename it back to "dd".
Install Root Browser or an similar app and copy the files to your /system directory.
Then flash the CWM Recory Image.
To do that open the folder that contains the Factory Image flashable with fastboot and do CTRL+Right Click in that folder and select "Open Command Prompt here" or something like that (don't know the exact name).
Get your device into fastboot mode with Vol- and Power.
fastboot flash recovery recovery-clockwork-touch-188.8.131.52-mako.img
I think you leaved CMD open.
So now type:
adb shell mount /system cp /system/dd / chmod 755 /dd /dd if=/dev/block/mmcblk0 of=/system/pgpt8G.img bs=512 count=34 /dd if=/dev/block/mmcblk0 of=/system/sgpt8G.img bs=512 skip=30777311 umount /data umount /cache umount /system df -h
# df -h Filesystem Size Used Available Use% Mounted on tmpfs 911.7M 48.0K 911.6M 0% /dev
If there is no extra line then continue with:
mount /system /dd if=/dev/block/mmcblk0 of=/system/DDR bs=512 skip=15267840 count=2015 /dd if=/system/DDR of=/dev/block/mmcblk0 bs=512 seek=30775296 conv=notrunc /dd if=/system/sgpt16G.img of=/dev/block/mmcblk0 bs=512 seek=30777311 conv=notrunc /dd if=/system/pgpt16G.img of=/dev/block/mmcblk0 bs=512 seek=0 conv=notrunc parted /dev/block/mmcblk0
# parted /dev/block/mmcblk0 GNU Parted 184.108.40.206.179-aef3 Using /dev/block/mmcblk0 Welcome to GNU Parted! Type 'help' to view a list of commands. (parted) p p Model: MMC 016G92 (sd/mmc) Disk /dev/block/mmcblk0: 15.8GB Sector size (logical/physical): 512B/512B Partition Table: gpt Number Start End Size File system Name Flags 1 524kB 67.6MB 67.1MB fat16 modem 2 67.6MB 68.2MB 524kB sbl1 3 68.2MB 68.7MB 524kB sbl2 4 68.7MB 70.8MB 2097kB sbl3 5 70.8MB 71.3MB 524kB tz 6 71.3MB 94.4MB 23.1MB boot 7 94.4MB 117MB 23.1MB recovery 8 117MB 118MB 799kB m9kefs1 9 118MB 119MB 799kB m9kefs2 10 119MB 120MB 799kB m9kefs3 11 120MB 121MB 524kB rpm 12 121MB 121MB 524kB aboot 13 121MB 122MB 524kB sbl2b 14 122MB 124MB 2097kB sbl3b 15 124MB 124MB 524kB abootb 16 124MB 125MB 524kB rpmb 17 125MB 125MB 524kB tzb 18 125MB 126MB 524kB metadata 19 126MB 143MB 16.8MB misc 20 143MB 159MB 16.8MB ext4 persist 21 159MB 1040MB 881MB ext4 system 22 1040MB 1627MB 587MB ext4 cache 23 1627MB 15.8GB 14.1GB ext4 userdata 24 15.8GB 15.8GB 524kB DDR 25 15.8GB 15.8GB 507kB grow
In case parted reports an error I suggest to return back to the old 8G partition tables, see below.
You can close parted with simply typing quit.
Now reboot the phone into bootloader: type reboot and hold 'Up' button to enter bootloader menu.
fastboot erase userdata fastboot -w
Now you have your 16GB back
Return back to the old 8G partition tables:
In case parted reported an error, put the old 8G partition tables back. This should not happen but never say never:
/dd if=/system/sgpt8G.img of=/dev/block/mmcblk0 bs=512 seek=30777311 conv=notrunc /dd if=/system/pgpt8G.img of=/dev/block/mmcblk0 bs=512 seek=0 conv=notrunc
- In /persist directory create bluetooth directory. Under the new directory create a file named .bdaddr (don't miss the dot!)
Edit the file and put 6 random characters in it. Even better, if you can do this in a hex editor and put 6 random bytes, not just printable characters.
- Set execute and read permissions for everybody on /persist/bluetooth directory and change owner of .bdaddr to bluetooth:bluetooth and permission to 660 (read/write for owner and group and nothing else). In command line:
chown root:root /persist/bluetooth chmod 755 /persist/bluetooth chown bluetooth:bluetooth /persist/bluetooth/.bdaddr chmod 660 /persist/bluetooth/.bdaddr
- In /persist directory create wifi directory. In the new directory create a file named .macaddr (don't miss the dot!)
Edit the file and put 12 random hex numbers in it (0-9, A-F), save.
- Set execute and read permissions for everybody on /persist/wifi directory and change owner of .macaddr to wifi:wifi and permission to 660 (read/write for owner and group and nothing else). In command line:
chown root:root /persist/wifi chmod 755 /persist/wifi chown wifi:wifi /persist/wifi/.macaddr chmod 660 /persist/wifi/.macaddr
Every $ helps me : Donate
- Koush for his ADB Driver
- Jhoopes517 for his tutorial to install LGNPST
- FLYN's thread about unbricking a Nexus 4, because I got the parts for LGNPST from there
- foil for his .tot files
- Jbele for his picture from download mode xD
- Google for the factory images
- dvhexer for his guide to convert 8GB to 16GB