├── after.jpeg ├── camera.png ├── final.jpg ├── before.jpeg ├── snapscore.jpg ├── guide ├── style.css └── index.html ├── README.md ├── requirements.txt └── snapscore.py /after.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hassancodes/snapscore/HEAD/after.jpeg -------------------------------------------------------------------------------- /camera.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hassancodes/snapscore/HEAD/camera.png -------------------------------------------------------------------------------- /final.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hassancodes/snapscore/HEAD/final.jpg -------------------------------------------------------------------------------- /before.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hassancodes/snapscore/HEAD/before.jpeg -------------------------------------------------------------------------------- /snapscore.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hassancodes/snapscore/HEAD/snapscore.jpg -------------------------------------------------------------------------------- /guide/style.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | padding: 0; 4 | font-family: 'JetBrains Mono', monospace; 5 | background: #ffffff; 6 | color: #252525; 7 | text-align: center; 8 | 9 | } 10 | 11 | div{ 12 | display:flex; 13 | justify-content: center; 14 | align-items: center; 15 | height: 100vh; 16 | 17 | } -------------------------------------------------------------------------------- /guide/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 |
9 |
10 | # After
11 |
12 |
13 |
14 | # More After After
15 |
16 |
17 | # Implementing multiple snapsends concurrently.
18 | Efficiency will be increased by 500% assuming that we are sending snaps to 5 people at the same time.
19 |
20 | # How to Run:
21 |
22 | ```git clone -repo link here```
23 | For the current codebase you have to provide the cordinates of each element from your android phone. You can go to setting open **"shop cordinates"** or **show taps**
24 |
25 | Required Software:
26 | * python 3
27 | * **ADB** android debug bridge installed
28 | * An android device that you will connect to your pc. So we can execute the shell command through any charging cable. make sure that the charging cable supports data Transfer.
29 |
30 | To send one snap at a time you can simple run the command
31 |
32 | ```python snapscore.py```
33 |
34 | to multiple snaps to a group of people you can use the flag **"exp"**
35 |
36 | ``` python snapscore.py exp```
37 |
38 |
39 | What can Be improved?
40 | * Instead of giving the cordinates, we can take screen shot of the android device, compare it with a smaller image where we want to click
41 | * get the cordinates of that image.
42 | * And automatically perform actions on those cordinates. this will be genius and unstopable but then everyone will have a higher snapscore and then it will not be fun and then this will loose it value which I don't want.😉
43 |
44 | * current snapscore reached : **1000480+**
45 | * images sent : **782,644**
46 |
47 |
48 | #### Thanks for showing love. this Repository have 8 stars now . wow
49 |
50 | [](https://buymeacoffee.com/hassancodes)
51 |
52 |
--------------------------------------------------------------------------------
/requirements.txt:
--------------------------------------------------------------------------------
1 | affine==2.3.1
2 | appdirs==1.4.4
3 | async-generator==1.10
4 | async-timeout==4.0.2
5 | attrs==21.4.0
6 | Automat==20.2.0
7 | autopep8==1.7.0
8 | beautifulsoup4==4.11.1
9 | blinker==1.4
10 | Brotli==1.0.9
11 | bs4==0.0.1
12 | certifi==2021.10.8
13 | cffi==1.15.0
14 | charset-normalizer==2.0.12
15 | chromedriver-autoinstaller==0.4.0
16 | click==8.1.1
17 | click-plugins==1.1.1
18 | cligj==0.7.2
19 | colorama==0.4.4
20 | computer-vision==0.0.6
21 | config==0.5.1
22 | constantly==15.1.0
23 | construct==2.10.68
24 | cryptography==36.0.1
25 | cssselect==1.1.0
26 | cycler==0.11.0
27 | decouple==0.0.7
28 | Deprecated==1.2.13
29 | dnspython==2.2.1
30 | et-xmlfile==1.1.0
31 | fake-useragent==0.1.11
32 | Flask==2.1.1
33 | fonttools==4.33.3
34 | GDAL @ file:///C:/Users/hassa/Downloads/GDAL-3.4.2-cp310-cp310-win_amd64.whl
35 | h11==0.13.0
36 | h2==4.1.0
37 | hpack==4.0.0
38 | hyperframe==6.0.1
39 | hyperlink==21.0.0
40 | idna==3.3
41 | imageio==2.22.1
42 | importlib-metadata==4.11.4
43 | incremental==21.3.0
44 | itsdangerous==2.1.2
45 | Jinja2==3.1.1
46 | joblib==1.1.0
47 | kaitaistruct==0.9
48 | kiwisolver==1.4.2
49 | libusb1==3.0.0
50 | lxml==4.8.0
51 | MarkupSafe==2.1.1
52 | matplotlib==3.5.1
53 | MouseInfo==0.1.3
54 | mpi==1.0.0
55 | mpi4py==3.1.3
56 | networkx==2.8.7
57 | numpy==1.22.3
58 | opencv-python==4.6.0.66
59 | openpyxl==3.0.9
60 | outcome==1.1.0
61 | packaging==21.3
62 | pandas==1.4.2
63 | parse==1.19.0
64 | Pillow==9.1.0
65 | ply==3.11
66 | protobuf==3.19.4
67 | pure-python-adb==0.3.0.dev0
68 | pyasn1==0.4.8
69 | PyAutoGUI==0.9.53
70 | pycodestyle==2.9.1
71 | pycparser==2.21
72 | pycryptodomex==3.14.1
73 | pydivert==2.1.0
74 | pyee==8.2.2
75 | PyGetWindow==0.0.9
76 | pymongo==4.1.1
77 | PyMsgBox==1.0.9
78 | pyOpenSSL==22.0.0
79 | pyparsing==3.0.8
80 | pyperclip==1.8.2
81 | pyppeteer==1.0.2
82 | pyquery==1.4.3
83 | PyRect==0.2.0
84 | PyScreeze==0.1.28
85 | pysmi==0.3.4
86 | pysnmp==4.4.12
87 | PySocks==1.7.1
88 | python-dateutil==2.8.2
89 | pytweening==1.0.4
90 | pytz==2022.1
91 | PyWavelets==1.4.1
92 | PyYAML==6.0
93 | rasterio @ file:///C:/Users/hassa/Downloads/rasterio-1.2.10-cp310-cp310-win_amd64.whl
94 | redis==4.3.4
95 | requests==2.27.1
96 | requests-html==0.10.0
97 | scikit-image==0.19.3
98 | scikit-learn==1.0.2
99 | scipy==1.8.0
100 | selenium==4.1.5
101 | selenium-wire==4.6.4
102 | six==1.16.0
103 | sklearn==0.0
104 | sniffio==1.2.0
105 | snuggs==1.4.7
106 | sortedcontainers==2.4.0
107 | soupsieve==2.3.2.post1
108 | spotipy==2.20.0
109 | tensor==0.3.6
110 | threadpoolctl==3.1.0
111 | tifffile==2022.10.10
112 | toml==0.10.2
113 | tqdm==4.64.0
114 | trio==0.20.0
115 | trio-websocket==0.9.2
116 | Twisted==22.2.0
117 | twisted-iocpsupport==1.0.2
118 | typing==3.7.4.3
119 | typing_extensions==4.1.1
120 | urllib3==1.26.8
121 | w3lib==1.22.0
122 | webdriver-manager==3.5.4
123 | websockets==10.3
124 | Werkzeug==2.0.3
125 | wrapt==1.14.1
126 | wsproto==1.1.0
127 | zipp==3.8.0
128 | zope.interface==5.4.0
129 | zstandard==0.18.0
130 |
--------------------------------------------------------------------------------
/snapscore.py:
--------------------------------------------------------------------------------
1 | # from ppadb.client import Client as AdbClient
2 |
3 | # import time
4 | # import subprocess
5 | # import os
6 | # import sys
7 |
8 |
9 | # class SnapScore: # cam image and screen image should be string
10 | # def __init__(self, device):
11 | # self.device = device
12 | # # self.cam_img = cam_img
13 | # # self.screen_img = screen_img
14 |
15 | # def click_camera(self):
16 | # self.device.shell(
17 | # f'input touchscreen tap {cam_points[0]} {cam_points[1]}')
18 | # time.sleep(1)
19 |
20 | # def take_picture(self):
21 | # self.device.shell(
22 | # f'input touchscreen tap {cam_click_points[0]} {cam_click_points[1]}')
23 | # time.sleep(1)
24 |
25 | # def send_image(self):
26 | # self.device.shell(
27 | # f'input touchscreen tap {send_cord[0]} {send_cord[1]}')
28 | # time.sleep(1)
29 |
30 | # # function for sending multiple snaps.
31 | # def exp_snaps(self):
32 | # count =0
33 | # main_cam_cords=(542,2290)
34 | # cam_click_img_cord =(535,2050)
35 | # next_cord = (925,2280)
36 | # # friends_grp_cord=(879,1100)
37 | # friends_grp_cord=(910,1225)
38 |
39 | # # use this one where are some best friends
40 | # # friends_grp_cord=(910,1951)
41 |
42 | # send_grp_cord =(992,2270)
43 | # # get the camera location in the middle
44 | # # take the image
45 | # # select the group of people you want to send the image to
46 | # # send the snap and repeat the cycle
47 | # while(count!=400):
48 | # count+=1
49 | # time.sleep(1)
50 | # self.device.shell(f'input touchscreen tap {main_cam_cords[0]} {main_cam_cords[1]}')
51 | # time.sleep(1)
52 | # self.device.shell(f'input touchscreen tap {cam_click_img_cord[0]} {cam_click_img_cord[1]}')
53 | # time.sleep(1)
54 | # self.device.shell(f'input touchscreen tap {next_cord[0]} {next_cord[1]}')
55 | # time.sleep(1)
56 | # self.device.shell(f'input touchscreen tap {friends_grp_cord[0]} {friends_grp_cord[1]}')
57 | # time.sleep(1)
58 | # self.device.shell(f'input touchscreen tap {send_grp_cord[0]} {send_grp_cord[1]}')
59 | # print(f"cyle: {count}")
60 |
61 |
62 |
63 |
64 |
65 |
66 | # cam_points = (72, 1582)
67 | # cam_click_points = (535, 2055)
68 | # send_cord = (995, 2280)
69 |
70 |
71 | # client = AdbClient(host="127.0.0.1", port=5037)
72 | # devices = client.devices()
73 | # if len(devices) == 0:
74 | # print("No devices attached")
75 | # quit()
76 | # device = devices[1]
77 |
78 |
79 | # # initialization
80 |
81 |
82 | # snp = SnapScore(device)
83 | # if __name__ == "__main__":
84 | # cam_points = (72, 1582)
85 | # cam_click_points = (535, 2055)
86 | # send_cord = (995, 2280)
87 | # client = AdbClient(host="127.0.0.1", port=5037)
88 | # devices = client.devices()
89 |
90 | # if len(devices) == 0:
91 | # print("No devices attached")
92 | # quit()
93 | # device = devices[1]
94 |
95 | # if sys.argv[1] == 'exp':
96 | # # write exponential code over here
97 | # snp.exp_snaps()
98 | # elif sys.argv[1] =='reg':
99 | # print([x.serial for x in devices])
100 |
101 | # snapsent = 0
102 | # while(snapsent !=1000):
103 | # print("lol")
104 | # snapsent += 1
105 | # print(f"total Number of snap sent are", snapsent)
106 | # snp.click_camera()
107 | # snp.take_picture()
108 | # snp.send_image()
109 |
110 |
111 | from ppadb.client import Client as AdbClient
112 | import time
113 | import sys
114 |
115 | # Constants
116 | CAM_POINTS = (72, 1582)
117 | CAM_CLICK_POINTS = (535, 2055)
118 | SEND_CORD = (995, 2280)
119 |
120 | MAIN_CAM_CORDS = (542, 2290)
121 | CAM_CLICK_IMG_CORD = (535, 2050)
122 | NEXT_CORD = (925, 2280)
123 | FRIENDS_GRP_CORD = (910, 1225)
124 | SEND_GRP_CORD = (992, 2270)
125 |
126 | class SnapScore:
127 | def __init__(self, device):
128 | self.device = device
129 |
130 | def click_camera(self):
131 | self.device.shell(f'input touchscreen tap {CAM_POINTS[0]} {CAM_POINTS[1]}')
132 | time.sleep(1)
133 |
134 | def take_picture(self):
135 | self.device.shell(f'input touchscreen tap {CAM_CLICK_POINTS[0]} {CAM_CLICK_POINTS[1]}')
136 | time.sleep(1)
137 |
138 | def send_image(self):
139 | self.device.shell(f'input touchscreen tap {SEND_CORD[0]} {SEND_CORD[1]}')
140 | time.sleep(1)
141 |
142 | def exp_snaps(self):
143 | count = 0
144 | while count != 400:
145 | count += 1
146 | time.sleep(1)
147 | self.device.shell(f'input touchscreen tap {MAIN_CAM_CORDS[0]} {MAIN_CAM_CORDS[1]}')
148 | time.sleep(1)
149 | self.device.shell(f'input touchscreen tap {CAM_CLICK_IMG_CORD[0]} {CAM_CLICK_IMG_CORD[1]}')
150 | time.sleep(1)
151 | self.device.shell(f'input touchscreen tap {NEXT_CORD[0]} {NEXT_CORD[1]}')
152 | time.sleep(1)
153 | self.device.shell(f'input touchscreen tap {FRIENDS_GRP_CORD[0]} {FRIENDS_GRP_CORD[1]}')
154 | time.sleep(1)
155 | self.device.shell(f'input touchscreen tap {SEND_GRP_CORD[0]} {SEND_GRP_CORD[1]}')
156 | print(f"Cycle: {count}")
157 |
158 | def select_device():
159 | client = AdbClient(host="127.0.0.1", port=5037)
160 | devices = client.devices()
161 |
162 | if not devices:
163 | print("No devices attached.")
164 | sys.exit(1)
165 |
166 | print("Connected devices:")
167 | for idx, device in enumerate(devices):
168 | print(f"{idx}: {device.serial}")
169 |
170 | # Default to first device if only one
171 | selected_index = 0 if len(devices) == 1 else int(input("Select device index: "))
172 | return devices[selected_index]
173 |
174 | def main():
175 | if len(sys.argv) < 2:
176 | print("Usage: python script.py [exp | reg]")
177 | sys.exit(1)
178 |
179 | device = select_device()
180 | snp = SnapScore(device)
181 |
182 | if sys.argv[1] == 'exp':
183 | snp.exp_snaps()
184 | elif sys.argv[1] == 'reg':
185 | snaps_sent = 0
186 | while snaps_sent != 1000:
187 | print(f"Sending snap #{snaps_sent + 1}")
188 | snp.click_camera()
189 | snp.take_picture()
190 | snp.send_image()
191 | snaps_sent += 1
192 | print(f"Total snaps sent: {snaps_sent}")
193 | else:
194 | print("Invalid argument. Use 'exp' or 'reg'.")
195 |
196 | if __name__ == "__main__":
197 | main()
198 |
--------------------------------------------------------------------------------