Forums » Replicant development »
Replicant 6.0 for the Samsung Galaxy S3
Added by Wolfgang Wiedmeyer almost 9 years ago
This post contains outdated information and links to outdated images. See the wiki and blog for development updates, up-to-date documentation and current images!
See the archived post for documentation about my initial work and findings
See this post for the Galaxy S2
Changelog of the latest version (replicant-6.0-beta-0001 from 27.1.17)¶
- Added support for external WiFi dongles that use the AR9271 chipset
Makes it possible to use WiFi with only free software as free firmware exists for the chip - January security updates for the kernel
Changelog of the sixth alpha release (replicant-6.0-alpha-0006 from 6.1.17)¶
Only the most relevant changes are listed.
- Fixed sending of longer SMS messages
- Fixed entering the SIM lock PIN
Previously, if the PIN was entered incorrectly once, every subsequent try failed, even if the PIN was correct. - Fixed network operator recognition in countries that have MNC codes with three digits (e.g. U.S., Canada, India)
- Removed the nonfree unrar tool
- Synced the source code with the latest changes from CyanogenMod, including security fixes from December 2016 and performance improvements for the Galaxy S3
- Made it possible to update the F-Droid app itself
- Added the F-Droid privileged extension
This makes automatic background updates of apps possible (needs to be enabled in the settings). - Fixed camera app freezes by restarting the camera and redoing the snapshot if the shutter button is pressed a second time
- Made barcode scanning (including QR codes) work
See Tips section below - Reduced the camera preview resolution to speed up the preview a little bit
- Moved the build system from Debian Jessie to Debian Stretch and fixed various build errors
This allows to use the manifest merger tool and the Eclipse Java compiler from Debian. - Added the possibility to enable llvmpipe as software renderer by making it buildable for ARM
See the Tips section below - Applied various performance improvements and fixes for graphics rendering, mostly from the Android-x86 project
- Ported various security/privacy enhancements from the CopperheadOS project
This includes the possibility to set an encryption password that is different from the lock screen pin/password.
The phone will reboot if the PIN was entered incorrectly more than four times.
Some privacy enhancements for the browser - Added a new wallpaper to the Replicant wallpapers
Tips¶
Enabling llvmpipe as software renderer¶
llvmpipe has more complete EGL support than the Android software renderer, so more apps work with it, like Firefox-based browser or more recent webviews. Unfortunately, llvmpipe is still too slow to be the default renderer, but I made it possible to switch back and forth between llvmpipe and the Android software renderer. ADB and root over ADB needs to be enabled in the developer settings.
The following commands are necessary to enable llvmpipe:
adb root adb remount adb shell "grep -q "ro.libagl=1" /system/build.prop && sed "s/ro.libagl=1/ro.libagl=0/" -i /system/build.prop || sed "s/ro.libagl=0/ro.libagl=1/" -i /system/build.prop"
If you want to go back to the Android sofware renderer, you will need to run the above commands again. A reboot is always necessary for the changes to be applied.
Barcode scanning¶
The mostly used barcode scanner app ZXing has a pretty slow preview. This barcode scanner app from F-Droid has a much faster preview.
Using an external wifi dongle¶
See this post.
Known issues¶
- Some SIM cards are not recognized.
- The camera "locks" sometimes or the error "Can't connect to camera" is displayed.
Logs might help debugging this, at least the issue with the error message.
Recent versions have a fix which allows to take a picture if the camera app seems to be unresponsive and you press the shutter button a second time.
- The camera preview is slow
See this mail for more info.
- Only the Galaxy S2 and S3 are supported.
If you want to help getting other Replicant devices supported: Add the missing device repositories and try to merge the changes from CyanogenMod. If the device is not supported on the CyanogenMod 13.0 branch, you will have to look at forks that took up the development. Merging with an older branch could also be sufficient to get basic functionality working.
- Newer webviews can't be used because they don't work with the software rendering
Webview version 43.0.2357.134 is currently in use. It was released in July 2015. This can be fixed by making llvmpipe fast enough so it can be used as the default software renderer. Currently, the Android software renderer is the default.
- There are still prebuilt binaries in the source tree
I got rid of a lot of prebuilt binaries to make the build more trustworthy and to ensure that all tools are properly built from source with free software, but there are still a few left. The gcc-arm-linux-androideabi toolchain needs to be bootstrapped with proper 1st and 2nd stage compilers so it doesn't rely on the sysroot from the NDK. In general, there are still some prebuilt binaries from the NDK, SDK and other places in use, but nearly all of them shouldn't run on the host, but only on the Replicant device.
Build instructions¶
For now, only Debian Stretch is supported as build system. See this blog post on my personal blog for instructions on how to set up a Debian Stretch build environment in a chroot.
You need to install the following dependencies:
sudo apt-get build-dep gcc binutils llvm-defaults sudo apt-get install gcc-arm-none-eabi cmake python-dev swig ant bc proguard maven-debian-helper libemma-java libasm4-java libguava-java libnb-platform18-java libnb-org-openide-util-java libandroidsdk-ddmlib-java libmaven-source-plugin-java libfreemarker-java libmaven-javadoc-plugin-java repo ca-cacert curl gawk libgmp3-dev libmpfr-dev libmpc-dev git-core gperf libncurses-dev squashfs-tools pngcrush zip zlib1g-dev lzma libc6-dev-i386 g++-multilib lib32z1-dev lib32readline-dev lib32ncurses5-dev zlib1g-dev:i386 xsltproc python-mako schedtool gradle dirmngr libandroidsdk-sdklib-java eclipse-jdt libgradle-android-plugin-java android-sdk-build-tools android-sdk-platform-23 aapt lzop
All my code is hosted at https://code.fossencdi.org. You can get the source code with the following commands:
repo init -u https://code.fossencdi.org/replicant_manifest.git -b replicant-6.0
If you want to contribute or if you simply want the latest and possibly unstable changes, you can also initialize with the development branch:
repo init -u https://code.fossencdi.org/replicant_manifest.git -b replicant-6.0-dev
Please note that the build might even be broken on this branch and there are no git tags on this branch which pin the source code to certain versions.
Then download the source code:
repo sync
The F-Droid binary is downloaded separately. The download script will check if the signature of the F-Droid binary comes from the F-Droid release signing key. You can retrieve the current signing key with the command gpg --recv-key 7A029E54DD5DCE7A
. Run the download script to get F-Droid:
./vendor/replicant/get-prebuilts
Before you can build the ROM in the regular way, you need to run a build script that takes care of building the toolchain:
./vendor/replicant/build-toolchain
In order to prevent strange errors, I recommend running the script in a newly opened shell, in which you haven't already run one of the commands like . build/envsetup.sh, lunch
or make
that change the environment.
Then you can run the regular build commands to create a Replicant 6.0 zip and recovery:
. build/envsetup.sh lunch replicant_i9300-userdebug make -j $(nproc) bacon
I also added a script that signs your build, takes care of generating the necessary keys and puts everything in the out/dist
directory. Using this script, it is possible to rely on your own keys and not on the test keys which are not recommended to use because the private test keys are publicly available. Building from source and flashing the default image that is signed with the test keys basically disables all the security measures in Android that are based on signing keys. The script also makes it possible to use password-encrypted private keys. The images below are signed with my keys using this script. You can run the script the following way:
./vendor/replicant/sign-build i9300
And finally you can flash the recovery in the download mode and sideload the zip in recovery mode:
heimdall flash --BOOT out/dist/recovery.img adb sideload out/dist/replicant-6.0.zip
If you have already built Replicant at some point and now you are getting build errors: Run make clobber
and retry in a newly opened shell.
If make fails, it may be necessary that run mka org.cyanogenmod.platform-res
.
Compiled images (build date: 18.2.17):¶
- Download the following files:
https://fossencdi.org/replicant/replicant-6.0-i9300.zip
https://fossencdi.org/replicant/replicant-6.0-i9300.zip.asc
https://fossencdi.org/replicant/recovery-i9300.img
https://fossencdi.org/replicant/recovery-i9300.img.asc
https://fossencdi.org/replicant/images-i9300.sha256 - Add my key to your GPG keyring
You can retrieve it from the keyserver of your choice (gpg --recv-key 5816A24C10757FC4
).
Alternatively, you can download it from here: https://wiedmeyer.de/keys/ww.asc
and import it withgpg --armor --import path/to/5816A24C10757FC4.asc
The key should have the following fingerprint: 0F30 D1A0 2F73 F70A 6FEE 048E 5816 A24C 1075 7FC4 - Verify the signatures of the files:
gpg --armor --verify path/to/replicant-6.0-i9300.zip.asc path/to/replicant-6.0-i9300.zip gpg --armor --verify path/to/recovery.img-i9300.asc path/to/recovery-i9300.img
- Check the checksums (in the folder with all the downloaded files):
sha256sum -c images-i9300.sha256
Only install the images if all of these checks are successful!
You need to flash the new recovery first before you can flash the zip to your device. A full wipe is also necessary. Updating your ADB installation might help if you have problems with ADB.
See the wiki for more details.
Replies (135)
RE: Replicant 6.0, at least for the Samsung Galaxy S3 - Added by Wolfgang Wiedmeyer almost 9 years ago
I updated my initial post. There is now a section about the toolchain and build instructions. I merged my changes to the toolchain in the replicant-6.0 branch, so most of the toolchain needs to be build from source from now on. The security patch level should now be the correct one.
I also included links to a compiled zip and recovery if you are not able to build it from source for whatever reason and want to try it nonetheless.
@My Self:
external/parameter-framework/bindings/python/Android.mk:93: recipe for target '/home/USERNAME/.../replicant-6.0/out/host/linux-x86/gen/SHARED_LIBRARIES/_PyPfw_intermediates/pfw_wrap.cxx' failed
make: * [/home/USERNAME/.../replicant-6.0/out/host/linux-x86/gen/SHARED_LIBRARIES/_PyPfw_intermediates/pfw_wrap.cxx] Error 1
make: * Deleting file '/home/USERNAME/.../replicant-6.0/out/host/linux-x86/gen/SHARED_LIBRARIES/_PyPfw_intermediates/pfw_wrap.cxx'
Could you post more/previous output? This basically only shows that make gives up, but the actual error happened somewhere before.
My 2 cents about using Arch for building this: Google uses an old and modified Ubuntu LTS release for building Android. Debian Jessie comes pretty close to this setup in terms of configuration and package versions. So I only had to fix very few build errors here and there. Arch however has very new package versions and differs quite a bit. I don't want you to switch to a different distribution for building Android. Indeed, I think it is very important that we make it possible to build Replicant on Arch, because then it is very likely that building it will work on various other distributions. But I just want to let you know that you will likely have more build errors in the future and that it could become quite challenging. I will definitely try to help you with build errors.
I will need logs for fixing the SIM card problem. I tested it with two different SIM cards (albeit same provider) on two devices and they always get recognized. So I don't know what could be the culprit.
Setting->Sound->Other did not yet crash on me but I will look into this at some point.
Encryption should also work. If this does in fact not work, then the logcat from the shutdown after the encryption was enabled and from the following boot needs to be inspected. The last time I checked, encryption did not work on CyanogenMod 13 because they likely forgot to add some SELinux rules.
@Simon: Yes, it uses Replicant's RIL and the proprietary graphics drivers are not used. It is unlikely that there was a different proprietary acceleration module added to the source code and I would not be aware of it. Feel free to check the source! I already went through quite some code and e.g. removed the linking to proprietary play services that CyanogenMod added. I will also watch out for the one-pixel split graphics bug.
I won't provide support for running proprietary software on the AP, but if you want to get GPS working, you might start by looking at this commit: https://code.fossencdi.org/device_samsung_i9300.git/commit/?h=replicant-6.0&id=eb564f1803a0145eef68b59cdbb75362175d05a7
robin p: I won't do work on getting a sdk or ndk build ready for now. I don't see a point in doing so for the moment because there are still so many binaries. I think it has be investigated first if the build process for the sdk or ndk just repackages a lot of these binaries. Just to be clear: I see similar problems with the Replicant 4.2 source code. For now I recommend building an app directly from the source code. Just place it somewhere and run mmm path/to/app
. The app just needs a Android.mk. It can be simple as this one: https://code.fossencdi.org/BlueGPS.git/tree/Android.mk. You should have run a complete build of the ROM before so that all dependencies are in place or you could try to run mmma path/to/app
. Of course, if the app has a lot of dependencies, then it might not work because not all of them are there.
RE: Replicant 6.0, at least for the Samsung Galaxy S3 - Added by Simon Josefsson almost 9 years ago
Thanks for update! I'm now trying to reproduce the build using the latest repo. I'm also quite concerned about the number of "prebuilds" needed, so thanks for working on that. Btw, you also need the 'bc' debian package in addition to the replicant wiki debian packages (it was not installed on my minimal debian machine).
Re the one pixel bug: I suspect it is related to the top menu appearing in the wrong place on first boot. I just tried booting your ZIP and it behaves the same as it did for my images: on first boot when I first click on the top right to drag down the menu, the menu appears in the wrong place (1-2cm to the left of where it should be, thus partially hidden). Once canceled, the menu always appears in the right place again. Not very important bug, but just strange. I think I only saw the one-pixel issue directly after first boot before, but cannot recall what I did instead of dragging down the menu.
Re the Setting->Sound->Other bug: it crashes for me using your image too. Just go to Setting->Sound->Other and then press the back button. Boom.
Re the SIM issue: I may have damaged this S3, it now displays "No SIM Card" on every ROM I try. I distinctly recall it asking for a PIN a number of times before. I've tried restoring EFS but no difference. It might be a physical/mechanical problem on this S3. I'll need to buy another S3, or reinstall my hot spare S3...
RE: Replicant 6.0, at least for the Samsung Galaxy S3 - Added by Simon Josefsson almost 9 years ago
I ran ./vendor/replicant/build-toolchain and it completed without errors, still I get a build error during 'make bacon' that seems toolchain-related.
/bin/bash: toolchain/gcc/arm/arm-linux-androideabi/install/bin/arm-linux-androideabi-gcc: No such file or directory
That directory contains almost everything except gcc...
jas@replicantbuilder:~/ssd/replicant-6.0$ ls -la toolchain/gcc/arm/arm-linux-androideabi/install/bin/ total 264656 drwxr-xr-x 2 jas jas 4096 Jan 16 20:37 . drwxr-xr-x 5 jas jas 4096 Jan 16 20:37 .. -rwxr-xr-x 1 jas jas 3931736 Jan 16 20:37 arm-linux-androideabi-addr2line -rwxr-xr-x 2 jas jas 4103128 Jan 16 20:37 arm-linux-androideabi-ar -rwxr-xr-x 2 jas jas 6072912 Jan 16 20:37 arm-linux-androideabi-as -rwxr-xr-x 1 jas jas 3892640 Jan 16 20:37 arm-linux-androideabi-c++filt -rwxr-xr-x 1 jas jas 49867192 Jan 16 20:37 arm-linux-androideabi-dwp -rwxr-xr-x 1 jas jas 95256 Jan 16 20:37 arm-linux-androideabi-elfedit -rwxr-xr-x 1 jas jas 4462048 Jan 16 20:37 arm-linux-androideabi-gprof -rwxr-xr-x 4 jas jas 80375240 Jan 16 20:37 arm-linux-androideabi-ld -rwxr-xr-x 2 jas jas 5469600 Jan 16 20:37 arm-linux-androideabi-ld.bfd -rwxr-xr-x 4 jas jas 80375240 Jan 16 20:37 arm-linux-androideabi-ld.gold -rwxr-xr-x 2 jas jas 3970736 Jan 16 20:37 arm-linux-androideabi-nm -rwxr-xr-x 2 jas jas 4794080 Jan 16 20:37 arm-linux-androideabi-objcopy -rwxr-xr-x 2 jas jas 5573224 Jan 16 20:37 arm-linux-androideabi-objdump -rwxr-xr-x 2 jas jas 4103128 Jan 16 20:37 arm-linux-androideabi-ranlib -rwxr-xr-x 1 jas jas 1236432 Jan 16 20:37 arm-linux-androideabi-readelf -rwxr-xr-x 1 jas jas 3927376 Jan 16 20:37 arm-linux-androideabi-size -rwxr-xr-x 1 jas jas 3926488 Jan 16 20:37 arm-linux-androideabi-strings -rwxr-xr-x 2 jas jas 4794144 Jan 16 20:37 arm-linux-androideabi-strip jas@replicantbuilder:~/ssd/replicant-6.0$
Re-running ./vendor/replicant/build-toolchain doesn't modify the directory content.
Thanks!
RE: Replicant 6.0, at least for the Samsung Galaxy S3 - Added by Wolfgang Wiedmeyer almost 9 years ago
Simon Josefsson wrote:
Btw, you also need the 'bc' debian package in addition to the replicant wiki debian packages (it was not installed on my minimal debian machine).
Thanks, added it to the list.
Re the one pixel bug: I suspect it is related to the top menu appearing in the wrong place on first boot. I just tried booting your ZIP and it behaves the same as it did for my images: on first boot when I first click on the top right to drag down the menu, the menu appears in the wrong place (1-2cm to the left of where it should be, thus partially hidden). Once canceled, the menu always appears in the right place again. Not very important bug, but just strange. I think I only saw the one-pixel issue directly after first boot before, but cannot recall what I did instead of dragging down the menu.
Re the Setting->Sound->Other bug: it crashes for me using your image too. Just go to Setting->Sound->Other and then press the back button. Boom.
I can reproduce both of these issues now. For now I will focus on other issues as I don't see them as that important. They may not be related to the changes I made so hopefully, they get fixed on Cyanogenmod's side.
My TODO list for now (in order of importance):- figure out what the SIM card issue is that some or all? experience
- get rid of more prebuilts
- get SELinux working
- get a newer Webview working
- patch not yet fixed security bugs in the kernel
Re the SIM issue: I may have damaged this S3, it now displays "No SIM Card" on every ROM I try. I distinctly recall it asking for a PIN a number of times before. I've tried restoring EFS but no difference. It might be a physical/mechanical problem on this S3. I'll need to buy another S3, or reinstall my hot spare S3...
This is very unfortunate. Are you sure that it's the phone and not the SIM card? Does the SIM card work in a different phone?
I may have run into this yesterday, too. I suspect the reason is that some of the environment variables, that envsetup, lunch or make set, conflict with the build script for the toolchain. Could you try these steps:I ran ./vendor/replicant/build-toolchain and it completed without errors, still I get a build error during 'make bacon' that seems toolchain-related.
[...]
That directory contains almost everything except gcc...
- remove the androideabi toolchain files:
rm -rf toolchain/gcc/arm/arm-linux-androideabi/
- rerun the toolchain build script in a newly opened shell without running any of the other commands like
. build/envsetup.sh
,lunch
,make
or others that modify the environment - check if the gcc binary is now there in
toolchain/gcc/arm/arm-linux-androideabi/install/bin/
Thanks!
RE: Replicant 6.0, at least for the Samsung Galaxy S3 - Added by Sasha Malo almost 9 years ago
Hi
This work is amazing :) Congrats.
I have some questions regarding it :
1) to migrated the RIL/IPC stack was it enough to edit samsung-ril and libsamsung-ipc or are there some other modifications in other repos ? While waiting for a stable 4.4 or 6.0 version for my I9500 i would like already to migrated the RIL stack to open source instead od the proprietary one while staying on cyanogenmod.
2) Except the I9500 mentionned above are there other devices that are replicant 6.0 RIL compatibles, will this work allow some more target phones to ber compatible or the RIL will not be compatible with recent exynos soc ?
Best Regards
RE: Replicant 6.0, at least for the Samsung Galaxy S3 - Added by Sasha Malo almost 9 years ago
I m alsqo getting this issue when syncing :
error: Packfile index for /mnt/sources/external/android/replicant_6_i9300/.repo/projects/packages/apps/Settings.git/objects/pack/pack-4c08587c6c02046261103ee32ccfb9692c4dca75.pack SHA1 mismatch
error: Unable to find 51c74e953bf5859102cde1447c039477ba35cacd under https://code.fossencdi.org/packages_apps_Settings.git
Cannot obtain needed blob 51c74e953bf5859102cde1447c039477ba35cacd
while processing commit c971ae3f9f34b0b4ca5aabacb6de7e1afb9f320d.
error: fetch failed.
error: Cannot fetch packages_apps_Settings.git
RE: Replicant 6.0, at least for the Samsung Galaxy S3 - Added by Simon Josefsson almost 9 years ago
Wolfgang Wiedmeyer wrote:
I can reproduce both of these issues now. For now I will focus on other issues as I don't see them as that important. They may not be related to the changes I made so hopefully, they get fixed on Cyanogenmod's side.
My TODO list for now (in order of importance):
- figure out what the SIM card issue is that some or all? experience
- get rid of more prebuilts
- get SELinux working
- get a newer Webview working
- patch not yet fixed security bugs in the kernel
That's a good priority order! The graphic bug is not important.
Re prebuilts, some should be easy to get rid of, like ccache, flex, bison -- not sure it is even worth rebuilding them, you could just rely on vendor OS tools unless Android has patches.
Re the SIM issue: I may have damaged this S3, it now displays "No SIM Card" on every ROM I try. I distinctly recall it asking for a PIN a number of times before. I've tried restoring EFS but no difference. It might be a physical/mechanical problem on this S3. I'll need to buy another S3, or reinstall my hot spare S3...
This is very unfortunate. Are you sure that it's the phone and not the SIM card? Does the SIM card work in a different phone?
The SIM works. I found a used S3 so I will try more when it is delivered...
I may have run into this yesterday, too. I suspect the reason is that some of the environment variables, that envsetup, lunch or make set, conflict with the build script for the toolchain. Could you try these steps:
- remove the androideabi toolchain files:
rm -rf toolchain/gcc/arm/arm-linux-androideabi/
- rerun the toolchain build script in a newly opened shell without running any of the other commands like
. build/envsetup.sh
,lunch
,make
or others that modify the environment- check if the gcc binary is now there in
toolchain/gcc/arm/arm-linux-androideabi/install/bin/
I can confirm that this works.
Btw, it would be nice to get reproducible builds of Replicant... the reproducible-builds.org team has good resources here. The first step would be to set up a build server to feed the outputs into diff'ing tools.
/Simon
RE: Replicant 6.0, at least for the Samsung Galaxy S3 - Added by Simon Josefsson almost 9 years ago
New build failure:
target thumb C: recovery <= bootable/recovery/../../system/core/toolbox/start.c target thumb C: recovery <= bootable/recovery/../../system/core/toolbox/stop.c target thumb C: recovery <= bootable/recovery/../../system/vold/vdc.c target thumb C++: libminivold_static <= system/vold/PrivateVolume.cpp target StaticLib: libminivold_static (/home/jas/ssd/replicant-6.0/out/target/product/i9300/obj/STATIC_LIBRARIES/libminivold_static_intermediates/libminivold_static.a) target StaticExecutable: recovery (/home/jas/ssd/replicant-6.0/out/target/product/i9300/obj/EXECUTABLES/recovery_intermediates/LINKED/recovery) system/vold/VolumeManager.cpp:934: error: undefined reference to 'android::vold::ext4::Mount(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool, bool, bool, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)' system/vold/VolumeManager.cpp:1154: error: undefined reference to 'android::vold::ext4::Mount(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool, bool, bool, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)' system/vold/VolumeManager.cpp:1222: error: undefined reference to 'android::vold::ext4::Mount(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool, bool, bool, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)' system/vold/VolumeManager.cpp:1284: error: undefined reference to 'android::vold::ext4::Mount(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool, bool, bool, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)' clang-3.7: error: linker command failed with exit code 1 (use -v to see invocation) build/core/executable_internal.mk:75: recipe for target '/home/jas/ssd/replicant-6.0/out/target/product/i9300/obj/EXECUTABLES/recovery_intermediates/LINKED/recovery' failed make: *** [/home/jas/ssd/replicant-6.0/out/target/product/i9300/obj/EXECUTABLES/recovery_intermediates/LINKED/recovery] Error 1 #### make failed to build some targets (03:43 (mm:ss)) #### jas@replicantbuilder:~/ssd/replicant-6.0$
RE: Replicant 6.0, at least for the Samsung Galaxy S3 - Added by Beuc Beuc almost 9 years ago
Great work Wolfgang!
I'd be glad to know if this works with the SDK rebuild-from-sources effort, see
http://android-rebuilds.beuc.net/
https://gitlab.com/android-rebuilds/auto/tree/master
(@robin p that may interest you as well ;))
RE: Replicant 6.0, at least for the Samsung Galaxy S3 - Added by Wolfgang Wiedmeyer almost 9 years ago
Update: The described workaround should not be necessary anymore. See later comments or the updated post.
Regarding the SIM card issue:
If the SIM needs to be unlocked on boot, then it does in fact not work. The SIM cards, that I always tested before, had the SIM lock removed. I tested it today with a locked one and it shows the behavior that sebastian k and My Self described (no SIM card recognized and no pin unlock request). It's likely that the Samsung-RIL will need another update to make this work.
As a workaround for now, you will need to remove the lock. With a different ROM, go to security->"set up SIM card lock" in the settings and disable the lock. Then the SIM card should work.
Funny enough, setting the lock actually works, but this is of no use if the unlocking doesn't work.
RE: Replicant 6.0 build-process and testing-images for the i9300 - Added by Wolfgang Wiedmeyer over 8 years ago
My Self wrote:
To be honest, I really freaked out about this news! @Wolfgang: Thanks a lot for saving me from some (more) sleepless nights about Replicant's security situation.
I bought an used I9300 as fast as I could and since this has arrived, I tried to figure out some basics:
This is really nice to hear :)
The security situation still needs some work, though. I will be able to get SELinux working in the next weeks. Besides that, the main problem is the outdated kernel. At least, all the kernel vulnerabilities of the last two years have to be checked if they are already fixed. Additionally, the drivers and other parts, that are not maintained in the upstream kernel, have to be investigated. I am also not fully convinced that Google is fixing everything in their AOSP code, especially in external. And as I detailed already in my post, the webview is also an issue.
If you want to check the GPG signature of F-Droid apps, which are listed in- and will be fetched by executing:
[...] You should have added the public key from F-Droid before:
[...] Source: https://f-droid.org/wiki/page/Release_Channels_and_Signing_Keys
Thanks for documenting that! I forgot to mention that before. I added a hint in the updated build instructions.
But one patchset I can't fit into the existing sources. I can't say if Replicant 6.0 is affected to the vulnerability CVE-2015-6636, yet.
Exactly, this two patches:
These patches are also already included in the sources. All the security patches from the February issue should be included now, too. They were already included in changes I merged from CyanogenMod.
I realized there is a basic root "management" by setting:
Settings -> Developer options -> Root access -> from Disablet to: Apps only
But I wanted more or less the same root management as I knew it from Replicant 4.2, because I love the benefits like PIN protection or the clearly arranged logging overview.
So I did the following:
It is really awesome that Pierre-Hugues Husson maintains Superuser and made it compatible with recent Android versions. It is obvious that Superuser is more feature complete but I am skeptical if it's worth the effort to integrate it in the source build. Regarding the PIN protection: Does it really have a security benefit? If the phone is unlocked, would it be possible to remove the protection by deleting app data of the Superuser? Also, does it prevent to enable root over adb? So the question is basically whether it really makes evil maid attacks harder. Access to all you data is probably already there (https://xkcd.com/1200/)
Having logging of root accesses is definitely a benefit!
You could already test if the integration of Superuser as a module works. Just place the Superuser and Widgets repos somewhere in the source dir (e.g. in external/Superuser). You probably will need to remove the existing su module by deleting the system/extras/su dir because otherwise the modules will conflict. Then adding Superuser to PRODUCT_PACKAGES e.g. in
vendor/replicant/config/common_full.mk should be enough. This should build Superuser as an additionally dependency automatically when you start the next build.
- Furthermore I let the app 'LiveWallpapersPicker' exist, but removed the following system apps (mostly EGL needing- and so crashing live wallpapers) instead:
- NoiseField
- PhaseBeam
- PhotoTable
- PhotoPhase
- Screencast (this app opens, but only creates non-working video files in my tests)
by editing the file vendor/replicant/config/common_full.mk like this:- adding:
- PRODUCT_PACKAGES += \n> SoundRecorder \n> LiveWallpapersPicker
- removing (or commenting out)
- NoiseField \n> PhaseBeam \n> PhotoTable \n> PhotoPhase \n> Screencast
Thanks for investigating this! I'll integrate this. So does LiveWallpapersPicker work with software rendering?
RE: Replicant 6.0, at least for the Samsung Galaxy S3 - Added by Wolfgang Wiedmeyer over 8 years ago
Sasha Malo wrote:
This work is amazing :) Congrats.
Thanks :)
I have some questions regarding it :
1) to migrated the RIL/IPC stack was it enough to edit samsung-ril and libsamsung-ipc or are there some other modifications in other repos ? While waiting for a stable 4.4 or 6.0 version for my I9500 i would like already to migrated the RIL stack to open source instead od the proprietary one while staying on cyanogenmod.
I only had to fix build errors in libsamsung-ipc and only needed to deal with the code to investigate some initial problems but I did not need to implement anything in there. To my knowledge the code is already more or less complete for the currently supported devices. If you want to add support for a new device, then you will probably have to do quite some work in there. Paul or others who actually worked on that code will be able to answer questions regarding this.
Samsung-RIL is device-independent and the actual project that needs to be updated to be compliant with a new Android version. There is still some work to be done, but these changes will affect all devices.
Then you need to do changes to the device sources. You can check the differences between the respective repositories (e.g. for the i9300) at CyanogenMod and Replicant to get an idea of what needs to be done.
2) Except the I9500 mentionned above are there other devices that are replicant 6.0 RIL compatibles, will this work allow some more target phones to ber compatible or the RIL will not be compatible with recent exynos soc ?
AFAIK it should be possible as long as support can be added to libsamsung-ipc, but I'm not sure.
You are probably aware of this thread: https://redmine.replicant.us/boards/27/topics/6927?r=7023#message-7023
So as getting software rendering working can be done quite easily anyway, I would suggest that you start with this. The device could be too slow with software rendering because of the high resolution screen.
Sync errors like the one you were having shouldn't be an issue for quite some time now. It should work if you sync again, but you will probably have to remove the affected repositories from the .repo/project-objects/ directory.
RE: Replicant 6.0 build-process and testing-images for the i9300 - Added by Wolfgang Wiedmeyer over 8 years ago
Sorry, I pressed quote instead of edit. Is there no way to delete posts?
RE: Replicant 6.0, at least for the Samsung Galaxy S3 - Added by Wolfgang Wiedmeyer over 8 years ago
Simon Josefsson wrote:
Re prebuilts, some should be easy to get rid of, like ccache, flex, bison -- not sure it is even worth rebuilding them, you could just rely on vendor OS tools unless Android has patches.
That's what I did. Only ccache is not yet replaced. If there is demand for it to be working, then I'll look into it. Should be easy as long as the Debian version is compatible.
Btw, it would be nice to get reproducible builds of Replicant... the reproducible-builds.org team has good resources here. The first step would be to set up a build server to feed the outputs into diff'ing tools.
It would be awesome, indeed. Especially if it would be built with an OS that is reproducible in itself, like Debian Stretch will hopefully be. But I think that it does not make much sense if the compiled image contains binaries or if the build relies on binaries in the source tree, which are not reproducible. So getting rid of prebuilt binaries that are not verifiable or not yet verified is the first step in my eyes.
Your build failure should be gone now. You could also run make clobber
before rebuilding and after syncing, just to make sure.
RE: Replicant 6.0, at least for the Samsung Galaxy S3 - Added by Wolfgang Wiedmeyer over 8 years ago
Beuc Beuc wrote:
I'd be glad to know if this works with the SDK rebuild-from-sources effort, see
http://android-rebuilds.beuc.net/
https://gitlab.com/android-rebuilds/auto/tree/master
Thanks for working on this! Your documentation already helped me quite a bit. Feel free to try it out, but only building an image for the i9300 will work for now! Building the sdk will likely fail because of missing dependencies.
Nearly all the build errors that where reported in this thread are due to the constantly changing source code. The version I was working on was not the same others were testing at a later point because they already pulled in new changes from CyanogenMod when they synced. The problem is that CyanogenMod does not use tags for their repos so there is no sane default way of freezing the code at a certain version. I solved this problem now by mirroring the CyanogenMod repos on my server and tagging versions that I tested and believe to be working. So everyone gets now the same version when syncing on the replicant-6.0 branch. And this way, it's also possible to have the same version I used to compile the images that I offer for testing (see my updated post).
I am planning to update the mirror at least monthly so that the latest security fixes get pulled in. I will probably do the intial work and testing on a separate branch (replicant-6.0-dev) and then tag everything when I think that it works fine. After that, I will update the replicant-6.0 branch with the new tag and everyone gets the new version.
The current version is already tagged on the replicant-6.0 branch, so it should just build fine if you try it. But it can still break on a different distro than Debian Jessie.
RE: Replicant 6.0, at least for the Samsung Galaxy S3 - Added by Wolfgang Wiedmeyer over 8 years ago
Locked SIM cards should now also work. The issue with the pull down menu after boot and the crash of the "other sound" menu should be gone, too.
I also updated various areas of my post, including the build instructions and the image section.
What's coming for the next version: I got SELinux working in enforcing mode (also in the recovery), but I need to to do a bit more testing. The issue with the wifi dropouts seems to be gone, but I need to investigate this a bit more. I also currently redo the kernel branch so we have a version without my experimental changes.
RE: Replicant 6.0, at least for the Samsung Galaxy S3 - Added by Wolfgang Wiedmeyer over 8 years ago
new version
SELinux is now running in enforcing mode. The Wifi dropout bug is gone and the Wifi is stable.
Signing the builds with the script works also great so far.
The recovery checks the signature of the install zip and refuses to install it if it has not the signature stored in the recovery. CyanogenMod added another check that also compares the signature to one stored on the current data partition. If they don't match, it also won't install anything, unless you do a factory reset. This check does not happen if the data partition is encrypted because the recovery does not yet decrypt it. It would be helpful if the recovery would be able to decrypt the data partition and could do the check. Currently, the phone just becomes unresponsive after decrypting the data partition if there are different signatures present. And you would have to figure out for yourself that a factory reset is necessary.
RE: Replicant 6.0, at least for the Samsung Galaxy S3 - Added by Divan Santana over 8 years ago
I'm interesting in trying this out. A bit clueless as to where I get the proprietary firmware for the wifi and how to load it?
Unfortunately I need that.
RE: Replicant 6.0, at least for the Samsung Galaxy S3 - Added by Sasha Malo over 8 years ago
Divan Santana wrote:
I'm interesting in trying this out. A bit clueless as to where I get the proprietary firmware for the wifi and how to load it?
Unfortunately I need that.
Hi there is a complete guide here : http://code.paulk.fr/article16/missing-proprietary-firmwares-in-android-systems
RE: Replicant 6.0, at least for the Samsung Galaxy S3 - Added by Divan Santana over 8 years ago
Sasha Malo wrote:
Divan Santana wrote:
I'm interesting in trying this out. A bit clueless as to where I get the proprietary firmware for the wifi and how to load it?
Unfortunately I need that.
Hi there is a complete guide here : http://code.paulk.fr/article16/missing-proprietary-firmwares-in-android-systems
Thanks a ton!
RE: Replicant 6.0, at least for the Samsung Galaxy S3 - Added by Divan Santana over 8 years ago
Things have changed a bit since that article wrt firmware.
These are the files under vendor from the cm13 zip.
tmp2 ᐅ find vendor
vendor
vendor/firmware
vendor/firmware/SlimISP_BH.bin
vendor/firmware/SlimISP_GD.bin
vendor/firmware/SlimISP_GH.bin
vendor/firmware/SlimISP_GK.bin
vendor/firmware/SlimISP_JH.bin
vendor/firmware/SlimISP_PH.bin
vendor/firmware/SlimISP_WH.bin
vendor/firmware/SlimISP_ZD.bin
vendor/firmware/SlimISP_ZH.bin
vendor/firmware/SlimISP_ZK.bin
vendor/firmware/SlimISP_ZM.bin
vendor/firmware/fimc_is_fw.bin
vendor/firmware/mfc_fw.bin
vendor/firmware/setfile.bin
vendor/lib
vendor/lib/drm
vendor/lib/drm/libdrmwvmplugin.so
vendor/lib/libWVStreamControlAPI_L1.so
vendor/lib/libavcodec.so
vendor/lib/libavformat.so
vendor/lib/libavutil.so
vendor/lib/libbt-vendor.so
vendor/lib/libffmpeg_extractor.so
vendor/lib/libffmpeg_omx.so
vendor/lib/libffmpeg_utils.so
vendor/lib/libswresample.so
vendor/lib/libswscale.so
vendor/lib/libwvdrm_L1.so
vendor/lib/libwvm.so
vendor/lib/mediadrm
vendor/lib/mediadrm/libdrmclearkeyplugin.so
vendor/lib/mediadrm/libwvdrmengine.so
Tried copying vendor/firmware/* into /system/firmware/
Wifi still not working.
Any pointers please? :)
RE: Replicant 6.0, at least for the Samsung Galaxy S3 - Added by wellton costa over 8 years ago
The Wolf had linked a tutorial of how to unpack the CM13 to install non-free software, but decided to remove for some reason. Then, I think it's a little inappropriate to discuss technical details of non-free software here in this forum. It's just my opinion.
RE: Replicant 6.0, at least for the Samsung Galaxy S3 - Added by Divan Santana over 8 years ago
Wellton Costa de Oliveira wrote:
The Wolf had linked a tutorial of how to unpack the CM13 to install non-free software, but decided to remove for some reason. Then, I think it's a little inappropriate to discuss technical details of non-free software here in this forum. It's just my opinion.
Pity. I'll see if I can find something.
True about the non-free software here...
RE: Replicant 6.0, at least for the Samsung Galaxy S3 - Added by Daniel Kulesz over 8 years ago
Very cool, thank you a lot for spending all the effort! I assume the LTE-variant of the Galaxy S3 (i9305) is not supported, right?
RE: Replicant 6.0, at least for the Samsung Galaxy S3 - Added by Divan Santana over 8 years ago
Wellton Costa de Oliveira wrote:
The Wolf had linked a tutorial of how to unpack the CM13 to install non-free software, but decided to remove for some reason. Then, I think it's a little inappropriate to discuss technical details of non-free software here in this forum. It's just my opinion.
If anyone has details on this. Can you drop me some info @ divan<a>santanas.co.za ? Pretty please. ;)