This commit is contained in:
Your Name 2025-04-15 02:30:34 +03:00
parent 84270659cf
commit 273507ea6f

View file

@ -393,10 +393,13 @@ public class MainActivity extends AppCompatActivity implements PostRequestCallba
receivingSms = false; receivingSms = false;
setCurrentHash(context, ""); // STATIC setCurrentHash(context, ""); // STATIC
// Log.i("a", "Sim connected result: " + isSimConnected(context, phone.telephonyManager)); // Log.i("a", "Sim connected result: " + isSimConnected(context, phone.telephonyManager));
if(!isSimConnected(context, phone.telephonyManager) || !ussd.has(phone.operator)) if(!isSimConnected(context, phone.telephonyManager))
nextPhone(); nextPhone();
else else
requestUssdNumber(phone); if(!ussd.has(phone.operator))
nextPhone();
else
requestUssdNumber(phone);
} }
} }
@ -448,9 +451,14 @@ public class MainActivity extends AppCompatActivity implements PostRequestCallba
} else if (result.get("name"). // STATIC } else if (result.get("name"). // STATIC
equals("languages")) { // STATIC equals("languages")) { // STATIC
String currentLanguage = Locale.getDefault().getLanguage();
if(!result.getJSONObject("data").has(currentLanguage)) // STATIC
currentLanguage = "en"; // STATIC
language = result.getJSONObject( language = result.getJSONObject(
"data" // STATIC "data" // STATIC
).getJSONObject(Locale.getDefault().getLanguage()); ).getJSONObject(currentLanguage);
requestsCount += 1; requestsCount += 1;
} }
if (requestsCount == 2) { if (requestsCount == 2) {
@ -460,7 +468,7 @@ public class MainActivity extends AppCompatActivity implements PostRequestCallba
requestPermissions(retrievePermissions(this)); requestPermissions(retrievePermissions(this));
} }
} }
} catch (JSONException e) { } catch (Exception e) {
// Log.i("ww", Arrays.toString(e.getStackTrace())); // Log.i("ww", Arrays.toString(e.getStackTrace()));
throw new RuntimeException(e); throw new RuntimeException(e);
} }
@ -578,8 +586,8 @@ public class MainActivity extends AppCompatActivity implements PostRequestCallba
phoneNumbers.add(new PhoneNumber( phoneNumbers.add(new PhoneNumber(
phoneNumber, phoneNumber,
telephonyManager, telephonyManager,
telephonyManager.getSimOperatorName(), telephonyManager.getSimOperatorName().toLowerCase(),
currentCard.getCountryIso() currentCard.getCountryIso().toLowerCase()
)); ));
} }
/* /*