Applescript成功實現imessage資料篩選,imessage藍號檢測,無痕檢測是否註冊imessage的原理

dkblog發表於2024-06-21

一、imessages資料檢測的兩種方式:
1.人工篩選,將要驗證的號碼輸出到檔案中,以逗號分隔。再將檔案中的號碼貼上到iMessage客戶端的位址列,iMessage客戶端會自動逐個檢驗該號碼是否為iMessage賬號,檢驗速度視網速而定。紅色表示不是iMessage賬號,藍色表示iMessage賬號。
2.編寫蘋果Mac Os作業系統下的指令碼程式進行過濾(全自動無痕檢測,無需人工干預),將資料輸入到號碼文字框之後,如果捕獲到失敗的異常則不是iMessage賬號,捕獲到成功則把資料儲存下來。
3.升級版相關參考博文首頁相關文章: https://www.cnblogs.com/ap16633/

二、實現全自動無痕檢測資料是否啟用或開通imessages
電腦版全自動無痕檢測手機號是否註冊iMessage(注意:檢測不同國家手機號需要在手機號的字首 +國家程式碼即可,自動無痕檢測匯入的txt資料,藍色的手機號資料自動儲存,有償提供系統執行環境+檢測程式或原始碼,有意可聯絡:@mac66166 )
全自動無痕檢測手機或郵箱號是否註冊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.2-0.5秒檢測一封,具體視網速和硬體效能而定,自動記錄已開啟im的資料和未開啟的im的資料)

2.蘋果手機版(ios系統)全自動無痕檢測資料是否imessages(全自動無痕檢測使用者匯入的手機號或郵箱資料,自動記錄已開啟im的資料和未開啟的im的資料)

相關文章