Я сталкиваюсь с странным сбоем, который происходит только на устройствах Samsung, работающих на Android 15, в частности на модели Galaxy S21. К сожалению, у меня нет доступа к этому конкретному устройству, чтобы воспроизвести проблему. Я протестировал приложение на других моделях Samsung, таких как S23 и S24, оба запуска Android 15, но сбой не происходит на этих устройствах. < /P>
Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.length()' on a null object reference
at android.os.Parcel.createExceptionOrNull(Parcel.java:3263)
at android.os.Parcel.createException(Parcel.java:3241)
at android.os.Parcel.readException(Parcel.java:3224)
at android.os.Parcel.readException(Parcel.java:3166)
at com.android.internal.telephony.ISms$Stub$Proxy.sendTextForSubscriber(ISms.java:1954)
at android.telephony.SmsManager$1.onSuccess(SmsManager.java:772)
at android.telephony.SmsManager.sendResolverResult(SmsManager.java:1822)
at android.telephony.SmsManager.resolveSubscriptionForOperation(SmsManager.java:1783)
at android.telephony.SmsManager.sendTextMessageInternal(SmsManager.java:767)
at android.telephony.SmsManager.sendTextMessage(SmsManager.java:600)
at com.app.utils.DeviceBindingHelper.sendSMS$lambda$4(DeviceBindingHelper.kt:173)
< /code>
Inside DeviceBindingHelper.sendsms У меня есть следующий код < /p>
val sms = SmsManager.getSmsManagerForSubscriptionId(it[0].subscriptionId)
sms.sendTextMessage(phoneNumber, null, message, sentPI, deliveredPI)
Единственное значение null , которое я отправляю, - это scaddress , я перепроектировал phonenumber и значения сообщения Они не являются ни пустыми, ни нулевыми. Даже если один из них пуст, есть вторичная проверка внутри SendTextMessageInternal , который бросает allogalargumentException с допустимым сообщением.
private void sendTextMessageInternal(String destinationAddress, String scAddress,
String text, PendingIntent sentIntent, PendingIntent deliveryIntent,
boolean persistMessage, String packageName, String attributionTag, long messageId) {
if (TextUtils.isEmpty(destinationAddress)) {
throw new IllegalArgumentException("Invalid destinationAddress");
}
if (TextUtils.isEmpty(text)) {
throw new IllegalArgumentException("Invalid message body");
}
// We will only show the SMS disambiguation dialog in the case that the message is being
// persisted. This is for two reasons:
// 1) Messages that are not persisted are sent by carrier/OEM apps for a specific
// subscription and require special permissions. These messages are usually not sent by
// the device user and should not have an SMS disambiguation dialog associated with them
// because the device user did not trigger them.
// 2) The SMS disambiguation dialog ONLY checks to make sure that the user has the SEND_SMS
// permission. If we call resolveSubscriptionForOperation from a carrier/OEM app that has
// the correct MODIFY_PHONE_STATE or carrier permissions, but no SEND_SMS, it will throw
// an incorrect SecurityException.
if (persistMessage) {
resolveSubscriptionForOperation(new SubscriptionResolverResult() {
@Override
public void onSuccess(int subId) {
ISms iSms = getISmsServiceOrThrow();
try {
iSms.sendTextForSubscriber(subId, packageName, attributionTag,
destinationAddress, scAddress, text, sentIntent, deliveryIntent,
persistMessage, messageId);
} catch (RemoteException e) {
Log.e(TAG, "sendTextMessageInternal: Couldn't send SMS, exception - "
+ e.getMessage() + " " + formatCrossStackMessageId(messageId));
notifySmsError(sentIntent, RESULT_REMOTE_EXCEPTION);
}
}
@Override
public void onFailure() {
notifySmsError(sentIntent, RESULT_NO_DEFAULT_SMS_APP);
}
});
} else {
// Not persisting the message, used by sendTextMessageWithoutPersisting() and is not
// visible to the user.
ISms iSms = getISmsServiceOrThrow();
try {
iSms.sendTextForSubscriber(getSubscriptionId(), packageName, attributionTag,
destinationAddress, scAddress, text, sentIntent, deliveryIntent,
persistMessage, messageId);
} catch (RemoteException e) {
Log.e(TAG, "sendTextMessageInternal (no persist): Couldn't send SMS, exception - "
+ e.getMessage() + " " + formatCrossStackMessageId(messageId));
notifySmsError(sentIntent, RESULT_REMOTE_EXCEPTION);
}
}
}
Это полная SendTextForsUbsCriber inside smsmanager.java .
Это сбой связан с чем -то изменяющим>
Я сталкиваюсь с странным сбоем, который происходит только на устройствах Samsung, работающих на Android 15, в частности на модели Galaxy S21. К сожалению, у меня нет доступа к этому конкретному устройству, чтобы воспроизвести проблему. Я протестировал приложение на других моделях Samsung, таких как S23 и S24, оба запуска Android 15, но сбой не происходит на этих устройствах. < /P> [code]Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.length()' on a null object reference at android.os.Parcel.createExceptionOrNull(Parcel.java:3263) at android.os.Parcel.createException(Parcel.java:3241) at android.os.Parcel.readException(Parcel.java:3224) at android.os.Parcel.readException(Parcel.java:3166) at com.android.internal.telephony.ISms$Stub$Proxy.sendTextForSubscriber(ISms.java:1954) at android.telephony.SmsManager$1.onSuccess(SmsManager.java:772) at android.telephony.SmsManager.sendResolverResult(SmsManager.java:1822) at android.telephony.SmsManager.resolveSubscriptionForOperation(SmsManager.java:1783) at android.telephony.SmsManager.sendTextMessageInternal(SmsManager.java:767) at android.telephony.SmsManager.sendTextMessage(SmsManager.java:600) at com.app.utils.DeviceBindingHelper.sendSMS$lambda$4(DeviceBindingHelper.kt:173) < /code> Inside DeviceBindingHelper.sendsms У меня есть следующий код < /p> val sms = SmsManager.getSmsManagerForSubscriptionId(it[0].subscriptionId) sms.sendTextMessage(phoneNumber, null, message, sentPI, deliveredPI) [/code] Единственное значение null , которое я отправляю, - это scaddress , я перепроектировал phonenumber и значения сообщения Они не являются ни пустыми, ни нулевыми. Даже если один из них пуст, есть вторичная проверка внутри SendTextMessageInternal , который бросает allogalargumentException с допустимым сообщением. [code]private void sendTextMessageInternal(String destinationAddress, String scAddress, String text, PendingIntent sentIntent, PendingIntent deliveryIntent, boolean persistMessage, String packageName, String attributionTag, long messageId) { if (TextUtils.isEmpty(destinationAddress)) { throw new IllegalArgumentException("Invalid destinationAddress"); }
if (TextUtils.isEmpty(text)) { throw new IllegalArgumentException("Invalid message body"); }
// We will only show the SMS disambiguation dialog in the case that the message is being // persisted. This is for two reasons: // 1) Messages that are not persisted are sent by carrier/OEM apps for a specific // subscription and require special permissions. These messages are usually not sent by // the device user and should not have an SMS disambiguation dialog associated with them // because the device user did not trigger them. // 2) The SMS disambiguation dialog ONLY checks to make sure that the user has the SEND_SMS // permission. If we call resolveSubscriptionForOperation from a carrier/OEM app that has // the correct MODIFY_PHONE_STATE or carrier permissions, but no SEND_SMS, it will throw // an incorrect SecurityException. if (persistMessage) { resolveSubscriptionForOperation(new SubscriptionResolverResult() { @Override public void onSuccess(int subId) { ISms iSms = getISmsServiceOrThrow(); try { iSms.sendTextForSubscriber(subId, packageName, attributionTag, destinationAddress, scAddress, text, sentIntent, deliveryIntent, persistMessage, messageId); } catch (RemoteException e) { Log.e(TAG, "sendTextMessageInternal: Couldn't send SMS, exception - " + e.getMessage() + " " + formatCrossStackMessageId(messageId)); notifySmsError(sentIntent, RESULT_REMOTE_EXCEPTION); } }
@Override public void onFailure() { notifySmsError(sentIntent, RESULT_NO_DEFAULT_SMS_APP); } }); } else { // Not persisting the message, used by sendTextMessageWithoutPersisting() and is not // visible to the user. ISms iSms = getISmsServiceOrThrow(); try { iSms.sendTextForSubscriber(getSubscriptionId(), packageName, attributionTag, destinationAddress, scAddress, text, sentIntent, deliveryIntent, persistMessage, messageId); } catch (RemoteException e) { Log.e(TAG, "sendTextMessageInternal (no persist): Couldn't send SMS, exception - " + e.getMessage() + " " + formatCrossStackMessageId(messageId)); notifySmsError(sentIntent, RESULT_REMOTE_EXCEPTION); } } } [/code] Это полная SendTextForsUbsCriber inside smsmanager.java . Это сбой связан с чем -то изменяющим>
Я сталкиваюсь с странным сбоем, который происходит только на устройствах Samsung, работающих на Android 15, в частности на модели Galaxy S21. К сожалению, у меня нет доступа к этому конкретному устройству, чтобы воспроизвести проблему. Я...
У меня есть план на proxy.webshare.io , у меня есть прокси -список с 500 IP, и я пытаюсь сделать запрос Curl в php , но у меня есть ошибка:
curl ошибка: не удалось подключиться к 3x.xx.xx.xx. /> У меня когда -либо была эта ошибка, также если я...