-
Notifications
You must be signed in to change notification settings - Fork 54
Open
Description
Hi,
Was not able to use shared script for non rooted Android and since I have JB iPad i updated script to work with IOS DB.
import sqlite3 as lite
This script will "parse" the broadlink e-Control IOS application database and dump the IR / RF codes for selected accessories into a text file which can be later used with broadlink-python to send the codes to the RM PRO hub
You need to get the "BroadLinkDeviceList.sqlite" file from your (Jailbreaked) IOS device. the file is located in "var/mobile/Containers/Data/Application/[application e-control]/Documents/BroadLinkDeviceList.sqlite" and put it in the same folder as this script.
buttonIDS = []
buttonNames = []
e-Control Database file
con = lite.connect('BroadLinkDeviceList.sqlite')
Get All Accessories
with con:
cur = con.cursor()
cur.execute("SELECT subirID, name FROM broadlink_subir")
rows = cur.fetchall()
for row in rows:
print "Accessory ID: " + str(row[0]) + " | Accessory Name: " + row[1].encode('utf-8')
Choose Accessory
accessory = input("Select Accessory ID: ")
cur.execute("SELECT name FROM broadlink_subir where subirID =" + str(accessory))
accessory_name = cur.fetchone()[0]
print "[+] You selected: " + accessory_name.encode('utf-8')
print "[+] Dumping codes to " + accessory_name.encode('utf-8') + ".txt"
Get Buttons subirID
with con:
cur = con.cursor()
cur.execute("SELECT name, buttonID FROM broadlink_button where subIRId=" + str(accessory))
rows = cur.fetchall()
for row in rows:
buttonIDS.append(row[1])
buttonNames.append(row[0])
codesFile = open(accessory_name.encode('utf-8') + '.txt', 'w')
# Get Codes
for i in range(0, len(buttonIDS)):
cur.execute("SELECT code FROM broadlink_code where buttonId=" + str(buttonIDS[i]))
code = cur.fetchone()[0]
result = "Button Name: " + buttonNames[i] + "| Button ID: " + str(buttonIDS[i]) + " | Code: " + str(code).encode('hex') + "\n"
codesFile.writelines(result.encode('utf-8'))
codesFile.close()
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels