-
-
Save miketartar/0fc8d7bca2369ce73ea9ee7b6e0c3775 to your computer and use it in GitHub Desktop.
import json | |
import sqlite3 | |
import os | |
DB_PATH = "C:/ProgramData/Cold Turkey/data-app.db" | |
def activate(): | |
try: | |
conn = sqlite3.connect(DB_PATH) | |
c = conn.cursor() | |
s = c.execute("SELECT value FROM settings WHERE key = 'settings'").fetchone()[0] | |
dat = json.loads(s) | |
if dat["additional"]["proStatus"] != "pro": | |
print("Your version of Cold Turkey Blocker is not activated.") | |
dat["additional"]["proStatus"] = "pro" | |
print("But now it is activated.\nPlease close Cold Turkey Blocker and run again it.") | |
c.execute("""UPDATE settings SET value = ? WHERE "key" = 'settings'""", (json.dumps(dat),)) | |
conn.commit() | |
else: | |
print("Looks like your copy of Cold Turkey Blocker is already activated.") | |
print("Deactivating it now.") | |
dat["additional"]["proStatus"] = "free" | |
c.execute("""UPDATE settings set value = ? WHERE "key" = 'settings'""", (json.dumps(dat),)) | |
conn.commit() | |
except sqlite3.Error as e: | |
print("Failed to activate", e) | |
finally: | |
if conn: | |
conn.close() | |
def main(): | |
if os.path.exists(DB_PATH): | |
print("Data file found.\nLet's activate your copy of Cold Turkey Blocker.") | |
activate() | |
else: | |
print("Looks like Cold Turkey Blocker is not installed.\n If it is installed then run it at least once.") | |
if __name__ == '__main__': | |
main() | |
sou estudante de TI primeiro período, tô perdido como faço isso, se vc puder dá uma ajudada, já instalei o vscode e o phyton, mas n estou conseguindo,
Step one:
Close cold turkey app and the minitray icon of coldTurkey
Create a file called ColdTurkeyBlockerActivator.py
then open CMD to this dir.
Run this code (The one above is formatted incorrectly): name it ColdTurkeyBlockerActivator.py
import json
import sqlite3
import os
DB_PATH = "C:/ProgramData/Cold Turkey/data-app.db"
def activate():
try:
conn = sqlite3.connect(DB_PATH)
c = conn.cursor()
s = c.execute("SELECT value FROM settings WHERE key = 'settings'").fetchone()[0]
dat = json.loads(s)
if dat["additional"]["proStatus"] != "pro":
print("Your version of Cold Turkey Blocker is not activated.")
dat["additional"]["proStatus"] = "pro"
print("But now it is activated.\nPlease close Cold Turkey Blocker and run again it.")
c.execute("""UPDATE settings SET value = ? WHERE "key" = 'settings'""", (json.dumps(dat),))
conn.commit()
else:
print("Looks like your copy of Cold Turkey Blocker is already activated.")
print("Deactivating it now.")
dat["additional"]["proStatus"] = "free"
c.execute("""UPDATE settings set value = ? WHERE "key" = 'settings'""", (json.dumps(dat),))
conn.commit()
except sqlite3.Error as e:
print("Failed to activate", e)
finally:
if conn:
conn.close()
def main():
if os.path.exists(DB_PATH):
print("Data file found.\nLet's activate your copy of Cold Turkey Blocker.")
activate()
else:
print("Looks like Cold Turkey Blocker is not installed.\nIf it is installed then run it at least once.")
if __name__ == '__main__':
main()
Make sure you have python installed and do py ColdTurkeyBlockerActivator.py
or python ColdTurkeyBlockerActivator.py
Then re-open the app & now you have pro
Thank you
Thank you so much. This code is 100% working. I am very grateful to you.
Thank you so much Brother ! I can't believe this works.
it works like a charm, really grateful to you man.
np
thank you so much it works great also I would like to tell anyone that is reading this that don't update the cold turkey they rectify these loop holes and you have to wait for the crack everytime
Beautiful, now i can focus on my studies, you are a life saver! THANK YOU !
Beautiful, now i can focus on my studies, you are a life saver! THANK YOU !
can you please help me do it cause i am not that techy person
thank you so much it works great also I would like to tell anyone that is reading this that don't update the cold turkey they rectify these loop holes and you have to wait for the crack everytime
bro can you help do this cause i am not that techy person
Looks brilliant. Suprised to see they trust you enough to make activation a matter of changing a flag in a JSON column in an SQL database.
thank you so much it works great also I would like to tell anyone that is reading this that don't update the cold turkey they rectify these loop holes and you have to wait for the crack everytime
bro can you help do this cause i am not that techy person
Thank you
Thank you :)
oi, esse arquivo é para ter uma chave de ativação do cold turkey block?