Update v9.3.0: Enhanced Security with Telegram Integration
- Incremented version to 9.3.0 (versionCode: 93000) - Added Telegram integration for device notifications - Implemented token-based verification system - Enhanced device registry with IP/country detection - Added split token verification for admin/user validation - Improved dashboard with real-time notifications - Enhanced blocking system with token verification - Added geo-location tracking for devices - Improved device management interface - Enhanced security controls and monitoring 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -31,7 +31,7 @@ public class DeviceRegistry {
|
||||
public interface Callback {
|
||||
void onAllowed();
|
||||
|
||||
void onBlocked(String reason);
|
||||
void onBlocked(String reason, String tokenPart);
|
||||
|
||||
void onError(String message);
|
||||
}
|
||||
@@ -82,14 +82,21 @@ public class DeviceRegistry {
|
||||
}
|
||||
String responseText = response.body().string();
|
||||
JSONObject json = new JSONObject(responseText);
|
||||
boolean blocked = json.optBoolean("blocked", false);
|
||||
JSONObject deviceJson = json.optJSONObject("device");
|
||||
JSONObject verificationJson = json.optJSONObject("verification");
|
||||
boolean blocked = json.optBoolean("blocked", false);
|
||||
String reason = json.optString("message");
|
||||
if (TextUtils.isEmpty(reason) && deviceJson != null) {
|
||||
reason = deviceJson.optString("notes", "");
|
||||
}
|
||||
String tokenPart = "";
|
||||
if (verificationJson != null) {
|
||||
boolean verificationRequired = verificationJson.optBoolean("required", false);
|
||||
blocked = blocked || verificationRequired;
|
||||
tokenPart = verificationJson.optString("clientTokenPart", "");
|
||||
}
|
||||
if (blocked) {
|
||||
postBlocked(callback, reason);
|
||||
postBlocked(callback, reason, tokenPart);
|
||||
} else {
|
||||
postAllowed(callback);
|
||||
}
|
||||
@@ -139,11 +146,13 @@ public class DeviceRegistry {
|
||||
mainHandler.post(callback::onAllowed);
|
||||
}
|
||||
|
||||
private void postBlocked(Callback callback, String reason) {
|
||||
private void postBlocked(Callback callback, String reason, String tokenPart) {
|
||||
if (callback == null) {
|
||||
return;
|
||||
}
|
||||
mainHandler.post(() -> callback.onBlocked(reason));
|
||||
String reasonText = reason == null ? "" : reason;
|
||||
String token = tokenPart == null ? "" : tokenPart;
|
||||
mainHandler.post(() -> callback.onBlocked(reasonText, token));
|
||||
}
|
||||
|
||||
private void postError(Callback callback, String message) {
|
||||
|
||||
Reference in New Issue
Block a user