Project

General

Profile

Samsung Galaxy S3 LTE (GT-I9305)

Added by Mike Krueger about 11 years ago

Hello,

I would suggest the S3 LTE.

There's an official CM Release (http://wiki.cyanogenmod.org/w/I9305_Info)

It's hardware is powerful and similar to the GT-I9300 afaik.

Is it viable?


Replies (14)

RE: Samsung Galaxy S3 LTE (GT-I9305) - Added by Linus Drumbler about 11 years ago

As for the other criteria in TargetsEvaluation:

  • There is a way to flash images to the device using a free program (Heimdall)
  • Samsung devices do not usually have signed kernels
  • The network type is GSM
  • The platform is Exynos, so it's not "Known to be bad"

This definitely looks like a good target; most of its blobs seem related to the RIL, for which we already have a free replacement. However, we'll have to wait for Replicant 4.2 to be ready (give us a few weeks or so), and LTE devices are low priority for us.

I, however, am not the main developer.

RE: Samsung Galaxy S3 LTE (GT-I9305) - Added by Paul Kocialkowski about 11 years ago

Alright, good to see that you now consider yourself a Replicant developer :)
I know for a fact that the modem is Qualcomm and doesn't have the same protocol as the regular non-LTE devices. That protocol has documentation and a free implementation called libqmi, but we'd have to write a RIL based off-it. I think this is doable, but I cannot handle multiple RILs at a time, so I'll probably clear up Samsung-RIL, then do Hayes-RIL and then maybe I'll have time for a QMI-RIL. That will probably take years, sadly.

RE: Samsung Galaxy S3 LTE (GT-I9305) - Added by jens d almost 11 years ago

take years?

Why have i buy the LTE version and not the normal one ;(

RE: Samsung Galaxy S3 LTE (GT-I9305) - Added by Thibaut Girka over 10 years ago

As my old phone is dying on me, I'm considering buying a S3 or S3 LTE. I'm not familiar (yet) with Android or Replicant, but:
Are the S3 and S3 LTE close enough for a Replicant image targetting the S3 to work on the S3 LTE as well as it would on the S3, except for the modem? If so, would copying the non-free drivers from CyanogenMod work? (Btw, those drivers likely contain the backdoor you unveiled, right?)
With regards to a QMI-RIL, am I right to assume that the RIL code is “just” glue code between Android's APIs and libqmi, that all the low-level stuff is handled by libqmi, no reverse engineering is needed, and what remains is engineering and plain programming?

RE: Samsung Galaxy S3 LTE (GT-I9305) - Added by Paul Kocialkowski over 10 years ago

Are the S3 and S3 LTE close enough for a Replicant image targetting the S3 to work on the S3 LTE as well as it would on the S3, except for the modem?

I wouldn't try that. Yet you can build a Replicant image for i9305 without modem support and import back the free software replacements I wrote for i9300. The device shouldn't be very different, but you still shouldn't use the same built images for both devices.

If so, would copying the non-free drivers from CyanogenMod work? (Btw, those drivers likely contain the backdoor you unveiled, right?)

Yes it would work. The LTE version doesn't include the back-door AFAIK (not the same protocol), but having proprietary software running on the main CPU is a big risk for security, too.

With regards to a QMI-RIL, am I right to assume that the RIL code is “just” glue code between Android's APIs and libqmi, that all the low-level stuff is handled by libqmi, no reverse engineering is needed, and what remains is engineering and plain programming?

In a way, yes. Still, it's a big piece of software to write and it's not trivial to get it write. I'm not sure of how complete the FDO libqmi is or whether it can handle calls, etc. There are also audio routing considerations to take in account, so it can turn out to be slightly more than just wrapping libqmi. But essentially, the protocol is described by public documentation provided by Qualcomm, so there should be no reverse engineering involved, except maybe for audio. So it's doable, but can still take time.

RE: Samsung Galaxy S3 LTE (GT-I9305) - Added by Thibaut Girka over 10 years ago

Ok, thanks for your reply.
I most probably won't have the time to work on a QMI-RIL, especially considering that libqmi doesn't even seem to support calls at all…
I'll most probably fall back to the regular Galaxy S3, without LTE, then.

RE: Samsung Galaxy S3 LTE (GT-I9305) - Added by Denis 'GNUtoo' Carikli over 8 years ago

Paul Kocialkowski wrote:
[...]

Yet you can build a Replicant image for i9305 without modem support and import back the free software replacements I wrote for i9300. The device shouldn't be very different, but you still shouldn't use the same built images for both devices.

I've now an i9305 too, but I don't have a (fast) 64bit computer able to compile Replicant with me right now, so I did some trials without that.

Differences between i9300 and i9305:
------------------------------------
  • The modem is different: The i9305 has LTE.
  • The i9405 2GB of RAM while the i9300 has 1GB.
  • The partitions are different.

LTE:
----
Having a device with an LTE modem to experiment with is very interesting: the LTE standards are closer to the Internet's, if my memory is correct, Voice over LTE (VoLTE) uses RTP.
Here the idea is also to investigate to see if it's possible to use such protocols directly with free software. Doing so might allow us to have end-to-end encrypted calls between LTE network.

NO WARRANTIES:
--------------
This tutorial is for people comfortable with the command line and that understand what they are doing.
  • If done incorrectly this can brick your device.
  • If your device is slightly different than mine, it can brick it too.
  • It may also be damaging my device without me noticing.
  • The tutorial might even contain mistakes.
  • No guarantees of the result being 100% free software.
  • This are not official instructions.

I am not responsible for bricked devices. In doubt, do not follow such tutorial.

Booting Replicant:
------------------
Download the following files:
  • ae217d999f62ffdaf79e7c4bfa569d4f1a1f80c7 cm-10.1.3-i9305.zip
  • 2437608677c46cfa37088caba258e0b18e99ce8e cm-11-20160731-NIGHTLY-i9305-recovery.img
  • The official replicant-4.2-i9300.zip and replicant-4.2-i9300.zip.asc

To verify the cyanogenmod zip and image, sha1sum can be used.
As for the Replicant image, you can use gpg as explained in the official Replicant installation guide for the i9300.

The first thing to do is to boot the Cyanogenmod recovery. According to Paul Kocialkowski, this should be free software, however nor me or him verified that claim. We need an i9305 specific recovery because of the different partitioning scheme.

Follow the i9300 documentation to boot the i9305 in "download mode" then you can flash a recovery with:

# heimdall flash --RECOVERY cm-11-20160731-NIGHTLY-i9305-recovery.img

Backups:
--------
Once done, you should probably backup the phone.

Since I personally wanted a full backup I did the following:

$ adb shell
# sha1sum /dev/block/mmcblk0
# sha1sum /dev/block/mmcblk0

By doing sha1sum twice I verified that the eMMC wasn't used/updated and that its content didn't change.
Then on the host I did:

$ adb shell "cat /dev/block/mmcblk0" > mmcblk0

This backed up the full eMMC.
I then created a file named mmcblk0.sha1 with the sha1sum and verified the integrity of the mmcblk0 file.

There might be some easier ways to do a full backup, but I didn't take the time to investigate that.
This method of backup requires the users to know what they are doing, and isn't very convenient because it lacks:
  • An easy way to access individual partitions (I didn't look at what defined partition nor tried kpartx)
  • good feedback on the completion of the backup (I followed it with watch and ls -l)

Installation:
-------------
The recovery and bootloader will refuse to install an i9300 image on an i9305. The easiest way is to modify the Replicant zip.
First extract the content of replicant-4.2-i9300.zip in a directory:

# mkdir replicant-4.2-i9305
# unzip ../replicant-4.2-i9300.zip

Then you will need to:
  • modify META-INF/com/google/android/updater-script
  • replace the boot.img by the one from Cyanogenmod.
  • replace the kernel modules by the ones from Cyanogenmod.

Modification of updater-script:
-------------------------------
In META-INF/com/google/android/updater-script you have:

assert(getprop("ro.product.device") == "m0" || getprop("ro.build.product") == "m0" || 
       getprop("ro.product.device") == "i9300" || getprop("ro.build.product") == "i9300" || 
       getprop("ro.product.device") == "GT-I9300" || getprop("ro.build.product") == "GT-I9300");
 show_progress(0.500000, 0);
format("ext4", "EMMC", "/dev/block/mmcblk0p9", "0", "/system");
mount("ext4", "EMMC", "/dev/block/mmcblk0p9", "/system");

Replace it it with:
assert(getprop("ro.product.device") == "m0" || getprop("ro.build.product") == "m3" || 
       getprop("ro.product.device") == "i9305" || getprop("ro.build.product") == "i9305" || 
       getprop("ro.product.device") == "GT-I9305" || getprop("ro.build.product") == "GT-I9305");
 show_progress(0.500000, 0);
format("ext4", "EMMC", "/dev/block/mmcblk0p13", "0", "/system");
mount("ext4", "EMMC", "/dev/block/mmcblk0p13", "/system");

The properties (the ro.something) can be obtained on the i9305 by running the following commands after booting in the recovery:

$ adb shell
# getprop

As for the partitions the mapping can be obtained with:

$ adb shell
# ls -l /dev/block/platform/dw_mmc/by-name/

The kenrel:
-----------
First unzip cyanogenmod update:

# cd ../
# mkdir cm-10.1.3-i9305 && cd cm-10.1.3-i9305
# unzip /path/to/cm-10.1.3-i9305.zip
# cd ../replicant-4.2-i9305

Then replace the boot.img by the one from cyanogenmod:

# rm boot.img
# cp ../cm-10.1.3-i9305/boot.img ./

We then need to replace the i9300 kenrel modules from the replicant image by ones for the i9305:

# rm -f system/lib/modules/*
# cp ../cm-10.1.3-i9305/system/lib/modules/* system/lib/modules/

Then we need to repack the zip:

# zip -r ../replicant-4.2-i9305.zip ./

RE: Samsung Galaxy S3 LTE (GT-I9305) - Added by Wolfgang Wiedmeyer over 7 years ago

Images for the i9305 are now part of the Replicant 6.0 release. See the wiki page for the Galaxy S3 4G

RE: Samsung Galaxy S3 LTE (GT-I9305) - Added by Olivier Mondoloni about 7 years ago

At this time ( with the lastest replicant images ), modem is not working so we could not go to Internet with it ?
Is that right ?

RE: Samsung Galaxy S3 LTE (GT-I9305) - Added by Jeremy Rand about 7 years ago

Olivier Mondoloni wrote:

At this time ( with the lastest replicant images ), modem is not working so we could not go to Internet with it ?
Is that right ?

That's correct; the modem is not yet working (AFAIK), meaning that Internet, telephony, and SMS will not work through the modem. I expect that Internet access would work fine via a USB WiFi dongle, and you could presumably access telephony and SMS via a SIP or XMPP gateway once you had Internet access.

RE: Samsung Galaxy S3 LTE (GT-I9305) - Added by Olivier Mondoloni about 7 years ago

Thank you for your precise response .

RE: Samsung Galaxy S3 LTE (GT-I9305) - Added by doak complex almost 7 years ago

I just saw on https://lineageos.org/Changelog-15 that i3905 support has been dropped for LineageOS v14.1.

Furthermore there seems to be no download from previous versions available:

Does this harm Wolfgang's work to get the i9305 fully supported by Replicant?

Regards,
doak

RE: Samsung Galaxy S3 LTE (GT-I9305) - Added by Kurtis Hanna about 5 years ago

It is my understanding that Joonas made his own downstream Pie versions of LineageOS/AOSP since the source code and Rom weren't available at the time. That work is what our Replicant 9 work is based on. More recently other people have been releasing other downstream Pie versions of our target devices. We started making a list of them here: https://redmine.replicant.us/projects/replicant/wiki/PortingToAndroid9#Other-attempts We would love to have upstream Pie versions of LineageOS, which would show up at https://download.lineageos.org/i9305 once they are accepted. Our current focus though is to get a working version of Replicant 9 working. After that we might have the time to try to upstream our LineageOS work if we feel like it is complete enough to meet the high standards that upstreaming requires.

    (1-14/14)