LineageOS 18.1 patches & tweaks for Samsung S5 Neo (s5neolte)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

139 lines
6.9 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. # LineageOS 18.1 patches & tweaks for Samsung S5 Neo (s5neolte)
  2. This repository has the following patches such as:
  3. - Enable NFC service
  4. - Bypass safe volume warning dialog
  5. - Enable call recording
  6. - Bypasses all country restrictions
  7. - Replace Google DNS server references
  8. Original source code repositories:
  9. - [GitHub - LineageOS/android_device_samsung_s5neolte](https://github.com/LineageOS/android_device_samsung_s5neolte)
  10. - [GitHub - LineageOS/android_device_samsung_universal7580-common](https://github.com/LineageOS/android_device_samsung_universal7580-common)
  11. - [GitHub - LineageOS/android_hardware_samsung_nfc](https://github.com/LineageOS/android_hardware_samsung_nfc)
  12. - [GitHub - LineageOS/android](https://github.com/LineageOS/android)
  13. ## Usage
  14. Follow [Lineage OS for Samsung S5 Neo guide](https://wiki.lineageos.org/devices/s5neolte/build) **until** `brunch s5neolte` command. Before issuing that command, you need to put files of this repository in place.
  15. ## Some notes about the official LineageOS build guide
  16. - **DO NOT** install `recovery.img`. LineageOS Recovery is horrible, TWRP is great. Use TWRP. Thanks. If you mistakenly install `recovery.img` anyway, getting rid of it requires use of heimdall to flash back TWRP `recovery.img` (`heimdall flash --RECOVERY <twrp-recovery>.img`)
  17. - Install only contents of LineageOS zip file `lineage-18.1-YYYYMMDD-UNOFFICIAL-s5neolte.zip` using TWRP
  18. - You may already have `repo` command pre-installed on your system
  19. - Use command `repo init -u https://github.com/LineageOS/android.git -b lineage-18.1`
  20. - `./extract-files.sh` commands relative to LineageOS source dir:
  21. - `device/samsung/universal7580-common/extract-files.sh`
  22. - `device/samsung/s5neolte/extract-files.sh`
  23. - Both must be executed
  24. - In order to `./extract-files.sh` commands fully succeed, you must have Samsung Android `6.0.1` preinstalled on your phone. Otherwise you get errors for missing files.
  25. ## LineageOS requirements for s5neolte
  26. - If you have original Samsung Android OS installed, it must be version `6.0.1`. LineageOS installation on phones using older Android versions (`5.1.1`, etc.) simply fails.
  27. - If you do not have Android `6.0.1` , get official Samsung update with [samloader](https://github.com/nlscc/samloader). Extract `zip` and `tar.md5` files, until you get all required `.img` and `.bin` files. Flash extracted `.bin` and `.img` files with [heimdall](https://github.com/Benjamin-Dobell/Heimdall)
  28. - Samloader [Arch Linux PKGBUILD (AUR)](https://aur.archlinux.org/packages/samloader-git/)
  29. - Take backup with TWRP before issuing `heimdall` commands
  30. - Relevant files are as follows: `boot.img`, `system.img`, `userdata.img`, `cm.bin`, `param.bin`, `sboot.bin`, `modem.bin`, `cache.img`, `hidden.img`
  31. - If you use custom recovery such as TWRP, **do not** flash `recovery.img`
  32. - File `S5NEOLTE_<XXX>_OPEN.pit` is a partition definition file. You may extract one directly from your phone using `heimdall`, as well.
  33. - You must patch heimdall to successfully flash your Samsung S5 Neo phone. Compile heimdall, and apply patch file [misc/heimdall/patch_filepartindex.patch](misc/heimdall/patch_filepartindex.patch). See [this GitHub issue](https://github.com/Benjamin-Dobell/Heimdall/issues/347) for details.
  34. - Heimdall source code: [GitHub - alexax66/Heimdall](https://github.com/alexax66/Heimdall)
  35. - Heimdall [Arch Linux PKGBUILD](https://github.com/archlinux/svntogit-community/tree/packages/heimdall/trunk)
  36. - Heimdall usage and command explanations: [SAMMobile - [Firmware]Restoring Stock Firmware with Heimdall](https://www.sammobile.com/forum/threads/45894-Restoring-Stock-Firmware-with-Heimdall)
  37. - Heimdall flash command for Samsung S5 Neo: `heimdall flash --BOOT boot.img --SYSTEM system.img --USERDATA userdata.img --CM cm.bin --PARAM param.bin --BOOTLOADER sboot.bin --RADIO modem.bin --CACHE cache.img --HIDDEN hidden.img`
  38. - **WARNING**: Use absolutely correct, Samsung provided files in `heimdall` command. Otherwise the flash process may fail and you end up with a bricked phone.
  39. - Flashing `USERDATA` is not necessary
  40. ## Additional tips
  41. - You may build parts of LineageOS using `mm` and `mmm` commands after sourcing `build/envsetup.sh`
  42. - This is useful for partial patches
  43. - For instance, building only `Dialer` APK, run `mmm packages/apps/Dialer` in lineage source root dir
  44. - If in any case, you get error message `cmd: unknown variable '$(PATH_OVERRIDE_SOONG)'`, run `breakfast <lunch-command-option>` command at Lineage OS source directory root again before issuing any other commands. Running `breakfast` command can take 10-15 minutes without any visible progress displayed
  45. - Before starting Lineage OS, you may need to wipe cache & Dalvik cache in TWRP (`Wipe -> Advanced Wipe -> [Dalvik / ART Cache, Cache]`)
  46. ### Init.d support
  47. No, do not use `/system/etc/init.d/` or look for such folders. Simply put your boot time scripts into `/data/adb/service.d/` folder, set their owner to `root:root` and permission bits to `0700`. You may give less restrictive permissions at your own risk. Default owner of these scripts seems to be `root:shell`. You may use TWRP to set owner & permission information.
  48. Optionally, folder `/data/adb/post-fs-data.d/` may be used, as well.
  49. #### Additional startup scripts
  50. Disable Captive Portal on startup.
  51. See: [disable_captiveportal.sh](init.d/disable_captiveportal.sh)
  52. ### DNS modifications
  53. Replaces Google DNS servers with `127.0.0.1` and `::1` addresses.
  54. See: [patch_localhost-dns_ntp_gps.patch](lineage_src_root/patch_localhost-dns_ntp_gps.patch), and the article [Fjortek.com - Enforced, encrypted, self-hosted DNS solution for Android devices](https://fjordtek.com/categories/news/2021/enforced-encrypted-self-hosted-dns-solution-for-android-devices/).
  55. ### Bromite webview
  56. Replaces built-in, prebuild Google Chromium webview with [Bromite webview](https://github.com/bromite/bromite).
  57. See: [chromium-webview/Android.mk](lineage_src_root/external/chromium-webview/Android.mk)
  58. ### Default input method: Replace LatinIME
  59. **1)** Download privacy friendly [simple-keyboard](https://github.com/rkkr/simple-keyboard/) and put source files into a new folder `packages/inputmethods/simple-keyboard/`
  60. **2)** Use Android Studio to compile the `simple-keyboard` from source code (unsigned APK, because `platform` certificate is used during AOSP build process). Once done, go to the next step.
  61. **3)** Get [Android.mk](lineage_src_root/packages/inputmethods/simple-keyboard/Android.mk) and [CleanSpec.mk](lineage_src_root/packages/inputmethods/simple-keyboard/CleanSpec.mk) for simple-keyboard. Put the files into the root folder of downloaded `simple-keyboard` source files.
  62. **4)** Remove default input method `LatinIME` from AOSP 11 compilation process by commenting out lines
  63. ```
  64. PRODUCT_PACKAGES += \
  65. LatinIME
  66. ```
  67. in `build/make/target/product/handheld_product.mk`
  68. **5)** You need to add lines
  69. ```
  70. PRODUCT_PACKAGES += \
  71. SimpleKeyboard
  72. ```
  73. into some `.mk` file of your choice.