HTC One X CM12.1 Installation Guide
A detailed installation, recovery, NewLayout, backup and root guide for the international NVIDIA Tegra 3 HTC One X — codename endeavoru.
Do not follow destructive partition instructions on the Snapdragon HTC One XL (evita), another HTC model, or any device whose partition mapping has not been independently verified. This procedure can erase all data and a wrong format or flash can render the phone unbootable.
What You Need
Prepare the required files and tools before touching the phone.
DOWNLOAD PACK HTC One X Root Tools Pack Required guide assets • MediaFire ↗- Android Platform Tools (ADB and Fastboot)
- Working HTC / ADB / Fastboot USB drivers
twrp-3.1.1-0-endeavoru.imgor a suitable initial recoverytwrp2853-BiG.imgcm-12.1-20160721-UNOFFICIAL-endeavoru.zip- Optional ARM / Android 5.1 Google Apps package
- 7-Zip or similar, plus several GB of PC storage for backups
Verify the Phone is endeavoru
Enable USB debugging, connect the phone, and verify the exact product before continuing.
adb devicesadb reboot bootloaderfastboot devicesfastboot getvar productproduct: endeavoruYou can also inspect the bootloader version:
fastboot getvar version-bootloaderevita, stop. This guide is not for the Snapdragon HTC One XL.Unlock the Bootloader
From Fastboot, confirm the connection and obtain the identifier token.
fastboot devicesfastboot oem get_identifier_tokenUse the identifier token with HTC’s bootloader unlock process to obtain Unlock_code.bin, then flash the unlock token using the actual path to your file.
fastboot flash unlocktoken "C:\path\to\Unlock_code.bin"Install Initial TWRP
The initial recovery used by the tested procedure was twrp-3.1.1-0-endeavoru.img.
fastboot flash recovery "C:\path\to\twrp-3.1.1-0-endeavoru.img"Wait for both Sending and Writing to report OKAY, then enter HBOOT → RECOVERY.
OKAY results are what matter here.Verify Original Partition Layout
In TWRP, inspect the partition table and named mappings. Do not assume another HTC One X has the same mapping.
adb devicesadb shell cat /proc/partitionsadb shell ls -l /dev/block/platform/*/by-name/adb shell blkidOn the tested device, p14 originally appeared as LABEL="HTC STORAGE" TYPE="vfat".
Make Raw Stock Backups
Create and preserve raw stock images before performing the NewLayout conversion. Store the copies on your PC.
Hash the Backups
Hash every backup and save the results alongside the images.
certutil -hashfile "C:\path\to\boot-clean.img" SHA256certutil -hashfile "C:\path\to\system-clean.img" SHA256certutil -hashfile "C:\path\to\userdata-clean.img" SHA256The hashes in the original procedure are specific to that backup. Your own hashes are the authoritative ones for your own files.
Install NewLayout TWRP
Flash twrp2853-BiG.img, which identifies as TWRP 2.8.5.3.BiG NEW LAYOUT.
fastboot devicesfastboot flash recovery "C:\path\to\twrp2853-BiG.img"Wait for successful Sending and Writing results, then enter HBOOT → RECOVERY.
Understand NewLayout
The old layout uses p14 / ISD as the large FAT32 “HTC STORAGE” area and p15 / UDA as roughly 2.2 GB userdata. NewLayout expects:
Installing NewLayout TWRP does not itself convert p14 from FAT32 to ext4.
Verify NewLayout Expectations
Read TWRP’s filesystem table and confirm that the recovery expects the same mapping before converting anything.
adb shell cat /etc/fstab/dev/block/mmcblk0p12 /system ext4 rw /dev/block/mmcblk0p13 /cache ext4 rw /dev/block/mmcblk0p14 /data ext4 rw /dev/block/mmcblk0p15 /xtradata ext4 rwTry TWRP’s Normal Conversion First
In TWRP go to Wipe → Advanced Wipe → Data → Repair or Change File System → Change File System → EXT4.
If this succeeds, skip the manual formatting step. Verify the result:
adb shell blkid /dev/block/mmcblk0p14If it still reports TYPE="vfat", the conversion did not happen.
Manual P14 Conversion — Dangerous
Before the format command is revealed, confirm every item below. These checks do not make an unverified device safe.
First check that the formatter exists and inspect its version:
adb shell which mke2fsadb shell /sbin/mke2fs -VVerify Conversion
Confirm p14 is now ext4, mount /data, and inspect the mount.
adb shell blkid /dev/block/mmcblk0p14adb shell mount /dataadb shell "cat /proc/mounts | grep ' /data '"/dev/block/mmcblk0p14 /data ext4 rw,...Install CyanogenMod 12.1
Keep cm-12.1-20160721-UNOFFICIAL-endeavoru.zip intact. In TWRP choose Advanced → ADB Sideload → Swipe to Start Sideload.
adb devicesadb sideload "C:\path\to\cm-12.1-20160721-UNOFFICIAL-endeavoru.zip"Total xfer: 1.00x confirms transfer, but TWRP itself must still be checked for installer errors.Install Google Apps — Optional
If you want Google services, use an ARM / Android 5.1 GApps package. Open GApps Pico was used in the tested procedure.
Start TWRP’s ADB Sideload mode again, confirm adb devices reports sideload, then:
adb sideload "C:\path\to\open_gapps-arm-5.1-pico.zip"Verify Google Apps
Return to ordinary recovery mode, mount system and check for the installed framework and Play Store components.
adb shell mount /systemadb shell ls /system/priv-app/GoogleServicesFrameworkadb shell ls /system/priv-app/PhoneskyExtract boot.img
For an S-ON HTC One X, extract only boot.img from the root of cm-12.1-20160721-UNOFFICIAL-endeavoru.zip. The tested boot image was 4,538,368 bytes.
Flash boot.img
Reboot into HBOOT → FASTBOOT and verify that Fastboot shows a real serial number.
fastboot devices????????????, do not flash. Fix the USB/driver connection first.fastboot flash boot "C:\path\to\boot.img"First Boot
The phone should now have the CM12.1 system and boot image, NewLayout /data, and optional ARM Android 5.1 GApps.
In TWRP choose Reboot → System. The first boot can take several minutes.
Root Access
Open Settings → About phone and tap Build number seven times. Then go to Developer options → Root access → Apps and ADB and enable Android/USB debugging.
adb devicesadb shellsuiduid=0(root) gid=0(root) context=u:r:sudaemon:s0Why su Doesn’t Work in Windows CMD
su exists on Android, not as a normal Windows command. Enter the Android shell first:
adb shellsuTroubleshooting
ADB worked in TWRP but not CM
Enable Developer options and Android debugging again. Installing a new ROM resets USB debugging configuration and authorisations.
MTP works but adb devices is empty
Check Device Manager, reconnect USB, then restart the ADB server.
adb kill-serveradb start-serveradb devicesFastboot displays ????????????
Do not flash. Reconnect USB, re-enter FASTBOOT USB and fix the driver/connection until the actual serial appears.
TWRP says /data is 0 MB
Check p14. On a verified endeavoru/NewLayout setup, a remaining vfat filesystem means the old HTC Storage filesystem has not been converted.
adb shell blkid /dev/block/mmcblk0p14mkfs.ext4 cannot be found
The tested recovery used /sbin/mke2fs rather than mkfs.ext4.
su returns 255
Set Developer options → Root access → Apps and ADB.
ADB sideload says connection failed: closed
Start TWRP’s Advanced → ADB Sideload mode first. adb devices should report sideload.
Keep a Permanent Recovery Kit
Keep a permanent offline archive containing your clean backups, hashes, recoveries, ROM, extracted boot image, optional GApps package and your own HTC unlock file.
boot-clean.imgsystem-clean.imguserdata-clean.imgSHA256.txttwrp-3.1.1-0-endeavoru.imgtwrp2853-BiG.imgcm-12.1-20160721-UNOFFICIAL-endeavoru.zipboot.imgGApps ARM 5.1 Pico ZIPHTC Unlock_code.binFinal Working Configuration
fastboot getvar product, the by-name mapping and NewLayout fstab first.