signalapp / Signal-Android

A private messenger for Android.
https://signal.org
GNU Affero General Public License v3.0
25.62k stars 6.15k forks source link

TextSecure failure with Republic Wireless #646

Closed anon8675309 closed 10 years ago

anon8675309 commented 10 years ago

Phone: Motorola Defy XT O/S: Android 2.3.7 Provider: Republic Wireless Possibly related: my provider does not support MMS messages (at least not on my plan/model of phone).

Steps to reproduce: 1.) Send message to someone who has the latest version of TextSecure (as of 2/24/2014) 2.) Message was not encrypted 3.) Attempt to initiate secure session via the unlock icon 4.) Green speech bubble appears from the right with a key icon which says "Error sending message" 5.) Register phone number over cell data plan/SMS, failed 6.) Go home, turn on wifi, connect to AP, register phone number successfully 7.) Now secure testing works as expected

There are two reasons I don't like this: A.) I'd prefer to not be on a list of phone numbers that use TextSecure. I don't understand why such a list exists. B.) Since the new protocol doesn't appear to require SMS nor MMS, I would like to be able to use TextSecure via WiFi on a phone with no provider. If registration was not required, or if it were possible to register without providing a phone number and requiring that an SMS be sent/received, it seems like this would work fine. It'd be especially awesome if it would integrate with SIP/VoIP.

moxie0 commented 10 years ago

Can you provide adb logcat output from step 4? We need that information to determine why it's failing.

As for B, a server routes messages for users instead of the telco via SMS/MMS. You need to be registered with the server for it to be able to route messages to you, otherwise it doesn't know where to send them.

anon8675309 commented 10 years ago

Thanks for the explanation on why there's a central server. I trust you guys with metadata more than the telco, so I it's an improvement over SMS to be sure.

GitHub apparently doesn't attaching .txt files to bug reports. Lame. Well, here it is in comment form (sorry in advance for the formatting):

I/InputDispatcher( 192): event_report_payload event_id=431 length:5 pEvent->length=16 pEvent->event_id.event_id_field.payload_len=3 E/InputDispatcher( 192): Event_report_payload: Failed to write keypress event to kernel, error = 5 D/InputTransport( 192): channel '40749760 org.thoughtcrime.securesms/org.thoughtcrime.securesms.ConversationActivity (server)' publisher ~ publishMotionEvent: deviceId=65538, source=0x1002, action=0x1, flags=0x0, edgeFlags=0x0, metaState=0x0, xOffset=0.000000, yOffset=-287.000000, xPrecision=1.000000, yPrecision=1.000000, downTime=37463987121019, eventTime=37464060189330, pointerCount=1 V/ViewRoot( 5379): org.thoughtcrime.securesms/org.thoughtcrime.securesms.ConversationActivity got MotionEvent{407d37e0 action=1 x=147.0 y=255.0 pressure=1.0 size=0.0} D/PowerManagerService( 192): userActivity mLastEventTime=37463987 time=37464060 mUserActivityAllowed=true mUserState=0x3 mWakeLockState=0x0 mProximitySensorActive=false timeoutOverride=-1 force=false D/PowerManagerService( 192): setTimeoutLocked now=37464060 timeoutOverride=-1 nextState=3 when=37470060 W/MmsSmsDatabase( 5379): Executing query: SELECT _id, body, type, thread_id, address, address_device_id, subject, date_sent, date_received, m_type, msg_box, status, part_count, ct_l, tr_id, m_size, exp, st, transport_type FROM (SELECT DISTINCT date_sent * 1 AS date_sent, date * 1 AS date_received, _id, body, read, thread_id, type, address, address_device_id, subject, NULL AS m_type, NULL AS msg_box, status, NULL AS part_count, NULL AS ct_l, NULL AS tr_id, NULL AS m_size, NULL AS exp, NULL AS st, 'sms' AS transport_type FROM sms WHERE (thread_id = 2) UNION ALL SELECT DISTINCT date * 1000 AS date_sent, date_received * 1000 AS date_received, _id, body, read, thread_id, NULL AS type, address, address_device_id, NULL AS subject, m_type, msg_box, NULL AS status, part_count, ct_l, tr_id, m_size, exp, st, 'mms' AS transport_type FROM mms WHERE (thread_id = 2) ORDER BY date_received DESC) LIMIT 1 W/SMSSender( 5379): Got message id for new message: 309 V/WindowManager( 192): Desired input method target=Window{40bba4d8 org.thoughtcrime.securesms/org.thoughtcrime.securesms.ConversationActivity paused=false} willMove=false W/SmsSender( 5379): Sending message: 309 W/MessageDatabase( 5379): Updating ID: 309 to base type: 22 W/MmsSmsDatabase( 5379): Executing query: SELECT _id, body, type, thread_id, address, address_device_id, subject, date_sent, date_received, m_type, msg_box, status, part_count, ct_l, tr_id, m_size, exp, st, transport_type FROM (SELECT DISTINCT date_sent * 1 AS date_sent, date * 1 AS date_received, _id, body, read, thread_id, type, address, address_device_id, subject, NULL AS m_type, NULL AS msg_box, status, NULL AS part_count, NULL AS ct_l, NULL AS tr_id, NULL AS m_size, NULL AS exp, NULL AS st, 'sms' AS transport_type FROM sms WHERE (thread_id = 2) UNION ALL SELECT DISTINCT date * 1000 AS date_sent, date_received * 1000 AS date_received, _id, body, read, thread_id, NULL AS type, address, address_device_id, NULL AS subject, m_type, msg_box, NULL AS status, part_count, ct_l, tr_id, m_size, exp, st, 'mms' AS transport_type FROM mms WHERE (thread_id = 2) ORDER BY date_received DESC) LIMIT 1 W/SmsTransportDetails( 5379): Padding message body out to: 60 W/SmsTransportDetails( 5379): Encoded Message Length: 147 D/InputQueue( 5379): Unregistering input channel '40749760 org.thoughtcrime.securesms/org.thoughtcrime.securesms.ConversationActivity (client)' V/WindowManager( 192): Found focus @ 5 = Window{40bba4d8 org.thoughtcrime.securesms/org.thoughtcrime.securesms.ConversationActivity paused=false} V/WindowManager( 192): Desired input method target=Window{40bba4d8 org.thoughtcrime.securesms/org.thoughtcrime.securesms.ConversationActivity paused=false} willMove=true D/WindowManager( 192): Input focus has changed to Window{40bba4d8 org.thoughtcrime.securesms/org.thoughtcrime.securesms.ConversationActivity paused=false} W/org.thoughtcrime.securesms.sms.MultipartSmsTransportMessage( 5379): Complete fragment size: 152 W/SmsTransport( 5379): Secure divide into message parts: 1 E/JPK ( 293): encode 1 E/JPK ( 293): encode failed with exception E/JPK ( 293): com.android.internal.telephony.cdma.sms.BearerData$CodingException: encoded user data too large (143 > 140 bytes) E/JPK ( 293): at com.android.internal.telephony.cdma.sms.BearerData.encodeUserData(BearerData.java:651) E/JPK ( 293): at com.android.internal.telephony.cdma.sms.BearerData.encode(BearerData.java:835) E/JPK ( 293): at com.android.internal.telephony.cdma.SmsMessage.privateGetSubmitPdu(SmsMessage.java:1126) E/JPK ( 293): at com.android.internal.telephony.cdma.SmsMessage.getSubmitPdu(SmsMessage.java:407) E/JPK ( 293): at com.android.internal.telephony.CdmaSMSDispatcher.sendText(CdmaSMSDispatcher.java:461) E/JPK ( 293): at com.android.internal.telephony.ImsSMSDispatcher.sendText(ImsSMSDispatcher.java:214) E/JPK ( 293): at com.android.internal.telephony.IccSmsInterfaceManager.sendText(IccSmsInterfaceManager.java:378) E/JPK ( 293): at com.android.internal.telephony.MSimIccSmsInterfaceManager.sendTextOnSubscription(MSimIccSmsInterfaceManager.java:129) E/JPK ( 293): at com.android.internal.telephony.ISms$Stub.onTransact(ISms.java:248) E/JPK ( 293): at android.os.Binder.execTransact(Binder.java:320) E/JPK ( 293): at dalvik.system.NativeStart.run(Native Method) E/JPK ( 293): exiting encode NULL E/JPK ( 293): MO (encoded) BearerData = BearerData { messageType=2, messageId=146, priority=unset, privacy=unset, alert=unset, displayMode=unset, language=unset, errorClass=unset, msgStatus=unset, msgCenterTimeStamp=unset, validityPeriodAbsolute=unset, validityPeriodRelative=unset, deferredDeliveryTimeAbsolute=unset, deferredDeliveryTimeRelative=unset, userAckReq=false, deliveryAckReq=true, readAckReq=false, reportReq=false, numberOfMessages=0, callbackNumber=null, depositIndex=0, hasUserDataHeader=false, userData=UserData { msgEncoding=2, msgType=0, paddingBits=0, numFields=163, userDataHeader=null, payload='6CC583462DDB346ED7E63E5DD849CF165C9A359BCFDDBE3AF695395A73E19C9D3AACEBA1C186FD50AB74E2C21339B07A78AFCF0E1D7E734FD1061C783074D09CD766D950FAC39B371CAA10727692AD7C8E956368DFBA5EF619FB50D352CD39712BCA578A1D063A25AFE8C7B78ADAEB46A7460DA8F964F685BE5489F32A699BD615A6D52934F12EC51ECD394889C980', payloadStr='[REDACTED]|crw0IgEKIQV7OnoG/4TrZ9x3IijYkPp0ojBVtq0B3MAtxWsaakyfOhACGAAiPN5lmJCuCMMcJPAdvI+/HtUFhonKo0gvPiTYSKDWJ+bCP1hK/t1vxVkVFSQAZGeIvBoJHOLTiMuBZ6TR4xKXQv4rHDr0' } } W/SmsTransport( 5379): java.lang.NullPointerException W/SmsTransport( 5379): at android.os.Parcel.readException(Parcel.java:1328) W/SmsTransport( 5379): at android.os.Parcel.readException(Parcel.java:1276) W/SmsTransport( 5379): at com.android.internal.telephony.ISms$Stub$Proxy.sendTextOnSubscription(ISms.java:820) W/SmsTransport( 5379): at android.telephony.SmsManager.sendTextMessage(SmsManager.java:136) W/SmsTransport( 5379): at android.telephony.SmsManager.sendTextMessage(SmsManager.java:86) W/SmsTransport( 5379): at org.thoughtcrime.securesms.transport.SmsTransport.deliverSecureMessage(SmsTransport.java:85) W/SmsTransport( 5379): at org.thoughtcrime.securesms.transport.SmsTransport.deliver(SmsTransport.java:58) W/SmsTransport( 5379): at org.thoughtcrime.securesms.transport.UniversalTransport.deliver(UniversalTransport.java:66) W/SmsTransport( 5379): at org.thoughtcrime.securesms.service.SmsSender.handleSendMessage(SmsSender.java:86) W/SmsTransport( 5379): at org.thoughtcrime.securesms.service.SmsSender.process(SmsSender.java:60) W/SmsTransport( 5379): at org.thoughtcrime.securesms.service.SendReceiveService$SendReceiveWorkItem.run(SendReceiveService.java:247) W/SmsTransport( 5379): at org.thoughtcrime.securesms.util.WorkerThread.run(WorkerThread.java:46) W/SmsTransport( 5379): Recipient: [REDACTED] W/SmsTransport( 5379): Message Total Parts/Current: 1/0 W/SmsTransport( 5379): Message Part Length: 152 W/SmsSender( 5379): org.thoughtcrime.securesms.transport.UndeliverableMessageException: java.lang.NullPointerException W/SmsSender( 5379): at org.thoughtcrime.securesms.transport.SmsTransport.deliverSecureMessage(SmsTransport.java:93) W/SmsSender( 5379): at org.thoughtcrime.securesms.transport.SmsTransport.deliver(SmsTransport.java:58) W/SmsSender( 5379): at org.thoughtcrime.securesms.transport.UniversalTransport.deliver(UniversalTransport.java:66) W/SmsSender( 5379): at org.thoughtcrime.securesms.service.SmsSender.handleSendMessage(SmsSender.java:86) W/SmsSender( 5379): at org.thoughtcrime.securesms.service.SmsSender.process(SmsSender.java:60) W/SmsSender( 5379): at org.thoughtcrime.securesms.service.SendReceiveService$SendReceiveWorkItem.run(SendReceiveService.java:247) W/SmsSender( 5379): at org.thoughtcrime.securesms.util.WorkerThread.run(WorkerThread.java:46) W/SmsSender( 5379): Caused by: java.lang.NullPointerException W/SmsSender( 5379): at android.os.Parcel.readException(Parcel.java:1328) W/SmsSender( 5379): at android.os.Parcel.readException(Parcel.java:1276) W/SmsSender( 5379): at com.android.internal.telephony.ISms$Stub$Proxy.sendTextOnSubscription(ISms.java:820) W/SmsSender( 5379): at android.telephony.SmsManager.sendTextMessage(SmsManager.java:136) W/SmsSender( 5379): at android.telephony.SmsManager.sendTextMessage(SmsManager.java:86) W/SmsSender( 5379): at org.thoughtcrime.securesms.transport.SmsTransport.deliverSecureMessage(SmsTransport.java:85) W/SmsSender( 5379): ... 6 more W/MessageDatabase( 5379): Updating ID: 309 to base type: 24 W/MmsSmsDatabase( 5379): Executing query: SELECT _id, body, type, thread_id, address, address_device_id, subject, date_sent, date_received, m_type, msg_box, status, part_count, ct_l, tr_id, m_size, exp, st, transport_type FROM (SELECT DISTINCT date_sent * 1 AS date_sent, date * 1 AS date_received, _id, body, read, thread_id, type, address, address_device_id, subject, NULL AS m_type, NULL AS msg_box, status, NULL AS part_count, NULL AS ct_l, NULL AS tr_id, NULL AS m_size, NULL AS exp, NULL AS st, 'sms' AS transport_type FROM sms WHERE (thread_id = 2) UNION ALL SELECT DISTINCT date * 1000 AS date_sent, date_received * 1000 AS date_received, _id, body, read, thread_id, NULL AS type, address, address_device_id, NULL AS subject, m_type, msg_box, NULL AS status, part_count, ct_l, tr_id, m_size, exp, st, 'mms' AS transport_type FROM mms WHERE (thread_id = 2) ORDER BY date_received DESC) LIMIT 1 W/InputManagerService( 192): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@4096a9a8 I/ONCRPC ( 161): rpc_handle_rpc_call: for Xid: 4924, Prog: 31000000, Vers: fc37ad5c, Proc: 00000012 D/ServiceStateTracker( 293): signalStrength = 99, rssi = 255 I/ONCRPC ( 161): rpc_handle_rpc_call: Find Status: 0 Xid: 4924 I/ONCRPC ( 161): oncrpc_proxy_handle_cmd_rpc_call: Dispatching xid: 4924 D/dalvikvm( 6095): GC_EXPLICIT freed 695K, 43% free 7990K/13959K, external 5544K/6924K, paused 78ms I/ONCRPC ( 161): rpc_handle_rpc_call: for Xid: 4926, Prog: 31000000, Vers: fc37ad5c, Proc: 00000012 I/ONCRPC ( 161): rpc_handle_rpc_call: Find Status: 0 Xid: 4926 D/ServiceStateTracker( 293): signalStrength = 99, rssi = 255 I/ONCRPC ( 161): oncrpc_proxy_handle_cmd_rpc_call: Dispatching xid: 4926

moxie0 commented 10 years ago

Strange, does your service provider limit your SMS length to 140 characters?

moxie0 commented 10 years ago

Oh, republic wireless! This isn't going to work, republic wireless isn't actually using SMS. The only way you could use TextSecure with republic wireless is over push.

anon8675309 commented 10 years ago

It appears that they do, in a sense[1]. There are others complaining about incoming messages which are 141-160 bytes being chunked into two 140 characters message and being delivered out of order. I've personally seen the problem of out-of-order messages, but I never made the connection of them being long messages.

Between the aforementioned thread, and the CodingException "encoded user data too large (143 > 140 bytes)" exception, it sounds like that's exactly the problem. I also find it intriguing that it said "Encoded Message Length: 147" just before failing to send a 143 byte message. I mean, I understand they are both >140, but what happened to those 4 bytes?

[1] https://community.republicwireless.com/thread/1753