Project

General

Profile

Actions

Issue #849

closed

Issues with "Encrypt phone"

Added by Anonymous about 10 years ago. Updated about 8 years ago.

Status:
Closed
Priority:
Normal
Category:
Framework
Target version:
Start date:
02/20/2014
Due date:
% Done:

0%

Estimated time:
Resolution:
fixed
Device:
Galaxy S 3 (I9300)
Grant:
Type of work:

Description

I have just tried Replicant (4.2) for the first time on my i9300 and in general it works wonderfully.

However I have noticed two problems after having used "Encrypt phone" via Settings:

1) In about 3 out of 4 boots there is no signal/imei and baseband version shows as unknown in Settings. In about 1 in 4 boots the baseband shows up fine and all is well. Remove encryption via a factory reset and the baseband shows up again 100% of the time every boot. This issue is apparent with basebands XXEMB5 and BUEMC2.

2) Once encryption is applied you cannot factory reset using Replicant's supplied recovery (cannot format /data ?). However reverting to stock recovery allows one to reset the phone just fine so no big deal here.

Please let me know if I can provide any further details/logs to help diagnose the issue(s). And thank you very much for Replicant.

Actions #1

Updated by Paul Kocialkowski about 10 years ago

1) I'll try to look into that, it doesn't seem like normal behavior, I'll need to check what's going on with the modem.
2) We use the CWM recovery as-is, so the issue is probably not specific to Replicant, but also present in CyanogenMod. Try to see if you can reproduce with the CM recoveries and report the error there.

Actions #2

Updated by Anonymous about 10 years ago

Hi. "Anonymous" here once more ;)

Regarding issue (2), I did find an alternative solution that does not require flashing a stock recovery image (which could be unobtainable I guess). It uses adb:

http://android.stackexchange.com/questions/33398/cannot-factory-reset-after-encrypting

Thanks again,

-Michael

Actions #3

Updated by Paul Kocialkowski about 10 years ago

Actually, 2. makes sense. On i9300, the internal sdcard is /data/media. Hence, when asking for factory reset, CWM actually only mounts /data and erases all the files except /data/media. Now since the partition is encrypted, it cannot mount it. The real solution would be to add support for mounting with encryption on CWM, or it should detect that it's encrypted and fully wipe it, but I doubt that's what the user wants in most cases. I suppose the original recovery just formats the partition without mounting it, hence erasing /data/media too.

Actions #4

Updated by Anonymous about 10 years ago

Thanks for your explanation, Paul. It makes perfect sense now I understand what it's doing :) -Michael

Actions #5

Updated by Paul Kocialkowski about 10 years ago

I tried to reproduce 1. with a Galaxy Nexus. I enabled encryption, and the modem worked just fine all the time. I rebooted 4 times. Please provide main and radio logs when the issue occurs: GettingLogs!

Actions #6

Updated by Michael . about 10 years ago

Hi. That's typical Murphy's law that all is fine on your Nexus! Sorry for not providing logs in my initial report. I freshly reinstalled Replicant just now with encryption on and booted up twice. No modem each time :( Here are the logs:

main: http://pastebin.com/4ujSgFvD
radio: http://pastebin.com/6qrmJxiz
Actions #7

Updated by Paul Kocialkowski about 10 years ago

Alright, I got it. What encryption does is that it apparently starts the system to be able to show the UI for decrypting, then kills it all to make it restart with /data decrypted. It also kills the software handling the modem which triggers a cold reboot. Apparently, your modem doesn't handle that too well as the boot procedure fails. All the attempts to bring to back up fail as well.
The timeouts in the code were select to match the ones from the proprietary RIL, but maybe they need to be a bit longer.
I'll try to make than happen for the next release.

This issue isn't actually directly related to the use of encryption by the way :)

Actions #8

Updated by Michael . about 10 years ago

That's great that you have figured out the likely cause. As a point of reference I have no problems with the same setup on CM10.1 or OmniRom. Currently using OmniRom as I can't live without the encryption - I have lost my phone through theft too often in the past not to use it. However, I appreciate that many people consider encryption a "luxury" feature and also that I may be the only one with this issue due to quirky hardware/firmware. Feel free to post any updated binaries here and I'll test them, otherwise I'll wait for the next release of Replicant :) :)

Actions #9

Updated by Jonas Fitz almost 10 years ago

[quote]I may be the only one with this issue due to quirky hardware/firmware.[/quote]

Nope, you're definitely not the only one. Same Problem here.
Are my logs helpful in solving the problem?

If so, I gonna try to extract them and post them.

Actions #10

Updated by Paul Kocialkowski almost 10 years ago

Yes it would be good to have them to check that it's the same problem happening. If your device hangs at the same point, I'll increase the delay in the code so that it can boot more reliably.

Actions #11

Updated by Jonas Fitz almost 10 years ago

Okay, now I installed ADB.
Started it using the "./adb logcat -b" command.
daemon started successfully at port 5037

Command line stuck at "waiting for device"

The i9300 is not recognized.
What shall I do?

I also tried aLogcat:
It produces the following error:
"W/Trace (3827): error opening trace file: no such file or directory."

Actions #12

Updated by Jonas Fitz almost 10 years ago

Ok, found out I had to activate USB Debugging.
However, can't find it in 4.2.

Actions #13

Updated by Jonathan Perry-Houts almost 10 years ago

My i9300 seems to have the same issue. I haven't tried to put a SIM card in it yet, but the IMEI is always "unknown" so i don't want to bother getting one until this issue is resolved. It's possible that I'm just being stupid and that's the expected behavior when the phone has no SIM, but that's not what I would expect.

Anyway, my main log (result of `adb logcat -d`) is here: http://pastebin.com/SHRVb1CC

Not sure how to get the radio log. Let me know if I need to post it, and how to get it.

Thanks, Paul, for your support!!!

Actions #14

Updated by Jonathan Perry-Houts almost 10 years ago

Oh, reading the adb manual helped. Here's my radio log as well:

http://pastebin.com/wN6GeMMv

Thanks again!!

Actions #15

Updated by Paul Kocialkowski almost 10 years ago

Apparently, you're having the same issue:

D/RIL     ( 2663): Creating IPC FMT client
D/RIL     ( 2663): Creating RIL client inners, try #1
D/RIL-IPC ( 2663): Creating new FMT client
D/RIL-IPC ( 2663): Setting log handler
D/RIL-IPC ( 2663): Creating data
D/RIL-IPC ( 2663): Starting bootstrap
D/RIL-IPC ( 2663): ipc: Starting i9300 modem bootstrap
D/RIL-IPC ( 2663): ipc: Opened modem image device
D/RIL-IPC ( 2663): ipc: Mapped modem image data to memory
D/RIL-IPC ( 2663): ipc: Opened modem boot device
D/RIL-IPC ( 2663): ipc: Opened modem link device
D/RIL-IPC ( 2663): ipc: Turned the modem off
D/RIL-IPC ( 2663): ipc: Turned the modem on
D/RIL-IPC ( 2663): ipc: Waited for link connected
D/RIL-IPC ( 2663): ipc: Wrote ATAT in ASCII
D/RIL-IPC ( 2663): ipc: Reading boot ACK failed
D/RIL-IPC ( 2663): ipc: Sending XMM6260 HSIC PSI failed
E/RIL-IPC ( 2663): Modem bootstrap failed
E/RIL     ( 2663): RIL client inners creation failed
D/RIL     ( 2663): Creating RIL client inners, try #2
D/RIL-IPC ( 2663): Creating new FMT client
D/RIL-IPC ( 2663): Setting log handler
D/RIL-IPC ( 2663): Creating data
D/RIL-IPC ( 2663): Starting bootstrap
D/RIL-IPC ( 2663): ipc: Starting i9300 modem bootstrap
D/RIL-IPC ( 2663): ipc: Opened modem image device
D/RIL-IPC ( 2663): ipc: Mapped modem image data to memory
D/RIL-IPC ( 2663): ipc: Opened modem boot device
D/RIL-IPC ( 2663): ipc: Opened modem link device
D/RIL-IPC ( 2663): ipc: Turned the modem off
D/RIL-IPC ( 2663): ipc: Turned the modem on
D/RIL-IPC ( 2663): ipc: Waited for link connected
D/RIL-IPC ( 2663): ipc: Wrote ATAT in ASCII
D/RIL-IPC ( 2663): ipc: Read chip id (0x16)
D/RIL-IPC ( 2663): ipc: Wrote PSI header
D/RIL-IPC ( 2663): ipc: Wrote PSI, CRC is 0xc8
D/RIL-IPC ( 2663): ipc: Wrote PSI CRC (0xc8)
D/RIL-IPC ( 2663): ipc: Reading PSI CRC ACK failed
D/RIL-IPC ( 2663): ipc: Sending XMM6260 HSIC PSI failed
E/RIL-IPC ( 2663): Modem bootstrap failed
E/RIL     ( 2663): RIL client inners creation failed
D/RIL     ( 2663): Creating RIL client inners, try #3

I'll try to look into it when I have some time.

Actions #16

Updated by Jonathan Perry-Houts almost 10 years ago

Thanks Paul!

Is this timeout a simple change? If so, I'd be happy to compile it and test out the hypothesis. I could be totally underestimating the complexity, but that sounds like a one-line change. Hopefully I'm not wrong. Thanks again!!!

Cheers,
Jonathan

Actions #17

Updated by Paul Kocialkowski almost 10 years ago

You're welcome to play with it: https://gitorious.org/replicant/external_libsamsung-ipc/source/7d789225fbfe14034b2fcc63dd1d1e92f5482dd2:samsung-ipc/device/xmm6260/xmm6260_hsic.c#L205-209

See which ones triggers the fail and perhaps try to increase XMM6260_HSIC_PSI_CRC_ACK_COUNT.

I can reproduce the issue on the Galaxy Note 2 N7100 (same model, same transport), by the way! I'll try to solve it too at some point in the future.

Actions #18

Updated by Paul Kocialkowski over 9 years ago

  • Status changed from New to Closed
  • Resolution set to fixed

This is fixed in the latest version of libsamsung-ipc and will be part of the next images release.

Actions #19

Updated by Denis 'GNUtoo' Carikli over 8 years ago

  • Category changed from 117 to Framework
  • Device Galaxy S 3 (I9300) added
Actions #20

Updated by Greg Farough about 8 years ago

I believe I have replicated this issue on i9100 and the latest image. Has libsamsung-ipc been updated there as well?

In any case, after encryption the baseband version is listed as "unknown" and the IMEI is missing. I'll try and pull logs as soon as I can.

Actions

Also available in: Atom PDF