-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathciswl.py
executable file
·74 lines (61 loc) · 1.52 KB
/
ciswl.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Phil Eichinger, phil@zankapfel.net
# License: GPLv2
#
# Custom Idle Screen White List
# Use Team Eureka's whitelist but with a custom idle screen URL
# "Fo ciswl my chrizzle"
from __future__ import print_function
import json
import sys
import urllib2
import cgi;
#import cgitb; cgitb.enable()
try:
if( sys.argv[1] == "-d"):
debug = True
else:
debug = False
except:
debug = False
eureka_wl = "http://pwl.team-eureka.com/applist.php"
idle_appid = "FooBar"
f = cgi.FieldStorage()
try:
idle_url = f["url"].value
except:
idle_url = "https://www.google.com"
#Change idle_url to your desired URL
entry = {
"allow_empty_post_data": True,
"app_id": idle_appid,
"dial_enabled": True,
"url": idle_url,
"use_channel": True
}
try:
if(f["debug"].value == "1"):
debug = True
except:
pass
print("Content-Type: text/html")
if( not debug ):
print("Pragma: public")
print("Expires: 0")
print("Cache-Control: must-revalidate, post-check=0, pre-check=0")
print("Cache-Control: public")
print("Content-Description: File Transfer")
print("Content-Disposition: attachment; filename='apps.conf'")
print("Content-Transfer-Encoding: binary")
print()
u = urllib2.urlopen( eureka_wl )
print(urllib2.unquote(u.readline()), end='')
j = json.loads(u.readline())
j['applications'].insert(0,entry)
j['configuration']['idle_screen_app']=idle_appid
exit
if( debug ):
print( json.dumps( j,sort_keys=True,indent=4, separators=(',', ': ')) )
else:
print(json.dumps(j))