Val Protocol Moto LK Patcher: Unlock Bootloader & FRP

Val Protocol (Moto LK Patcher): Bootloader Unlock & FRP Removal for Motorola MTK Devices

For years, Motorola's MediaTek lineup has been one of the most frustrating platforms at the repair bench. Samsung got its tested routes, Xiaomi got its patched bootloads, but Moto MTK devices stayed locked behind a bootloader chain that no free tool could reliably touch.

Val Protocol (Moto LK Patcher) changes that. It's a static analyzer and patch automation tool built specifically for Motorola LK/LKS bootloader images — and the current release is a big step forward from the rough early builds. You now get three working presets (unlock-only, FRP-only, and unlock-plus-FRP), runtime serial-derived key validation, automatic AArch64 / ARM32 Thumb architecture detection, and rebuilt images whose MTK CERT2 hashes are updated and verified before you ever flash anything.

Even better, the compatibility list now stretches across the newest Motorola lineup — including 2024, 2025, and 2026 models like the Moto Edge 70 Pro, Moto G86 Power 5G, and Moto Razr 60.

In this guide, you'll find the full supported device list, every preset explained with commands, a real bench scenario, and honest answers about safety, legality, and limitations.

Val Protocol (Moto LK Patcher): Bootloader Unlock & FRP Removal for Motorola MTK Devices

What Is Val Protocol?

Val Protocol is a static analyzer and patch automation tool for Motorola MediaTek LK/LKS bootloader images. If you're new to the terminology: LK (Little Kernel) is the bootloader stage on MTK devices that enforces the entire unlock flow — including the fastboot oem unlock <key> gate, FRP checks, key/hash validation, and partition erase routines.

Instead of blind-patching offsets, Val Protocol takes a research-grade approach. The tool:
  1. Extracts the lk payload from Motorola LK container images
  2. Locates relevant bootloader control-flow patterns inside the payload
  3. Applies selected research patches to the unlock flow
  4. Rebuilds the original multi-image container layout
  5. Updates the MTK certificate hash (CERT2) so the modified image can be flashed on devices that already allow custom LK flashing
The result is a patched bootloader that accepts keys you generate yourself — derived from a secret only you know and the device's own serial number.

What the Tool Targets (Scope)

Val Protocol focuses on Motorola/MTK LK images that use the common Motorola unlock flow, specifically:
  1. fastboot oem unlock <key> command handling
  2. FRP/OEM unlock gate checks
  3. Key/hash validation routines
  4. Unlock-flow partition erase calls
  5. Runtime serial number lookup through the bootloader serialno getter
  6. MTK CERT1/CERT2 image hash verification metadata
Both AArch64 and ARM32 Thumb LK payloads are supported, as long as their patterns match the analyzer signatures.

Why "Val Protocol"? The Story Behind the Name

Most GSM tools have forgettable names. This one doesn't — and the developer has been refreshingly honest about it.

Val is short for Valeria. In the developer's own words, she's the girl he was in love with, and during the entire implementation of this project, he couldn't get her out of his mind. Her name became the first working secret in the code.

That detail matters more than it sounds. In the earliest builds, using secrets that were longer or shorter shifted the generated patch layout too much, causing genuinely unstable behavior: repeated reboots, rejected commands, or devices that wouldn't boot until the original LK was restored. Valeria's name happened to produce the stable layout the project needed at the beginning.

The implementation later became flexible enough to support other secrets of any length — but the project started working because of her, and because of her name. It's a rare bit of humanity in a scene full of anonymous cracked tools, and honestly, it's part of what makes this project worth covering.

Key Features

Here's everything the current release brings to the bench:
  • LK subimage extraction from Motorola LK/LKS container images
  • Automatic architecture detection — AArch64 or ARM32 Thumb, no manual selection needed
  • Detailed static-analysis artifacts, including:
    • String references
    • Candidate flows
    • FRP/OEM checker candidates
    • Key validator candidates
    • Partition erase operations
    • Serial number runtime source
  • Three high-level presets covering unlock-only, FRP-only, and unlock-plus-erase workflows
  • Runtime serial number derivation for generated keys — no serial embedded in the image
  • Full container rebuild preserving the original multi-image layout
  • Automatic MTK CERT2 image hash updates after patching
  • Post-patch verification — the rebuilt LK image is verified after signing

Inside the Project: Repository Layout

The project is cleanly modularized, which is unusual for tools in this space:

File / DirectoryPurpose
lk_auto_patch.pyEnd-to-end analyzer, patcher, and repacker
lk_static_analyzer.pyStatic analysis and report generation
lk_patch_partition.pyPatch implementation engine
lk_keygen.py20-character key generator
lk_repack_signed.pyRepack signed LK payload into a container
liblk/Minimal LK/LKS container parser
tools/build-part-img.pyReplace a subimage in an MTK partition image
tools/sign_mtk_cert.pyUpdate MTK CERT2 hashes
tools/verify_mtk_image.pyVerify MTK CERT1/CERT2 image metadata
docs/Documentation and related project materials

Bench note: The modular design means each stage (analyze → patch → repack → sign → verify) can be run and inspected separately. If a patch fails validation, you'll know exactly which stage broke — not just that "it didn't work."

What's Changed? Earlier Builds vs. the Current Release

The tool you can download today is noticeably more mature than the early experimental builds the developer described. Here's an honest side-by-side:

AreaEarlier BuildsCurrent Release
Patch Layout StabilityShifted with secret length, causing reboots, rejected commands, and boot failuresStable layout regardless of secret length
Secret HandlingOnly short, specific secrets worked reliablyFlexible — supports user-defined secrets of any length
Unlock KeysTrial-and-error approachesRuntime serial-number derivation; one patched LK per model/build while keys remain device-specific
Workflow PresetsSingle experimental flowThree presets: unlock-serial, erase-serial, unlock-serial-nvdata
Architecture SupportManual handlingAutomatic detection for AArch64 and ARM32 Thumb
ValidationNo reliable pre-flash checkRebuilt image verified after signing — Result: VALID
Device CoverageLimited testingExpanded Edge / G / Razr coverage, including 2024–2026 models

Val Protocol vs. Traditional Motorola Unlock Methods

MethodBootloader UnlockFRP RemovalCostLimitations
Official Motorola unlock requestYes (eligible models)NoFreeMany MTK models and carrier variants may not be eligible
Paid remote unlock servicesYesSometimesPer deviceWaiting times, trust concerns, and limited transparency
Generic MTK FRP toolsNoVariesVariesUsually do not modify the bootloader unlock state
Val ProtocolYes — serial-derived keyYes — erase-serial presetFree (AGPL v3.0)Pattern-based compatibility; requires a PC and Python

Supported Devices: Full Compatibility List

Val Protocol covers a wide slice of Motorola's MediaTek portfolio. Here's the complete list:

Moto Edge Devices

ModelDevice Name
 XT2205-3              Moto Edge (2022)
 XT2305-1Moto Edge (2023)
 XT2139-1Moto Edge 20 Lite
 XT2303-2Moto Edge 40 (2023)
 XT2307-1Moto Edge 40 Neo 5G (2023)
 XT2409-2Moto Edge 50 Neo 5G (2024)
 XT2519-1Moto Edge (2025)
 XT2505-3Moto Edge 60
 XT2509-1Moto Edge 60 Neo
 XT2503-1Moto Edge 60 Fusion
 XT2507-1Moto Edge 60 Pro
 XT2607-2Moto Edge 70 Pro

Moto G Devices

ModelDevice Name
XT2163-1Moto G Pure
XT2213-3Moto G 5G (2022)
XT2613-1Moto G (2026)
XT2513-1Moto G 5G (2025)
XT2173-3Moto G31
XT2625-6Moto G37
XT2167-1Moto G41
XT2625-5Moto G47 5G
XT2149-1Moto G50 5G (2021)
XT2343-1Moto G54 5G
XT2435-1Moto G55 5G (2024)
XT2529-1Moto G56 5G (2025)
XT2133-1Moto G60s
XT2431-1Moto G64 5G
XT2529-3Moto G66j 5G
XT2621-3Moto G67 (2026)
XT2255-3Moto G72
XT2237-1Moto G73 5G (2023)
XT2621-3Moto G77 5G
XT2527-2Moto G86 5G
XT2527-1Moto G86 5G
XT2527-6Moto G86 Power 5G
XT2271-5Moto G Play (2023)
XT2615-1Moto G Play (2026)
XT2165-5Moto G Power (2022)
XT2311-3Moto G Power 5G (2023)
XT2415-5Moto G Power 5G (2024)
XT2515-2Moto G Power 5G (2025)
XT2211-2Moto G Stylus (2022)
XT2317DLMoto G Stylus (2023)

Moto Razr Devices

ModelDevice Name
XT2453-1Moto Razr 50 / Moto Razr (2024)
XT2553-1Moto Razr 60 / Moto Razr (2025)

Important: Compatibility Is Pattern-Based, Not Model-Name-Based

This is the part most blogs will skip, and it's the most important thing to understand. A new LK is considered compatible only when:
  • The lk payload can be extracted
  • The architecture is detected
  • The unlock flow is found
  • The FRP/OEM checker candidate is found
  • The key validator candidate is found
  • The unlock erase block is found (when the selected preset needs it)
  • The serial number runtime source is found
  • The rebuilt image verifies as Result: VALID
Matching a model number in the list above does not guarantee success on every firmware build. Always test patched images on recoverable lab devices before using them in production workflows.

The Three Presets Explained

Val Protocol ships with three high-level presets, and choosing the right one depends entirely on what the job needs.

1. unlock-serial — Bootloader Unlock Only

Patches the unlock flow to use a key derived from your secret and the device serial number, read internally by LK at runtime.

python lk_auto_patch.py "path/to/lk.img" \
  -o "path/to/lk.unlock-serial.img" \
  --preset unlock-serial \

  --key-token-secret "YourSecret"

Runtime usage on the device:

fastboot oem unlock GENERATED_KEY

2. erase-serial — FRP Removal Without Unlocking

This is the preset for customers who only need FRP cleared. It reuses the fastboot oem unlock <key> flow, validates a serial-derived key, erases the selected partition (typically frp) in the unlock erase block — and returns before changing the bootloader unlock state. The phone stays locked; only the FRP partition is wiped.

python lk_auto_patch.py "path/to/lk.img" \
  -o "path/to/lk.erase-frp.img" \
  --preset erase-serial \
  --erase-token-partition frp \
  --erase-token-secret "YourSecret"

The runtime command is still fastboot oem unlock GENERATED_KEY — the patched bootloader simply handles it differently.

3. unlock-serial-nvdata — Unlock + Redirected Erase

The combined workflow preset. It patches the unlock flow with serial-derived key validation and changes the unlock-flow partition erase target. Normally, Motorola's unlock flow wipes a radio-sensitive partition. This preset redirects that erase to a partition of your choice — typically frp — so you unlock the bootloader and clear FRP in a single authorized command.

python lk_auto_patch.py "path/to/lk.img" \
  -o "path/to/lk.unlock-frp.img" \
  --preset unlock-serial-nvdata \
  --key-token-secret "YourSecret" \
  --erase-partition frp


Warning
: Only use replacement partition names that fit in the original string space. Short names like frp and cache are typical safe examples. Long partition names will not fit and can break the flow.

How Runtime Serial Derivation Works

This is the cleverest part of the design. The current presets do not embed the target serial number into the LK image. Instead, the patched key validator calls the LK serial number getter at runtime and derives the validation condition from the serial the device reports itself.

The key is still generated off-device:

python lk_keygen.py --secret "YourSecret" --serialno "SERIAL_FROM_FASTBOOT" --count 1

The practical benefit: one patched LK image per supported model/build, while keys remain device-specific. A shop can prepare a patched LK for a given model once and generate per-device keys on the fly.

Practical Scenario: FRP Removal on a Moto G54 5G at the Bench

Let's ground this in a real repair situation.

The job: A customer brings in a Moto G54 5G (XT2343-1). The phone was factory-reset by a family member, and the Google account credentials are long forgotten. FRP is active, and the bootloader is locked. The customer wants the phone usable again — and doesn't want to pay remote-unlock server fees.

Step 1 — Prepare your environment. Install Python 3.11+ (64-bit) and the dependencies, then pull the stock firmware for the customer's exact build and locate the LK image inside it.

python -m pip install -r requirements.txt

Step 2 — Patch the LK image. Since this customer only needs FRP removed (not custom ROM access), the erase-serial preset is the right choice:

python lk_auto_patch.py "lk.img" \
  -o "lk.erase-frp.img" \
  --preset erase-serial \
  --erase-token-partition frp \
  --erase-token-secret "MyShopSecret2024"

Step 3 — Confirm the patch is valid. Check the console output. You want to see Result: VALID before anything touches the phone. If the analyzer can't find the required patterns, stop — this build isn't compatible.

Step 4 — Flash the patched LK. Boot the phone into bootloader mode and flash the rebuilt image back to the LK partition (fastboot flash lk lk.erase-frp.img — on some builds the partition appears as lk1/lk2).

Step 5 — Read the device serial number.

fastboot getvar serialno

Step 6 — Generate the device-specific key using your secret and the serial you just read:

python lk_keygen.py --secret "MyShopSecret2024" --serialno "SERIAL_FROM_FASTBOOT" --count 1

Step 7 — Run the unlock command with the generated 20-character key:

fastboot oem unlock GENERATED_KEY

Step 8 — Finish the job. The patched bootloader validates the key, erases the frp partition, and returns with the unlock state untouched. Factory reset through recovery, and the phone sets up like new — no Google lock, no paid server.

Bench notes: Keep the original lk.img backed up for every device you service — it's your recovery path. Keys are derived per serial, so a key generated for one phone will never validate on another. And if the customer later wants custom ROMs, that's a separate job with the unlock-serial-nvdata preset.

Requirements & Installation

Val Protocol is deliberately lightweight on dependencies:

  • Python 3.11+ (64-bit recommended)
  • Capstone 5.x — installed in the active Python environment

Install everything with:

python -m pip install -r requirements.txt

The project includes liblk locally, and the analyzer contains fallback logic for environments where a local capstone/ folder shadows the installed package. A CustomTkinter-based UI is also referenced in the project documentation for those who prefer a graphical interface over the command line.

Quick Start: The Full Workflow at a Glance

For technicians who just want the command sequence:

# 1. Patch the LK image with the serial-based unlock preset
python lk_auto_patch.py "path/to/lk.img" \
  -o "path/to/lk.unlock-serial.img" \
  --preset unlock-serial \
  --key-token-secret "YourSecret"
# 2. Read the device serial number
fastboot getvar serialno
# 3. Generate a key for that serial number
python lk_keygen.py --secret "YourSecret" --serialno "SERIAL_FROM_FASTBOOT" --count 1
# 4. Use the generated key on the device
fastboot oem unlock GENERATED_KEY

Expected Output: How to Confirm a Successful Patch

Knowing what a healthy patch looks like saves hours of guessing.

A successful AArch64 patch usually includes lines similar to:

Architecture : aarch64
Serialno runtime: 0x...
Patch   : FRP/OEM checker call skip
Patch   : KEY derived token gate
Mode    : EXPERIMENTAL runtime-serial-compact-inplace
Device  : runtime serialno from LK
SerialFn: 0x...
Result: VALID

A successful ARM32 Thumb patch usually includes:

Architecture : arm32_thumb
Serialno runtime: 0x...
Patch   : KEY derived token gate
Arch    : arm32_thumb
Returns : success=... fail=...
Result: VALID

If you don't see Result: VALID, do not flash the output image. The analyzer is telling you a required pattern wasn't found.

Safety and Legal Notice

This deserves its own section, because bootloader work is genuinely risky:

  • Use this tool only on devices you own or are explicitly authorized to service.
  • Bootloader modification can permanently brick devices, erase user data, affect warranty state, and violate local law or vendor terms if used without authorization.
  • The project is intended for repair, interoperability research, recovery workflows, and controlled lab analysis.
  • Always keep the original image and a known recovery path before flashing modified firmware.

No tool in this category is risk-free, and anyone who tells you otherwise is selling something.

Credits, Documentation & License

Val Protocol stands on the shoulders of prior public Motorola/MTK research. Special thanks to:

  • kasnria001/pwnage24mtk
  • R0rt1z2/liblk
  • R0rt1z2/lkpatcher

Full details are in the project's ACKNOWLEDGEMENTS.md. The repository also ships with documentation covering the usage guide, architecture notes, analysis outputs, troubleshooting, the CustomTkinter UI, and a publishing checklist — worth reading before your first patch.

The project is released under the GNU Affero General Public License v3.0.

Frequently Asked Questions (FAQ)

What is Val Protocol (Moto LK Patcher)?

It's a free, open-source static analyzer and patch automation tool for Motorola MediaTek LK/LKS bootloader images. It patches the unlock flow so bootloader unlocking and FRP removal work with serial-derived keys, then rebuilds and re-signs the image with updated MTK CERT2 hashes.

Which Motorola devices are supported?

A wide range of Moto Edge, Moto G, and Moto Razr MTK models — from the Moto G Pure and Edge 20 Lite up to the Edge 70 Pro, G86 Power 5G, and Razr 60. Remember: compatibility is pattern-based per firmware build, not just model-name-based.

Do I need a dongle, box, or paid credits?

No. You need a PC running 64-bit Python 3.11+ with Capstone 5.x, the stock LK image for your device's build, and fastboot. The tool is free under the AGPL v3.0 license.

Which preset should I use: unlock-serial, erase-serial, or unlock-serial-nvdata?

Use `unlock-serial` to unlock the bootloader only, `erase-serial` to remove FRP without changing the unlock state, and `unlock-serial-nvdata` to unlock and redirect the erase operation to the FRP partition in one workflow.

Can one generated key unlock multiple phones?

No. Keys are derived from your secret plus the device's serial number, which the patched bootloader reads at runtime. Each phone needs its own key generated with `lk_keygen.py`.

Can it brick my device?

There is always risk with bootloader modification. Keep the original LK image, only flash outputs marked `Result: VALID`, use replacement partition names that fit the original string space, and test on recoverable lab devices first.

Does it work on Windows or Linux?

Both — anything that runs 64-bit Python 3.11+ with Capstone 5.x. The analyzer also includes fallback logic for tricky Python environments, and a CustomTkinter UI is referenced in the docs.

Is using Val Protocol legal?

It's intended for repair, interoperability research, and recovery on devices you own or are authorized to service. Unauthorized use may violate local law, vendor terms, or warranty conditions — always verify before proceeding.

Download Password: Daarvi.Tech

📺 Follow Daarvi.Tech on YouTube

Get the latest mobile servicing tools, firmware updates, GSM tutorials and useful tech guides. Subscribe to our YouTube channel for new updates.

▶ Subscribe on YouTube

Post a Comment

0 Comments