Applescript成功实现imessage数据筛选,imessage蓝号检测,无痕检测手机号是否注册imessage的原理

发布时间 2023-10-31 21:31:30作者: 稻香's

一、imessages数据检测的两种方式:
1.人工筛选,将要验证的号码输出到文件中,以逗号分隔。再将文件中的号码粘贴到iMessage客户端的地址栏,iMessage客户端会自动逐个检验该号码是否为iMessage账号,检验速度视网速而定。红色表示不是iMessage账号,蓝色表示iMessage账号。
2.编写苹果Mac Os操作系统下的脚本程序进行过滤(全自动无痕检测,无需人工干预),将数据输入到号码文本框之后,如果捕获到失败的异常则不是iMessage账号,捕获到成功则把数据保存下来。
3.最新升级版本请参考博文首页相关文章: https://www.cnblogs.com/im66168/

 

 

二、实现全自动无痕检测数据是否启用或开通imessages
电脑版全自动无痕检测手机号是否注册iMessage(注意:检测不同国家手机号需要在手机号的前缀 +国家代码即可,自动无痕检测导入的txt数据,蓝色的手机号数据自动保存,有偿提供源代码或检测脚本,有意可联系飞机:@ap16633 )
全自动无痕检测手机或邮箱号是否注册iMessage的代码示例:

  1 -- 检测手机号或邮箱号是否注册imesaages,imessages蓝号检测
  2 -- 检测是iMessge数据存放位置      ->    send/已开启im的数据.txt 
  3 -- 检测不是iMessge数据存放位置     ->    send/未开启im的数据.txt   
  4 
  5 startApp()
  6 --Get_UI() --获取iMessages应用所有ui元素
  7 
  8 --获取Messages应用所有ui元素
  9 on Get_UI()
 10     tell application "Messages" to activate
 11     tell application "System Events"
 12         tell process "Messages"
 13             tell window 1
 14                 entire contents
 15             end tell
 16         end tell
 17     end tell
 18 end Get_UI
 19 
 20 
 21 --检测数据是不是imessage数据
 22 on startApp()
 23     tell application "Finder" to activate
 24     
 25     tell application "Finder"
 26         set chosenfile to (choose file)
 27     end tell
 28     
 29     tell application "Messages"
 30         tell application "Messages" to activate
 31         
 32         set phoneData to read chosenfile
 33         set cards to paragraphs of phoneData
 34         
 35         repeat with phone in cards
 36             --set msgText to (my AppendFace(" "))
 37             
 38             -- 假如字符串大于0,则草率判定是手机号
 39             set num to the length of phone
 40             if (num > 0) then
 41                 --执行检测
 42                 my sendMsg(phone)
 43                 delay 1    
 44             end if
 45         end repeat
 46         display dialog "恭喜,数据已全部检测完毕!"
 47     end tell
 48 end startApp
 49 
 50 
 51 # 执行检测
 52 on sendMsg(phone)
 53     tell application "Messages" to activate
 54     tell application "System Events"
 55         tell process "Messages"
 56             tell window 1
 57                 --核心代码,省略.........
 58                 
 59                 if static text of sheet 1 of window "信息" of application process "Messages" of application "System Events" exists then
 60                     --对未启用imessage的手机号码进行记录
 61                     my WritePhone(phone, "未开启im的数据.txt")
 62                 else
 63                     --对已启用imessage的手机号码进行记录
 64                     my WritePhone(phone, "已开启im的数据.txt")
 65                 end if
 66                 
 67                 
 68                 delay 0.2
 69                 key code 76
 70 
 71                 
 72             end tell
 73         end tell
 74     end tell
 75 end sendMsg
 76 
 77 
 78 -- 记录有效手机号
 79 on WritePhone(the_phone, file_name)
 80     set num to the length of the_phone
 81     if (num > 0) then
 82         set fileName to date string of (current date)
 83         set logFilePath to my current_folder_path() & "send/" & file_name
 84         set this_file to (POSIX file logFilePath as string)
 85         set this_story to the_phone & "
 86 "
 87         try
 88             set fp to open for access this_file
 89             set myText to read fp
 90             
 91             if (myText does not contain the_phone) then
 92                 my write_to_file(this_story, this_file, true, true)
 93             end if
 94         on error
 95             my write_to_file(this_story, this_file, true, true)
 96         end try
 97     end if
 98 end WritePhone
 99 
100 
101 -- 写入文件
102 on write_to_file(this_data, target_file, append_data, append_end)
103     try
104         set the target_file to the target_file as text
105         set the open_target_file to ¬
106             open for access file target_file with write permission
107         
108         if append_data is false then
109             set eof of the open_target_file to 0
110             write this_data to the open_target_file starting at eof
111         else if append_end is false then
112             try
113                 set fp to open for access target_file
114                 set myText to read fp
115                 set eof of the open_target_file to 0
116                 write this_data to the open_target_file starting at eof
117                 write myText to the open_target_file starting at eof
118             on error
119                 write this_data to the open_target_file starting at eof
120             end try
121         else
122             write this_data to the open_target_file starting at eof
123         end if
124         
125         close access the open_target_file
126         return target_file
127     on error
128         try
129             close access file target_file
130         end try
131         return false
132     end try
133 end write_to_file
134 
135 
136 -- 获取当前文件的父文件夹路径
137 on current_folder_path()
138     set UnixPath to POSIX path of ((path to me as text) & "::")
139     return UnixPath
140 end current_folder_path

1.Mac OS电脑版全自动无痕检测数据是否是imessages数据0.5-1秒检测一封,具体视网速和硬件性能而定,自动记录已开启im的数据和未开启的im的数据)

2.IOS苹果手机版全自动无痕检测数据是否imessages(全自动无痕检测用户导入的手机号或邮箱数据,自动记录已开启im的数据和未开启的im的数据)