Skip to content

Instantly share code, notes, and snippets.

View pexcn's full-sized avatar
🇹🇼

pexcn

🇹🇼
  • Earth ⇄ Venus
  • Taiwan
View GitHub Profile
@pexcn
pexcn / patch-rtc.py
Last active September 15, 2015 09:49 — forked from Lekensteyn/patch-rtc.py
Script to patch an Android recovery.img file, changing the qcom,qpnp-rtc-write Device Tree property (tested with an Android 5.1 image based on kernel 3.4 for a Nexus 5 (rev_11)).
#!/usr/bin/env python
"""
Patch a recovery image to enable RTC writing
Unfortunately it has not the intended effect (tested from recovery):
~ # /system/xbin/hwclock -w
hwclock: RTC_SET_TIME: Operation not permitted
<3>[ 25.821247] spmi_pmic_arb fc4cf000.qcom,spmi: pmic_arb_wait_for_done: transaction denied (0x5)
<3>[ 25.821338] qcom,qpnp-rtc qpnp-rtc-ee162000: SPMI write failed