[ROM][8.1/9/10/11][Unofficial][EOL] LineageOS for Mi-4c/Mi-4s - Xiaomi Mi 4C

DESCRIPTION
Unofficial LineageOS ROMs for Mi-4c (libra) and Mi-4s (aqua), with base-layer enhancements and performance optimizations. Version 15.1/16.0/17.1/18.1 are available for download.
FEATURE
The following items may not be available for all versions, please use the latest build!
Click to expand...
Click to collapse
Build with user variant instead of userdebug (to reduce image size and improve performance).
CPU/GPU is overclocked with optimized voltage/bus-cci and 300 Hz/Jiffies kernel clock frequency. [16.0 +]
EAS (sched cpufreq governor from linux-3.18) CPU scheduler implemented. [16.0 +]
Full-weight NotoSansCJK fonts included (to display East Asian characters with more font weights).
High screen refresh-rate (75 Hz) support for Mi-4c with "Sharp-rsp61322 LCD" screen. [16.0 +]
Implement ZRAM with ZSTD crypto algorithm (KSM is used after 20210116) to improve I/O performance on devices with 2GB RAM. [16.0 +]
Linux kernel is built by clang-12 toolchains, with Polly + LTO + -Ofast optimization to get better performance. [17.1 +]
Pre-dex2oat with everything filter globally (sacrificing space and first-install time to improve efficiency).
Remove or disable unnecessary kernel configs and modules, also includes some other optimizations. [16.0 +]
Remove unnecessary apps/binaries/libraries/services from system. [16.0 +]
Signature spoofing support (ready for MicroG, including Chinese translations).
User-friendly controller for special features in Settings app (like CPU overclock, Edge gesture and Screen refresh rate). [17.1 +]
...
STATUS
Go to GitHub Issues for more details and give me feedback.
Click to expand...
Click to collapse
Working
Basic hardware
Baseband/SMS
Bluetooth
Camera/Flashlight
IR remote
Speaker/Microphone
Wi-Fi
Extras
Camera API2 (with patch) [17.1 +]
Edge gesture (in Settings > System > Buttons) [16.0 +]
Overclock control (in Settings > Battery > Battery saver and performance) [17.1 +]
Screen refresh rate (in Settings > Display) [17.1 +]
Not working
SELinux permissive [16.0 +]
VOLTE (won't fix because of no compatible IMS stacks) [16.0 +]
DOWNLOAD
GitHub Releases: https://github.com/BYZYB/android_device_xiaomi_libra/releases
Kernel/ROM: https://www.androidfilehost.com/?w=files&flid=287533
TWRP: https://www.androidfilehost.com/?fid=8889791610682882451
SOURCE
Device: BYZYB/android_device_xiaomi_libra
Forked from (16.0 +): android_device_xiaomi_libra + android_device_xiaomi_msm8994-common
Kernel: BYZYB/android_kernel_xiaomi_libra
Forked from: android_kernel_xiaomi_leo
Vendor: BYZYB/android_vendor_xiaomi_libra
Forked from (16.0 +): android_vendor_xiaomi_libra + android_vendor_xiaomi_msm8994-common
Custom changes: repo_17.diff + repo_18.diff
Thanks to all developers and users (Gah0 | Mortezadadgar | Xiaomi classic dev | ...) who contributed to Mi-4c/Mi-4s (including other devices shipped with MSM8992/8994 SOC) or gave me help!
Click to expand...
Click to collapse

TIPS
Here are some tips which may improve your experience or resolve some problems.
Basic quality assurance: I only have one smart phone (3+32GB Mi-4c ×1), so the ROMs here should at least satisfy my daily usage.
This project will be kept maintained even after I bought my new mobile phone (8+128GB Mi-Mix-2 ×1) in 2021. My Mi-4c is one of the most meaningful items of my own, it's not easy to leave it behind in the drawer and say goodbye. The new battery and rear cover (thanks to yipinghuang1991) will refresh this old device and make it usable again.
Even though the signal icon in status bar shows "No signal" at the first minute after boot, the device is still able to receive SMS and phone calls (so the device does have signal, but the system doesn't admit it at all).
If the free space in /system is not enough to install GAPPs, try to delete /system/fonts/NotoSansCJK.ttc to get about 100MB free space (If Chinese/Japanese/Korean is not your main language). Removing the prebuilt Webview packages (about 120MB) after installed another one is also a solution.
If you found random reboot on your device with overclock enabled (or just updated to lineage-17.1-20201216 and left overclock option unchanged), please disable this feature to see if this issue is resolved. Go to Settings > System > Battery > Battery saver and performance, enable then disable "High performance mode", and reboot your device. If you are using lineage-17.1-20210209 or newer, it's no need to do such steps after a clean install (as both persist.sys.cpu_overclock and persist.vendor.edge_touch_mode are default to false by default).
It's highly recommended to disable system logs to reduce resource consumption (for better performance and privacy), unless you're going to collect system logs. Go to Settings > System > Developer options, and set the value of "Logger buffer sizes" to off.
It's not recommended to use SELinux enforcing mode even if it's supported in some builds. Also, please consider the negative effect of I/O performance before enabling disk encryption, unless you really want to.
BUILD
As all source codes and custom changes in my LineageOS ROMs are open-source, you are permitted to build your own ROM or kernel (not only for LineageOS) with my sources for non-commercial purpose.
There are many documents about how to build custom Android ROMs in Linux/OSX, so I will not post these basic steps here to reduce redundancy. However, there are still some important things which may not be included in other documents. Here are some basic steps about what you should do (using lineage-18.1 as example), you can also take a reference to other tutorials.
Install necessary packages
There are a number of "necessary" packages listed in most tutorials, but not all of them are needed. Here are the packages you need to install manually on Ubuntu or Debian.
sudo apt install bc bison git gnupg make repo rsync unzip zip
Sync Android sources
You need to download and update your local repo with upstream sources regularly, in order to get new changes as soon as possible (just like other open-source projects).
Init repo to current directory: repo init -u https://github.com/LineageOS/android.git -b lineage-18.1 --depth=1
Sync all repos and prune unused branches: repo sync --prune
If nothing wrong happened, the LineageOS sources have been downloaded to your computer (about 100GB). Here are some commands which might be useful in the future.
Show all local changes of your repos: repo status or repo diff
Perform any operations to all repos: repo forall -c "xxx"
Setup local manifest
To sync your Android sources with upstream repos easily, it's recommended to create a local manifest in ./repo/local_manifests/. The local manifest should be a XML file like the following one, any filename is accepted (file: libra.xml).
XML:
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<project name="BYZYB/android_device_xiaomi_libra" path="device/xiaomi/libra" remote="github" revision="lineage-18.1" />
<project name="BYZYB/android_kernel_xiaomi_libra" path="kernel/xiaomi/libra" remote="github" revision="master" />
<project name="BYZYB/android_vendor_xiaomi_libra" path="vendor/xiaomi/libra" remote="github" revision="lineage-16.0" />
<project name="LineageOS/android_hardware_sony_timekeep" path="hardware/sony/timekeep" remote="github" revision="lineage-18.1" />
<project name="LineageOS/android_hardware_xiaomi" path="hardware/xiaomi" remote="github" revision="lineage-18.1" />
</manifest>
Resolve build errors
Due to some hacks in my device configurations which are conflict with Android build rules, there might be some build errors if using all my repos directly. To resolve this issue, you need to modify project build/make/manually on your disk. After that, you should be able to prepare the necessary environment for Android build without errors.
Setup build namespace only: . build/envsetup.sh
Prepare build environment for Mi-4c with a specified build variant (xxx = eng/userdebug/user): . build/envsetup.sh && lunch lineage_libra-xxx
If you want to build the ROM in "user" build variant instead of the default "userdebug", more changes are needed to avoid build errors or potential bootloop. The following commands are some ways to build a full ROM.
Build full ROM in "user" variant: brunch lineage_libra-user
Build full ROM in "userdebug" variant: brunch lineage_libra-userdebug
Build full ROM with a specified number of threads (x ≤ physical CPU cores): lunch lineage_libra-xxx && make -jx
If you have lunch before, here is the simplest way: m
As git patch files are similar to git diff, you can always do these changes manually without using git am xxx.patch && git reset HEAD^ or other shell commands.
Kernel build toolchains
The kernel supports to be built with gcc-9+ or clang-10+. As Link-Time-Optimization (LTO) for Clang is enabled by default (config: CONFIG_LTO_CLANG), building the kernel with GCC directly will result in build errors. In conclusion, it's recommended to choose Clang as your toolchains for both faster build speed and better performance.
As VDSO compat is enabled (config: CONFIG_COMPAT_VDSO), both arm and arm64 toolchains are needed to build the kernel. Clang could handle different cross compile targets easily (thanks to LLVM), but GCC could not. Also, though the kernel sources are compiled by clang, they will be linked by LD (included in GCC toolchains -> Binutils) with LLVM plugins. In conclusion, if the ROM you are building provides legacy gcc-4.9 toolchains (like LineageOS based projects), it should be safe to go ahead without installing GCC toolchains or Binutils. Otherwise, you need to install both Binutils and Clang packages in your computer to avoid build problems.
If you are using Ubuntu or Debian on your computer, please install the following packages (choose one way).
Using prebuilt toolchains in Android repo (recommend): sudo apt install libc6-dev libgcc-12-dev
Using toolchaings in your distribution: sudo apt install clang llvm-dev
For ROMs without legacy gcc-4.9 toolchains: sudo apt install binutils-aarch64-linux-gnu binutils-arm-linux-gnueabihf
Then you should be able to build the kernel without modifying build configs.
Build kernel image only: make bootimage
Build recovery image only: make recoveryimage
Apply custom changes (optional)

This is great. Is signature spoofing enabled? If not, could it be? MicroG users would like it. Ty.
Edit: signature spoofing is enabled, but It seems LineageOS 17 locked my bootloader.
Edit2: LineageOS 17 do not support custom partition tables. After flashing, my 2.3gb "system" goes to 1.8gb and there's no space left for NanoDroid and other mods.

Flashed ok, seems to be working just fine, but can't install gapps due to "insufficient space"
Any advice?

rostopira said:
Flashed ok, seems to be working just fine, but can't install gapps due to "insufficient space"
Any advice?
Click to expand...
Click to collapse
Right, there is really no enough free space in "/system" to install GAPPs (even the "pico" version). If Chinese/Japanese/Korean is not your main language, try to delete "/system/fonts/NotoSansCJK.ttc" to save 117MB free space, which seems enough for the "nano" version.

WJXXBSH said:
Right, there is really no enough free space in "/system" to install GAPPs (even the "pico" version). If Chinese/Japanese/Korean is not your main language, try to delete "/system/fonts/NotoSansCJK.ttc" to save 117MB free space, which seems enough for the "nano" version.
Click to expand...
Click to collapse
Thanks for advice, I've removed it, but still not enough space even for pico package
Code:
/system/system # df -h
Filesystem Size Used Available Use% Mounted on
tmpfs 888.2M 176.0K 888.0M 0% /dev
tmpfs 888.2M 24.0K 888.1M 0% /tmp
/dev/block/mmcblk0p44
11.2G 2.9G 8.1G 26% /data
/dev/block/mmcblk0p44
11.2G 2.9G 8.1G 26% /sdcard
/dev/block/mmcblk0p42
372.0M 440.0K 363.9M 0% /cache
/dev/block/mmcblk0p41
1.8G 1.7G 178.0M 90% /system
UPD: Removed some other noto fonts, symlinked to roboto, deleted ringtones. Got 202M free
I really hope, that won't result in a bootloop
UPD2: It booted, immediately restarted, and booted again successfully
Feels good)

rostopira said:
Thanks for advice, I've removed it, but still not enough space even for pico package
Code:
/system/system # df -h
Filesystem Size Used Available Use% Mounted on
tmpfs 888.2M 176.0K 888.0M 0% /dev
tmpfs 888.2M 24.0K 888.1M 0% /tmp
/dev/block/mmcblk0p44
11.2G 2.9G 8.1G 26% /data
/dev/block/mmcblk0p44
11.2G 2.9G 8.1G 26% /sdcard
/dev/block/mmcblk0p42
372.0M 440.0K 363.9M 0% /cache
/dev/block/mmcblk0p41
1.8G 1.7G 178.0M 90% /system
UPD: Removed some other noto fonts, symlinked to roboto, deleted ringtones. Got 202M free
I really hope, that won't result in a bootloop
UPD2: It booted, immediately restarted, and booted again successfully
Feels good)
Click to expand...
Click to collapse
It seems you're using lineage-17.0 roms, which needs more free space than 16.0 (eg. the APEX image).
Deleting the fonts that you never used is surely a way to get more space. If you have installed "Android System Webview" (com.google.android.webview) from play store or other origins, removing the prebuilt one from "/system/product/app/webview" should be another possible solution (get another 100MB). However, make sure to choose the new webview package in "Developer settings" and prevent factory reset unless flashing the rom again, or it might result in problems.

Hello, everyone.
I use TWRP 3.1.1.0 and get error 7
When I try Flash latest official TWRP / or twrp 3.3.0 from here via fastboot I can't boot to recovery.
Which version of TWRP do I need to use to flash Lineageos 17?
Thanks

elna.nitz said:
Hello, everyone.
I use TWRP 3.1.1.0 and get error 7
When I try Flash latest official TWRP / or twrp 3.3.0 from here via fastboot I can't boot to recovery.
Which version of TWRP do I need to use to flash Lineageos 17?
Thanks
Click to expand...
Click to collapse
Try this recovery: https://androidfilehost.com/?fid=1395089523397945946
It's just the one I used on my device.

WJXXBSH said:
Try this recovery: https://androidfilehost.com/?fid=1395089523397945946
It's just the one I used on my device.
Click to expand...
Click to collapse
Yes, I already tried that after installing TWRP from your posted link I'm stuck on icon Xiaomi and the device doesn't get into recovery. It must be noted that before that I used Lineageos 13 and already did wipe system & Chache & Dalvic & Data.
Only when I flash TWRP 3.1.1.0 from here (twrp from lollipop - nougat bootloader) I manage to get into the Recovery, the problem then I get eror 7 when I try to flash Lineageos 17.
It must be noted that before that I used Lineageos 13 and already did wipe system & Chache & Dalvic & Data. So now I am without an operating system, only recovery.

elna.nitz said:
Yes, I already tried that after installing TWRP from your posted link I'm stuck on icon Xiaomi and the device doesn't get into recovery. It must be noted that before that I used Lineageos 13 and already did wipe system & Chache & Dalvic & Data.
Only when I flash TWRP 3.1.1.0 from here I manage to get into the Recovery, the problem then I get eror 7 when I try to flash Lineageos 17.
It must be noted that before that I used Lineageos 13 and already did wipe system & Chache & Dalvic & Data. So now I am without an operating system, only recovery.
Click to expand...
Click to collapse
It seems you are using the old bootloader of Android 5.x, but it doesn't support new ROMs after all. To upgrade to the new bootloader, you must have access to officially unlock your device, then flash the latest MIUI and boot one time (it will make sure you could unlock your bootloader).
Use the unlock tool here (official solution): https://www.miui.com/unlock/index.html
If you have other ways to unlock the new bootloader without the official method, it's also right. It may take you some time to get the official permission (from Xiaomi) to unlock the device, good luck!

WJXXBSH said:
It seems you are using the old bootloader of Android 5.x, but it doesn't support new ROMs after all. To upgrade to the new bootloader, you must have access to officially unlock your device, then flash the latest MIUI and boot one time (it will make sure you could unlock your bootloader).
Use the unlock tool here (official solution): https://www.miui.com/unlock/index.html
If you have other ways to unlock the new bootloader without the official method, it's also right. It may take you some time to get the official permission (from Xiaomi) to unlock the device, good luck!
Click to expand...
Click to collapse
Thanks a lot, how do I flash latest MIUI? From TWRP?
Where do I download the latest MIUI file?

elna.nitz said:
Thanks a lot, how do I flash latest MIUI? From TWRP?
Where do I download the latest MIUI file?
Click to expand...
Click to collapse
To flash the latest MIUI, this official document may help you: https://www.miui.com/shuaji-393.html
If you don't want to flash MIUI, but have the permission to unlock your device (IMPORTANT!), just flash the latest firmware and the new TWRP, then reboot to fastboot and unlock your phone.
If anything went wrong during the second way, your phone will be not able to boot unless flashing MIUI. If you just failed to unlock your device, but flash the new firmware and TWRP successfully before reboot, you will still have chance to boot into the recovery and flash the new rom with "locked bootloader".

WJXXBSH said:
To flash the latest MIUI, this official document may help you: https://www.miui.com/shuaji-393.html
If you don't want to flash MIUI, but have the permission to unlock your device (IMPORTANT!), just flash the latest firmware and the new TWRP, then reboot to fastboot and unlock your phone.
If anything went wrong during the second way, your phone will be not able to boot unless flashing MIUI. If you just failed to unlock your device, but flash the new firmware and TWRP successfully before reboot, you will still have chance to boot into the recovery and flash the new rom with "locked bootloader".
Click to expand...
Click to collapse
I can get permission to open the device only after connecting to my MI account through the device when installed on it official miui.
Therefore I seem to have previously had flash latest MIUI then log in to MI account and submit a request to open bootloader. Am I right?

elna.nitz said:
I can get permission to open the device only after connecting to my MI account through the device when installed on it official miui.
Therefore I seem to have previously had flash latest MIUI then log in to MI account and submit a request to open bootloader. Am I right?
Click to expand...
Click to collapse
Yes, if you want to unlock your device. A Mi account is needed to do this, on the latest MIUI version (if stable version "10.1.1.0" doesn't work, the develop version of MIUI is needed).

WJXXBSH said:
To flash the latest MIUI, this official document may help you: https://www.miui.com/shuaji-393.html
If you don't want to flash MIUI, but have the permission to unlock your device (IMPORTANT!), just flash the latest firmware and the new TWRP, then reboot to fastboot and unlock your phone.
If anything went wrong during the second way, your phone will be not able to boot unless flashing MIUI. If you just failed to unlock your device, but flash the new firmware and TWRP successfully before reboot, you will still have chance to boot into the recovery and flash the new rom with "locked bootloader".
Click to expand...
Click to collapse
Ok
I flashed latest firmware and TWRP 3.3.0, then Unlock bootloader with Mi Unlock.
Then flashed Lineageos 17 successfully.
The problem is that when I try to flash Gapps pico I get eror 70...
I tried to search for the font folder in the system path in TWRP File explorer and I couldn't find it (System Folder is empty) .
I tried reboot to system anyway, and after a long boot with the logo of the Lineageos 17, device initializing itself back to Recovery.
What else can we do?

elna.nitz said:
Ok
I flashed latest firmware and TWRP 3.3.0, then Unlock bootloader with Mi Unlock.
Then flashed Lineageos 17 successfully.
The problem is that when I try to flash Gapps pico I get eror 70...
I tried to search for the font folder in the system path in TWRP File explorer and I couldn't find it (System Folder is empty) .
I tried reboot to system anyway, and after a long boot with the logo of the Lineageos 17, device initializing itself back to Recovery.
What else can we do?
Click to expand...
Click to collapse
The latest version of lineage-17.0 could boot properly (tested my self). However, you flash the GAPPs and got interrupted halfway, which may cause some strange issues.
To fix this, format "/system" and flash the rom again. After that, mount "/system" manully in TWRP, then you could modify "/system" with the TWRP file manager.
There is another way to solve the GAPPs problem: If you're using magisk, try some modules that could install GAPPs without modifying "/system" (eg. "Weeb GAPPs"). Android 10 takes more free space in "/system" than Android 9 at present, even if without the fonts, it still has possibility that makes the GAPPs installation failed (this way works in lineage-16.0, which has 2.5× free space than 17.0).

WJXXBSH said:
The latest version of lineage-17.0 could boot properly (tested my self). However, you flash the GAPPs and got interrupted halfway, which may cause some strange issues.
To fix this, format "/system" and flash the rom again. After that, mount "/system" manully in TWRP, then you could modify "/system" with the TWRP file manager.
There is another way to solve the GAPPs problem: If you're using magisk, try some modules that could install GAPPs without modifying "/system" (eg. "Weeb GAPPs"). Android 10 takes more free space in "/system" than Android 9 at present, even if without the fonts, it still has possibility that makes the GAPPs installation failed (this way works in lineage-16.0, which has 2.5× free space than 17.0).
Click to expand...
Click to collapse
Ok, I deleted the Notosansjfk.ttc from fonts & android viwe system app, And now I am able to flash Gaaps pico and boot to system.
But when I run the system and try to get to the System User Interface Launcher course, you can't use your device. Probably happened because I deleted the font or the Android view system..
Any solutions?

elna.nitz said:
Ok, I deleted the Notosansjfk.ttc from fonts & android viwe system app, And now I am able to flash Gaaps pico and boot to system.
But when I run the system and try to get to the System User Interface Launcher course, you can't use your device. Probably happened because I deleted the font or the Android view system..
Any solutions?
Click to expand...
Click to collapse
You deleted the "Android System Webview" without installing a new one? That's not a good news after all, because every APP that contains webview will crash. The CJK font will not cause any serious problems, just make some words a "◻".
As a solution, if you could use Play Store, just install "Android System Webview" from there. Otherwise, you could still install one through ADB.
Download the webview app here (if Play Store not working): https://www.apkmirror.com/apk/googl...em-webview-78-0-3904-108-android-apk-download

WJXXBSH said:
You deleted the "Android System Webview" without installing a new one? That's not a good news after all, because every APP that contains webview will crash. The CJK font will not cause any serious problems, just make some words a "".
As a solution, if you could use Play Store, just install "Android System Webview" from there. Otherwise, you could still install one through ADB.
Download the webview app here (if Play Store not working): https://www.apkmirror.com/apk/googl...em-webview-78-0-3904-108-android-apk-download
Click to expand...
Click to collapse
Finally I installed Weeb Gapps magisk Moudle, and The majority are fine.
There are 2 problems:
1. The device feels very lag in the opening of the apps and in the transition between them.
2. After restart takes the device nearly 2 minutes to find a cellular network

Related

[ROM] AOSP 7.x for Galaxy S 4G

Code:
Code:
/*
* Your probably long expired warranty is now void.
*
* I am not responsible for bricked devices, dead SD cards,
* thermonuclear war, or you getting fired because the alarm app failed. Please
* do some research if you have any concerns about features included in this ROM
* before flashing it! YOU are choosing to make these modifications, and if
* you point the finger at me for messing up your device, I will laugh at you
* and point my finger right back at you.
*/
Installation Instructions
It will wipe your entire SD card! In order to make things work better, I've set it up to use the entire SD card as /data as opposed to having two partitions. The advantage is that you don't have to pick a size of /data.
If on a BML rom (stock-based GB)...
Untested, but is setup to hopefully work. If it doesn't flash my 6.0 Omni first
1. Reboot to recovery
2. Make sure your version of CWM is at least 5.x
3. Install zip. First time will fail and let you know its repartionning. Second time it will reboot a couple of times, don't be worried.
4. If you want gapps, reboot to recovery, wipe data+cache and install gapps.
5. If you want root, flash according to instructions in Post #3
If on an MTD rom (CM7 and all ICS+)
1. Reboot to recovery
2. Wipe data, dalvik/art cache, system, and cache partitions
3. Install zip. First time will fail and let you know its repartionning. Second time it will reboot a couple of times, don't be worried.
4. If you want root or Gapps, install them now.
The first boot can take several minutes. Be patient. If it takes 20+ minutes, pull the battery and reboot to recovery.
Things to Take Note Of
I actually have a T959P, not a T959V... It was released by Telus in Canada. It is a very similar device (I can run ROMs for the T959V with limited problems - ie sometimes I get wakelocks and the gps never works), it has a different GPS chipset and also uses different cell bands (but I can still use your guys modems but I lose access to the 850Mhz band). I have created a build specifically for the T959V as best as I can guess.
If you're coming from either the last Lollipop build or the initial pre-release Marshmallow build, there is a bug in TWRP that will prevent flashing anything but the ROM. To get around this, please flash the Marshmallow zip, then reboot to recovery, and then follow the typical instructions.
If you decide to install gapps at a later date (ie after you've installed the ROM), you must do a factory reset first - otherwise you will get force-closes upon bootup
If you come across a bug, feel free to let me know by posting in this thread. I will not be working non-stop on this project, but will try to fix bugs that affect me as this is still my main phone (out of choice, not necessity).
This build is very close to the official AOSP source code. Recovery is TWRP but otherwise there aren't any added "features"
Gapps eat up about an extra 30MB of RAM so they slow down the device - tread carefully. Opengapps pico works on the latest 7.0 build, untested on 7.1 but should work just fine
Backup Backup Backup! I'm not responsible for you losing any data.
Working
Camera (built-in app needs workaround, see below)
RIL
SMS
Recovery
Bluetooth - first time it won't enable if enabling through settings, back out and then second time it will. Works just fine from status bar pulldown
Wifi
Vibration
Automatic Brightness
Compass
GPS on T959P, untested on T959V
Headset Buttons
SElinux in enforcing mode - this may have broken the T959V's gps...
Partially working
Camera and Browser apps need to have all their permissions manually enabled through settings for full functionality. This is because I've used the older Camera app (which hasn't been updated for dynamic permissions) and the older Browser app as the new one is simply a test shell with no features (thanks Google!)
What's been removed
TV-Out - It was removed upstream plus I think binary blobs would need a ton of shimming in Lollipop+
Everything else is not tested!!!
XDA:DevDB Information
AOSP 7.x for Galaxy S 4G, ROM for the Samsung Galaxy S 4G
Contributors
xc-racer99
Source Code: https://github.com/xc-racer99/
ROM OS Version: 7.x Nougat
ROM Kernel: Linux 3.0.x
Based On: AOSP
Version Information
Status: Beta
Created 2016-10-22
Last Updated 2016-10-21
Thanks Time!
Thanks Time!
This would not have been possible without the following people:
Thanks to humberos for bringing Lollipop to the first-gen Galaxy S series. This would not have been possible without his work.
Thanks to FB and Dao for their work on the CM-11 device tree. I used several of their fixes.
Thanks to noiphonehere for his device trees and kernel, most of my work was based off of his.
Thanks to the OMAP4 AOSP team for their work on porting CMA to a 3.0 kernel.
Thanks to bhundven and the other members of teamacid for their work on the aries kernel.
Thanks to all others that have helped get this phone to where it is today!
Thanks to vcmerritt. A name you're probably not familiar with, but he was the only one to create something for the T959P and without him I'd still be on stock...
Build your own!
Follow https://source.android.com/source/initializing.html. The branch you want when you run repo init is the latest tag from https://source.android.com/source/build-numbers.html#source-code-tags-and-builds for your desired android version (7.0 or 7.1). Before you run repo sync, from the WORKING_DIRECTORY/.repo folder, run "git clone https://github.com/xc-racer99/local_manifests -b BRANCH" where BRANCH is either aosp-7.0 or aosp-7.1. Continue on with the build guide, the device codename you want is "galaxys4gmtd".
If you want to build the kernel, follow the instructions in WORKING_DIRECTORY/kernel/samsung/aries/AOSP_README. Put the resulting arch/arm/boot/zImage in device/samsung/galaxys4gmtd-kernel
Other aries devices (captivate, i9000, i9000B, vibrant) should be fairly easy to do (ie the galaxysmtd on my github as well as the captivate trees work). The fascinate and p1 would need a fair bit of work.
Changelogs
Changelog for 2016-12-19
December security patches
goes back to the older graphics drivers so hardware recording works but has a kernel patch to prevent crashes
Tweaked the graphics drivers options so it seems a little bit faster
Tweaked the RIL a little bit for better stability
Other things I've forgotten about, see github for details
Changelog for 2016-12-19-V2
Kernel without slowdowns....
Changelog for 2017-1-19
selinux to enforcing - this may break the T959V's GPS - if it does, let me know and send me a dmesg and I'll fix it
Update to the interactive governor - should have less slowdowns if using the default governor
Slightly better RIL reliability (I think)
Better low memory killing - we now don't run out of memory as often
Hardware decoding re-enabled
Slightly less intensive background services
Based on 7.1.1_r13
Source Code, Downloads, Root Options
Main Source
https://android.googlesource.com/
Device Specific Source Code
http://github.com/xc-racer99/android_device_samsung_telusgalaxys4gmtd for the device tree (see aosp-7.x branch)
http://github.com/xc-racer99/android_device_samsung_aries-common for the common device tree (see aosp-7.x branch).
http://github.com/xc-racer99/android_kernel_samsung_aries for the kernel (see aosp-7.x branch)
http://github.com/xc-racer99/proprietary_vendor_samsung for the prop blobs (see aosp-7.x branch)
http://github.com/xc-racer99/android_patches for all the patches necessary for the device to work properly (see aosp-7.x branch)
Downloads!
All builds can be downloaded from AndroidFileHost at https://www.androidfilehost.com/?w=files&flid=58191
Gapps
The smallest http://opengapps.org/ package for 7.0 is known to work, but any small 7.0 gapps package should work. However, they will cause the device to slowdown significantly as they use a fair bit of RAM. Gapps are untested on 7.1
This ROM is compatible with MicroG (https://microg.org/ and http://forum.xda-developers.com/android/apps-games/app-microg-gmscore-floss-play-services-t3217616) gapps. This is an open-source reimplementation of Google Play Services that doesn't track you and uses way less battery than the original.
Root
Root is achieved via Magisk or SuperSU.
MagiskDue to our odd partition layout, you need to use my custom Magisk install zip (source code here) attached to this post and not the official install or the Magisk Manager install. Then follow the instructions on how to root/install other modules from http://forum.xda-developers.com/apps/magisk/official-magisk-v7-universal-systemless-t3473445 Also, don't try to use the official Magisk uninstall tool as it won't work.
SuperSU
Please note: I've been told this doesn't work any more, YMMV
Again, we need a custom SuperSU install zip for it to work due to our partition scheme. It should be an all-in-one zip so it's simplier than Magisk (but not open source). This is based off of the latest (at time of writing) 2.79SR1 release, the diff is below
Code:
diff --git a/META-INF/com/google/android/update-binary b/META-INF/com/google/android/update-binary
index d437f6f..3a312bf 100644
--- a/META-INF/com/google/android/update-binary
+++ b/META-INF/com/google/android/update-binary
@@ -642,16 +642,23 @@ detect_systemless_required() {
find_boot_image
CONTINUE=true
+if false ; then
if [ -z "$BOOTIMAGE" ]; then
# no boot image partition detected, abort
return
fi
+fi
# extract ramdisk from boot image
rm -rf /sutmp
mkdir /sutmp
+if false ; then
check_zero "" "" "" "LD_LIBRARY_PATH=$RAMDISKLIB $BIN/sukernel --bootimg-extract-ramdisk $BOOTIMAGE /sutmp/ramdisk.packed"
+else
+ mount /ramdisk
+ cp /ramdisk/ramdisk.img /sutmp/ramdisk.packed
+fi
check_zero "" "" "" "LD_LIBRARY_PATH=$RAMDISKLIB $BIN/sukernel --ungzip /sutmp/ramdisk.packed /sutmp/ramdisk"
if (! $CONTINUE); then return; fi
@@ -1331,6 +1338,8 @@ else
ui_print_always "Boot image patcher"
ui_print "******************"
+if false ; then
+ # SGS Modification - we don't have a "real" boot image
ui_print "- Finding boot image"
find_boot_image
@@ -1357,6 +1366,10 @@ else
fi
check_zero_def "- Extracting ramdisk" "LD_LIBRARY_PATH=$SYSTEMLIB /su/bin/sukernel --bootimg-extract-ramdisk $BOOTIMAGE /sutmp/ramdisk.packed"
+else
+ mount /ramdisk
+ cp /ramdisk/ramdisk.img /sutmp/ramdisk.packed
+fi
check_zero_def "- Decompressing ramdisk" "LD_LIBRARY_PATH=$SYSTEMLIB /su/bin/sukernel --ungzip /sutmp/ramdisk.packed /sutmp/ramdisk"
if ($CONTINUE); then
@@ -1545,6 +1558,7 @@ else
check_zero_def "- Calling user boot image patch script" "sh /data/custom_boot_image_patch.sh /sutmp/boot.img"
fi
+if false ; then
if ($CONTINUE); then
DEV=$(echo `resolve_link $BOOTIMAGE` | grep /dev/block/)
if [ $? -eq 0 ]; then
@@ -1564,6 +1578,10 @@ else
dd if=/sutmp/boot.img of=$BOOTIMAGE bs=4096
fi
+else
+ cp /sutmp/ramdisk.packed /ramdisk/ramdisk.img
+ umount /ramdisk
+fi
rm -rf /sutmp
fi
Link for the download ROM is not working... it is private... ?!?
Here is the link to the rom that is not private https://www.androidfilehost.com/?w=files&flid=58191
pickandrew said:
Link for the download ROM is not working... it is private... ?!?
Click to expand...
Click to collapse
Shaggy_thecat said:
Here is the link to the rom that is not private https://www.androidfilehost.com/?w=files&flid=58191
Click to expand...
Click to collapse
Thanks, I used the link that I would use if I was already logged in, my bad. OP is now updated.
It's been a while, no home internet and very busy life lately but the time I did get The 7.0 zip to flash (0930) it was running very well, no random reboots and limited freezes (just 1 really)
BUT. I always reinstall a new ROM to get the process down and- I haven't been able to get it running again. Let alone with root which I haven't managed to do. When I install the ROM now it gives me a quick first boot however it says encryption unsuccessful and asks me to reset. Resetting and factory resetting as well as formatting won't help it.
Excellent work ^_^ you're becoming the new SGS4G guru around here
As for a new setting in the dev options, labeled Consistent Logging-- if I turn this on is it A: Safe in terms of information vulnerability and B: Will it fill up my SD card quickly with a mass amount of logging data?
graycow9 said:
It's been a while, no home internet and very busy life lately but the time I did get The 7.0 zip to flash (0930) it was running very well, no random reboots and limited freezes (just 1 really)
BUT. I always reinstall a new ROM to get the process down and- I haven't been able to get it running again. Let alone with root which I haven't managed to do. When I install the ROM now it gives me a quick first boot however it says encryption unsuccessful and asks me to reset. Resetting and factory resetting as well as formatting won't help it.
Excellent work ^_^ you're becoming the new SGS4G guru around here
As for a new setting in the dev options, labeled Consistent Logging-- if I turn this on is it A: Safe in terms of information vulnerability and B: Will it fill up my SD card quickly with a mass amount of logging data?
Click to expand...
Click to collapse
Hmm, flash the ROM, go into recovery, change the filesystem of /data to ext4 or f2fs. The error sounds as if the sdcard is formatted as fat while it shouldn't be. If that doesn't work, please send me the contents of /sdcard/aries_mtd.log after you've installed it.
Hadn't noticed the new "persistent logging" section. I suspect that what it does it keep the logcat contents over a reboot. Since the logcat does have a max size, it is probably safe to enable it. I highly doubt it contains any more info than a regular logcat.
Thanks for keeping this device alive in this community! My kids wanted to use it for simple games so I dusted it off and came here to see if anything was still in development and sure enough there was!
I tested going from BML stock and it worked! I had to restart the install 5 times, but it ultimately took. The first two times installed TWRP, then it rebooted into TWRP. Then it took 3 additional times before it went through the whole install. It booted up fine, but I had messed up and forgot to do a full reset before install gapps. So it would boot the encryption screen telling me it was interrupted and I had to reset the phone. Unfortunately at that point no matter what I did it would always boot to that encryption error screen. So I wiped completed and started over but mistakenly flashed the 7.1 build. It went through but was stuck on a boot loop. So now i can't install 7.0 because it keeps telling me it can't install over newer builds. Is there anything I can do to fix this or do i have to start from stock all over again?
Edited* Update
I went ahead and started from scratch but still ran in to the same problem with the encryption. Didn't install gapps this time.
Domunus said:
Thanks for keeping this device alive in this community! My kids wanted to use it for simple games so I dusted it off and came here to see if anything was still in development and sure enough there was!
I tested going from BML stock and it worked! I had to restart the install 5 times, but it ultimately took. The first two times installed TWRP, then it rebooted into TWRP. Then it took 3 additional times before it went through the whole install. It booted up fine, but I had messed up and forgot to do a full reset before install gapps. So it would boot the encryption screen telling me it was interrupted and I had to reset the phone. Unfortunately at that point no matter what I did it would always boot to that encryption error screen. So I wiped completed and started over but mistakenly flashed the 7.1 build. It went through but was stuck on a boot loop. So now i can't install 7.0 because it keeps telling me it can't install over newer builds. Is there anything I can do to fix this or do i have to start from stock all over again?
Edited* Update
I went ahead and started from scratch but still ran in to the same problem with the encryption. Didn't install gapps this time.
Click to expand...
Click to collapse
Ok, sounds like a messed up somewhere. I'll do some testing and try to release an updated build. Could you please post the output of /sdcard/aries_bml.log and /sdcard/aries_mtd.log? The "Encryption Unsuccessful" message sounds as if the SD wasn't properly formatted to ext4/f2fs.
Hi xc-racerr99, I found what the issue was. Apparently I had an extra partition on the sdcard. After removing it and running the install script again everything booted up and i'm now using the ROM! It's awesome I have Nougat on this old Galaxy S. Without Gapps it's been running really stable and very responsive..
However, at this point, I've tried opengapps pico and TKgapps pico and neither work. The script runs and says update completed, but it's too fast. When I boot to the ROM no gapps were installed. Is there another gapps you would recommend trying?
Domunus said:
Hi xc-racerr99, I found what the issue was. Apparently I had an extra partition on the sdcard. After removing it and running the install script again everything booted up and i'm now using the ROM! It's awesome I have Nougat on this old Galaxy S. Without Gapps it's been running really stable and very responsive..
However, at this point, I've tried opengapps pico and TKgapps pico and neither work. The script runs and says update completed, but it's too fast. When I boot to the ROM no gapps were installed. Is there another gapps you would recommend trying?
Click to expand...
Click to collapse
Odd, I thought my install script removed the extra partition.
Anyways, it sounds as if there's some issue with recovery. You could try replacing the ramdisk-recovery.img in the ROM zip you downloaded with the one from https://www.androidfilehost.com/?fid=457095661767105384. Then reboot to recovery and flash your gapps package again.
Doesn't work....
I'll try to do some more testing with gapps and from stock with 1 or 2 partitions when I get a chance.
I figured out a sure fire way to boot 7.0, I'm running it as I respond with XDA app right now. But to keep it short if possible, I just fix permissions then factory wipe before I run the zip- do this while on CWM right after you heimdall to BML.
So to recap:
1- Flash to stock via heimdall
2- Fix permissions + factory wipe
3- Flash 7.0 zip
4- TWRP should boot- so flash ROM once more - wipe caches
5- Reboot and chew some nougat
Will follow up with a log next time I try to get the 7.1 rolling. ?
Oh! And when I add my email (hotmail) I get a bad handshake everytime. Do I need gapps to sync my contacts?
Sent from my SGH-T959V using XDA-Developers mobile app
graycow9 said:
I figured out a sure fire way to boot 7.0, I'm running it as I respond with XDA app right now. But to keep it short if possible, I just fix permissions then factory wipe before I run the zip- do this while on CWM right after you heimdall to BML.
So to recap:
1- Flash to stock via heimdall
2- Fix permissions + factory wipe
3- Flash 7.0 zip
4- TWRP should boot- so flash ROM once more - wipe caches
5- Reboot and chew some nougat
Will follow up with a log next time I try to get the 7.1 rolling.
Oh! And when I add my email (hotmail) I get a bad handshake everytime. Do I need gapps to sync my contacts?
Sent from my SGH-T959V using XDA-Developers mobile app
Click to expand...
Click to collapse
Yeah, I get a bad handshake as well. Only happens with hotmail/oulook accounts, my gmail and my other email work just fine.
I figured out what was causing the issues with install from BML - on TWRP boot, it wasn't setting up the sdcard properly. I've now fixed it so that it should work regardless (in the next build, obviously).
Anyways, it sounds as if there's some issue with recovery. You could try replacing the ramdisk-recovery.img in the ROM zip you downloaded with the one from https://www.androidfilehost.com/?fid=457095661767105384. Then reboot to recovery and flash your gapps package again.
Click to expand...
Click to collapse
Gave this a try and still no luck.
Update **
It actually killed the recovery. Recovery just keeps crashing and rebooting when trying to get in to it. Tried it from the a clean install and same results. Will wait for your next build. Thanks for putting time in to this!
Odd, it lets me add my gmail but only syncs my emails- no option for contacts still. I ought to keep a vcf from my other device jic.
The performance is even better than M and it doesn't have the weird battery glitch anymore ?? (I think the new partition layout helped a lot.)
Another thing I noticed, sometimes my SIM won't register or gives me a no signal indicator. I can't get root still either[emoji14]still poking around. Looking forward to the next build ?
Edit: Another bug I noticed is the inability to save files through the browser or Tumblr app for example.
(By the way, just wanted to add, I hope I'm still being more help than a nag or something. I aim to be helpful. So I look for things that seem astray. Heh)
Sent from my SGH-T959V using XDA-Developers mobile app
graycow9 said:
Odd, it lets me add my gmail but only syncs my emails- no option for contacts still. I ought to keep a vcf from my other device jic.
The performance is even better than M and it doesn't have the weird battery glitch anymore (I think the new partition layout helped a lot.)
Another thing I noticed, sometimes my SIM won't register or gives me a no signal indicator. I can't get root still either[emoji14]still poking around. Looking forward to the next build
Edit: Another bug I noticed is the inability to save files through the browser or Tumblr app for example.
(By the way, just wanted to add, I hope I'm still being more help than a nag or something. I aim to be helpful. So I look for things that seem astray. Heh)
Sent from my SGH-T959V using XDA-Developers mobile app
Click to expand...
Click to collapse
I've never used the contact sync.
With SIM not registering, it's because Google introduced a bug and the workaround the bug causes the SIM to occasionally not work. One of the problems with legacy devices I guess.
With the files not saving, manually grant the storage permission in Settings->Apps - it doesn't seem to automatically update for most apps.
With root, sounds like I should modify the SuperSU install zip as it's easier to use (but not open-source). For the PHH Superuser, you need
1) The Magisk-7-SGS.zip from my thread.
2) The phh-superuser-r259.zip from the Magisk root thread (link in OP)
3) The PHH Superuser app from the Play Store or FDroid
Even then, it only works for certain apps as it doesn't mount anything to /system/xbin/su which is what some apps look for
Edit: And I have no issues if you keep posting here with the problems you find, it's good to know.
bootloop
just tried to flash this 7.1 rom from your omnirom 6.0. Seemed to flash ok as described. couldn't get pico opengapps to flash but ignored it. Now it's stuck in a bootloop and I can't get into recovery using hardware buttons. Any guidance as to how I should proceed? As a relative novice, can I push a new recovery through ADB and try again?
asmalldharma said:
just tried to flash this 7.1 rom from your omnirom 6.0. Seemed to flash ok as described. couldn't get pico opengapps to flash but ignored it. Now it's stuck in a bootloop and I can't get into recovery using hardware buttons. Any guidance as to how I should proceed? As a relative novice, can I push a new recovery through ADB and try again?
Click to expand...
Click to collapse
Well, it depends on where you are bootlooping. If you're stuck at either of the first two splash screens, then you're out of luck with ADB as it isn't available yet. If you're bootlooping but getting to the bootanimation, then you can. To do so, run
Code:
$ adb root
$ adb shell mkdir /data/ramdisk
$ adb shell mount /dev/block/mtdblock5 /data/ramdisk
$ adb push ramdisk-recovery.img /data/ramdisk
$ adb reboot recovery
where ramdisk-recovery.img is from the AOSP 7.0 zip.
If you're stuck at the first or second splash screens, then you need Odin or Heimdall. With heimdall, you can do
Code:
$ heimdall flash --KERNEL boot.img
where the boot.img is the one from Omni 6.0, the one from 7.x won't work on its own as the recovery is not stored in it. You can use Odin to go back to stock.
I haven't tried gapps so I guess I should sometime and see what the issue with them is.
Gets to the second splash screen. I'll give that a shot when i have some free time. I'm really looking forward to getting this working as I'm amused by the idea of my oldest android phone running the newest OS before my other two.
Update: couldn't get it to work with my cheap laptop. Kept throwing up the libusb 12 error. Then when i finally gave up and pulled the battery, I noticed it was starting to bulge a little. I think I'm out for a while. I'm hoping i can come back to this soon.
Sent from my A0001 using XDA-Developers mobile app

[GUIDE] TREBLE on Moto Z All variants for dummies [GSI][TWRP][ROOT][PLAY SERVICES]

Hi everyone!
I present to you the practical and simple guide special for dummies that will allow you to try and use the wonders of google treble project in our beloved Moto Z [Griffin has no official support but...] thanks to the great work of the highly recognized developer @erfanoabdi we can enjoy project treble in an easy way [*could apply user restrictions] in our griffin.
*First of all, this guide is designed for those who are curious and have a high degree of autonomy when they try to solve low level or common problems of the Android system. You dont need to be a developer but you must have experience in using and applying the following words: unlocked bootloader, ADB and Fastboot basic commands, Lineage OS, TWRP, Magisk , Back to Stock, Frustration, No "daily driver user" or maybe according to your needs, contribute to general knowledge, dont demand from me more than here is already here because I'm not a developer, I'm just a curious user who likes to try new things in his griffin and I have already given you more than 168 hours of trial and error with the only goal of making the process easier and more fun to you.
Now let's go to what interests us, do you have your bootloader unlocked?
If the answer is no, go here and do it or you can not continue
First we start with the files that we need to download:
Latest Lineage OS from here:
https://download.lineageos.org/griffin
[Thanks to Erfanoabdi]GSI image of your favorite flavor from here:
https://mirrors.lolinet.com/firmware/gsi/
Only type A not AB just A like ColorOS-Aonly-9-20190605-ErfanGSI.img.7z not ColorOS-AB-9-20190605-ErfanGSI.img.7z and decompress the .7z file to get the IMG file inside.
To decompress the .7z file
https://www.7-zip.org/download.html
If everything goes to hell [100% sure to happen at least once] Stock ROM and adb-fastboot-latest.rar from here:
https://forum.xda-developers.com/moto-z/development/stock-moto-z-8-0-firmware-t3805226
Thanks to @thuybang for the post and @erfanoabdi again for the needed files.
Official TWRP from here:
https://dl.twrp.me/griffin/twrp-3.3.1-0-griffin.img.html
Latest Stable Magisk from here:
https://forum.xda-developers.com/apps/magisk/official-magisk-v7-universal-systemless-t3473445
Thanks to @topjohnwu
Magisk module "Device Spoofing Tool" from here:
https://forum.xda-developers.com/apps/magisk/qa-want-to-install-modules-magisk-v13-3-t3800435
Thanks to @Dreamer(3MF)
Device ID apk from here:
https://androidfilehost.com/?fid=673956719939830832
Latest Android System WebView APK from here:
https://www.apkmirror.com/apk/googl.../android-system-webview-76-0-3809-36-release/
Finally put this on favorites because you will need it for the final touch:
https://www.google.com/android/uncertified/
Only if you have all those files downloaded and placed in your PC in the folder that you want you can continue.
Now the easy way step by step if you are on Official Stock ROM:
1 - Reboot to Bootloader and flash twrp-oemasvendor-2.img you can use ADB and fastboot of the .rar adb-fastboot-latest.rar that you ¿downloaded? from the back to stock link
Use
Code:
fastboot flash recovery twrp-3.3.1-0-griffin.img.img
Hard-reboot to bootloader again, down two steps and select reboot to recovery.
2 - Already in TWRP do this:
2.1 - Wipe Data - if it gives you error go reboot and select reboot recovery and again wipe data it should have been erased without errors, back and
2.2 - Manually wipe caches, system, vendor, data, internal storage
2.3 - Do "Swipe to Factory Reset" probably not necessary but for me it works.
3 - Now connect your Griffin and copy the Lineage OS ROM downloaded [obviously still inside of TWRP]
3.1 Go to Install and select the copied Lineage ROM and then install
3.2 Finished the installation restart and skip all startup, now in the launcher screen shutdown your griffin
4 - Power on your griffin again in bootloader, two steps down and select reboot recovery again.
4.1 - Now in TWRP copy the GSI type A image that you downloaded [MIUI, ColorOS, OneUI, Pixel, Flyme OS, etc)
4.2 - Allready copied go to Install and select "Install Image"
4.3 - Now you see the .IMG file, select and then flash as "System" and go let finish, clear cache and restart to System.
5 - Be very patient, you will see the warning image for having your bootloader unlocked for 5 to 10 seconds [may vary] then you will see the start animation according to the GSI image that you will select before, again be very patient it can take 3 to 15 minutes to your griffin to start completely (MIUI 3-5 minutes, Pixel 3-5 minutes, OneUI 5-10 minutes, Flyme 15 to 20 minutes in my experience) If you see that the start animation reduces its brightness after a few minutes, it means that we are on the right track wait a little longer.
5.1 - Finally we start system we enter directly without previous configurations (configure wifi, google account, PIN, etc) just start screen now go to step 6, if not then go here:
If everything goes to hell [100% sure to happen at least once] Stock ROM and adb-fastboot-latest.rar from here:
https://forum.xda-developers.com/moto-z/development/stock-moto-z-8-0-firmware-t3805226
Thanks to @thuybang for the post and @erfanoabdi again for the needed files.
And start again
6 - Ok you are one of those who managed to install and start their GSI image and you dont have google services enabled and your griffin is not certified you probably have app errors that crash infinitely [if they are 1 or 3 - example the camera] manage to go to app administration in the ROM and cancel auto-start of that apps, instead if you have so many apps errors that dont let you move anything in the interface you need to go to TWRP and clean davlink cache and cache and reboot.
That's why this step is important
Code:
4.3 - Now you see the .IMG file, select and then flash as "System" and go let finish, [B][COLOR="Red"]clear cache and restart to System
[/COLOR][/B].
7 - Now Root your griffin with Magisk, you know how otherwise I dont know how you got here
8 - Already in system, install the "Device Spoofing Tool" magisk module and reboot to activate the module.
9 - Again already in system, install Device ID APK
9.1 - Open Device ID app and find your device’s GSF (Google Service Framework) Device-ID
9.2 In your PC go HERE and use your GSF to register and certify your griffin
10 - Now install Android System WebView APK
10.1 - Go to TWRP again and clean cache one more time and reboot to system
11 - Configure your google account and be happy
11.1 - Camera its a common fail, use Gcam or Snapdragon Camera instead of GSI stock camera app
12 - Enjoy your griffin :highfive:
Well that's all from me and remember if something goes wrong or it does not work you can always go here:
If everything goes to hell [100% sure to happen at least once] Stock ROM and adb-fastboot-latest.rar from here:
https://forum.xda-developers.com/mot...mware-t3805226
Thanks to @thuybang for the post and @erfanoabdi again for the needed files.
The 99.99999999 percent of all this, maybe more, it's thanks to @erfanoabdi If you want to thank someone, buy a coffee for him.
Screenshots (sorry just from MIUI with my emotion I forgot to save from the other GSI that I proble) I feel comfortable with MIUI and now it is my ROM-GSI of daily use in my griffin (I really love taking screenshot with my three fingers )
https://ibb.co/bmDkRrz
https://ibb.co/HX3mghC
https://ibb.co/10jGLNr
https://ibb.co/jz6njXm
https://ibb.co/vv1Nr2F
https://ibb.co/9Gr29nv
https://ibb.co/qsZ2pFD
https://ibb.co/948H110
https://ibb.co/42nXM72
https://ibb.co/Jd73QwC
https://ibb.co/vVs15Hq
https://ibb.co/MVfptZ5
https://ibb.co/SywLwrW
https://ibb.co/ZXvg0QG
https://ibb.co/z8DF8L1
https://ibb.co/bBv1wxW
https://ibb.co/09nBnHW
Finally dont be mad with my english, itis very bad and I use translator
Thanks for guide, very cool
Official TWRP is updated with treble support BTW
Nice ,thanx to your contributions.
whats the waiting time for the moto image? ive installed the moto image, and still waiting for the device to bootup. its been about 15 mins
---------- Post added at 07:46 PM ---------- Previous post was at 07:25 PM ----------
after installing the image, im stuck on this (device will boot in 5 seconds screen) Can i boot back into recovery, and re install the image? its been more than 30 mins on this screen
Pixel image is the only one I managed to boot, but couldn't get gsf id from it, and it constantly force closed (cache was cleaned) and couldn't make it work at all. Moto image just gives black screen, all other images couldn't even be installed (either error in twrp or something else.) I'll try miui image one of these days, but would really like to try to make pixel image work, but without gsf id it's impossible
EDIT: Changed twrp to twrp-oemasvendor-2.img version, and managed to boot miui (but after magisk it bootlooped) and to start booting moto GSI images (moto bootloops), and just tried to boot pixel images, will see later... but I think that the problem was that twrp uses cache as vendor partition, and deleting cache, well, deletes vendor partition (will need clarification from @erfanoabdi on this)...
Can we flash the GSI over other Custom ROMs like the OMNI instead of Lineage...?
anwesh said:
Can we flash the GSI over other Custom ROMs like the OMNI instead of Lineage...?
Click to expand...
Click to collapse
Nop, Omni does not have the type of partition needed
After following this guide, I am able to boot into system (only with Pixel or MIUI GSI), but SIM is not getting detected. Frequent app crashes are also observed. Cache and dalvik are being cleared before booting...
Do I still need to follow this How to make GSI...?
But LOS 16 seems to flash vendor image, isn't it...?
What am I missing...?
By the way, clearing vendor partition always gives me an error...
anwesh said:
After following this guide, I am able to boot into system (only with Pixel or MIUI GSI), but SIM is not getting detected. Frequent app crashes are also observed. Cache and dalvik are being cleared before booting...
Do I still need to follow this How to make GSI...?
But LOS 16 seems to flash vendor image, isn't it...?
What am I missing...?
By the way, clearing vendor partition always gives me an error...
Click to expand...
Click to collapse
Go to TWRP and make full wipe factory, that fix the problem
I've been hunting down and trying out some different gsi's. With the latest twrp + los16 installed I've had success with some from this list
https://github.com/phhusson/treble_experimentations/wiki/Generic-System-Image-(GSI)-list
AOSP 10 with gapps included
Msm xtended gapps included
Blissrom + gapps
Aosip + gapps
EvolutionX gapps included
DU13 + gapps (not on list but works)
If installing gsi's without gapps included, let it boot first then reboot TWRP and install gapps + magisk if you want root.
Available kernel ?
I cannot retrieve the GSF id, how can I fix this?
Flashed OneUI GSI but it's stuck on the boot logo
So on my Moto Z running LineageOS 17, I can't launch Netflix on it. Will Treble-ing my Moto Z fix that problem?
This also works on moto z force?

[ROM] [UNOFFICIAL] LineageOS 13 |ASUS Memo Pad HD 7 (me173x) [MT8125]

Disclaimer:
LineageOS (Lineage Android Distribution) members or anyone else on this website is not responsible for bricked devices, dead SD cards, thermonuclear war, or you getting fired because the alarm app failed. Please do some research if you have any concerns about features included in the products you find here before flashing it! YOU are choosing to make these modifications, and if you point the finger at us for messing up your device, we will laugh at you. Your warranty will be void if you tamper with any part of your device / software.​
How to Install:
1- BACKUP, BACKUP, BACKUP, All will be WIPED!
2 - Unlock bootloader instructions here
3 - Flash the new mandatory TWRP Recovery
4 - Move Rom & Gapps (optional) into device storage
5 - Full Wipes
6- Flash Rom & Gapps (gapps are OPTIONAL)
for GAPPS:
Choose Gapps Package "ARM" > "6.0" > "Pico" or "Nano" visit OpenGAPPS
Working:
Boots
Storages
Bluetooth
Wifi
GPS - GNSS
Audio
Charging
Offline Charging
Video decoding/ Playback (i.e.: Youtube) up to 720p
android marshmallow new features: Adoptable Storage / Multi Window / etc
DRM Widevine : For Netflix, Amazon Prime, etc
Sensor: magnetometer: akm8963
Front Camera: mt9m114_mipi_raw
Front camera: GC0339_RAW
etc ....
NOT Working:
Rear Camera: a5142_mipi_raw
Front Camera: GC0339_RAW (ME173X 8GB) Fixed on build 20220629
Sensors: accelerometer (autorotation)
You tell me
Special Thanks
OMNI Rom
LineageOS
DerTeufel1980 & fire855 ( my Team mates from M.A.D)
GPL Compliance:
GitHub - dragonpt/android_device_asus_me173x: ASUS ME173x device for LineageOS 12.1 & LineageOS 13
ASUS ME173x device for LineageOS 12.1 & LineageOS 13 - GitHub - dragonpt/android_device_asus_me173x: ASUS ME173x device for LineageOS 12.1 & LineageOS 13
github.com
GitHub - dragonpt/android_kernel_asus_me173x_new: ASUS ME173x [MT6589 - MT8125] Custom Kernel for LineageOS 12.1 / 13 / 14.1
ASUS ME173x [MT6589 - MT8125] Custom Kernel for LineageOS 12.1 / 13 / 14.1 - GitHub - dragonpt/android_kernel_asus_me173x_new: ASUS ME173x [MT6589 - MT8125] Custom Kernel for LineageOS 12.1 / 13 / ...
github.com
--> "asus_mm" branchs
FAQ
Small FAQ:
Q: How can i Unlock the Bootloader?
A: Instructions for Unlocking the Bootloader can be found here
Q: After locking the screen, the screen is all black, and/or flickering and I'm forced to reboot, how can I fix this?
A: If you have this issue, then your device uses the second screen/lcm hardware revision
( the lgld070wx3_dsi_vdo ), please use the second kernel.zip for this variant, it'll be added an second kernel . zip for people with this variant, on the download section with the ROM release
Q: how to flash this second kernel for the new hardware variant ?
A: After flashing the ROM, flash the second kernel afterwards
Q: Where are the Developer Options?
A: Go to Settings>About Tablet, and tap 7 times on the Build Number
Q: Where is the multi-window mode?
A: in the developer options, you can enable it there
Q: How can i root this rom?
A: you can use Magisk , or SuperSU
Magisk: v.23
SuperSu v2.82
note: Magisk builds v24.x and v25.x do NOT work.
Q: Do i really need to update recovery?
A: YES
Q: I can't flash this Rom on recovery, why?
A: You need to update your recovery to TWRP
Q: how to work with twrp?
A: in the first time TWRP boots, it'll ask if you want to allow modifications, slide to YES
Q: how to wipe and flash in twrp?
A: Go "mount" and mount "system"
then go "wipe" > and wipe dalvik / cache / data / System
Q: How can i flash the new recovery?
A: If you already have an custom recovery installed:
Download the new TWRP recovery zip
flash the new recovery
reboot to recovery again, TWRP should be now installed
If you don't have any custom recovery installed:
- You can extract the "recovery.img" from the .zip
- Open an terminal
- Boot to fastboot mode, and type:
Code:
fastboot flash recovery recovery.img
then reboot:
Code:
fastboot reboot
Q: I Love your work, how can i thank you?
A: You can press the "Thanks" button, and if you wish, you can pay me a beer
..
Changelogs
Build 20201221
First Release
Build 20210821
Kernel:
DCT / Power resolve more issues
LCM: nt35521_dsi_vdo: Add backlight enable ctrl function
Fix magnetometer sensor: akm8963
Battery: Corrections
Camera LENS AF (for the rear camera) fixed
Front Camera : mt9m114_mipi_raw ( ME173X 16GB Version) fixed
mmc: more handling fixs
msdc: more fixs
Touch Panel: GT927: Implement a proper suspend & resume
Some other small fixs.
LineageOS source and device:
LineageOS LiveWallpapers, Wallpapers are now included ( as per-user requests)
Gello browser removed, it's depricated and has security risks
Disable Live Display by default (not supported by this device)
Some device clean up
Fix some eGL crashs
Fix some core missing symbols
Added Front camera support ( Pictures )
Some other small fixs.
Build 20220629
Kernel:
Security: Fix the following security issues:
PG SU daemon security fix
CVE-2017-1000365
CVE-2017-2618
CVE-2017-2671
CVE-2016-10208
CVE-2016-10208
CVE-2013-4312
CVE-2016-2550
CVE-2017-9074
CVE-2017-9075
CVE-2017-9076
CVE-2017-9077
CVE-2017-9242
LVT-2017-0002
CVE-2012-6703
CVE-2015-8944
CVE-2016-3857
CVE-2016-9555
CVE-2017-8890
ARM: spectre-v1
ARM: spectre-v2
ARM: Merge some bug fixs
imgsensors:
mt9m114_mipi_raw: Enable NightMode & Improve NightMode handling (better handling of Low light pictures)
gc0339_raw support added (CMOS front camera used in some HW revisions)
Memory management / Others:
Merge ZRAM from Kernel 3.10 version, and backport K 3.10 ZRAM fixs
Merge zsmalloc from Kernel 3.10 version, and backport K 3.10 ZRAM fixs
Add support for LZ4 decompression in the Linux Kernel
Other minor fixs
LineageOS source and device:
device: Added 512 MB Virtual SWAP Memory
Fix GPU PowerVR blobs crash, leading to random reboots & wakeup reboots
Disable OpenGL preloading with PowerVR drivers
SHIM: Add UI shim lib to fix some other random crashs
Remove max app limit
ART: Increase and fine tune the heap limit
Camera & nvram blobs fixs
Other minor fixs
Build 20220718
Fixed Bluetooth, that got broken by mistaque on 20220629 release
Downloads
TWRP 3.1.1
TWRP_3.1.1_ME173X.zip | by superdragonpt for Generic Device/Other
Download GApps, Roms, Kernels, Themes, Firmware, and more. Free file hosting for all Android developers.
www.androidfilehost.com
Build 20220718
https://androidfilehost.com/?fid=15664248565197191338If you have the second hardware Screen revision by LG (check FAQ), flash this
kernel for the Build 20220718
https://androidfilehost.com/?fid=15664248565197191342
Old Builds
Build 20220629
https://www.androidfilehost.com/?fid=15664248565197184858If you have the second hardware Screen revision by LG (check FAQ), flash this
kernel for the Build 20220629
https://www.androidfilehost.com/?fid=15664248565197184860
Build 20201221
lineage-13.0-20201221-UNOFFICIAL-me173x.zip | by superdragonpt for Generic Device/Other
Download GApps, Roms, Kernels, Themes, Firmware, and more. Free file hosting for all Android developers.
www.androidfilehost.com
If you have the second hardware Screen revision (check FAQ), flash this
kernel for the Build 20201221
Kernel_rev2_Build_20201221.zip | by superdragonpt for Generic Device/Other
Download GApps, Roms, Kernels, Themes, Firmware, and more. Free file hosting for all Android developers.
www.androidfilehost.com
Build 20210821
https://www.androidfilehost.com/?fid=7161016148664790672If you have the second hardware Screen revision by LG (check FAQ), flash this
kernel for the Build 20210821
https://www.androidfilehost.com/?fid=7161016148664790675
Man, you're awesome
But I have issue with wifi. Cant turn it on and my mac adress is 02:00:00:00:00
Bluetooth also not working
gadom92 said:
Man, you're awesome
But I have issue with wifi. Cant turn it on and my mac adress is 02:00:00:00:00
Click to expand...
Click to collapse
Same here
Awesome work, thx and merry xmas
gadom92 said:
Man, you're awesome
But I have issue with wifi. Cant turn it on and my mac adress is 02:00:00:00:00
Bluetooth also not working
Click to expand...
Click to collapse
This seems to be the very same issue some users had with Lineage 12.1...
can** replicate this on my units.
EDIT: i meant, can't replicate this
please try this:
[ROM] [UNOFFICIAL] LineageOS 12.1 |ASUS Memo Pad HD 7 (me173x) [MT8125]
Disclaimer: LineageOS (Lineage Android Distribution) members or anyone else on this website is not responsible for bricked devices, dead SD cards, thermonuclear war, or you getting fired because the alarm app failed. Please do some research if...
forum.xda-developers.com
Settings > Backup & reset
superdragonpt said:
This seems to be the very same issue some users had with Lineage 12.1...
can replicate this on my units.
please try this:
[ROM] [UNOFFICIAL] LineageOS 12.1 |ASUS Memo Pad HD 7 (me173x) [MT8125]
Disclaimer: LineageOS (Lineage Android Distribution) members or anyone else on this website is not responsible for bricked devices, dead SD cards, thermonuclear war, or you getting fired because the alarm app failed. Please do some research if...
forum.xda-developers.com
Settings > Backup & reset
Click to expand...
Click to collapse
Did not solve the problem so far. Wifi is even broken after restoring the los 12.1 backup which worked before
Edit: uploaded logcat
Ok, i reflashed the old carliv recovery via fastboot after installing Los13 and i got wifi back ...
And afterwards i flashed twrp again via fastboot and wifi is still working...
Previously i flashed the twrp zip from carliv, i guess this was part of the problem
reflashing recoveries in fastboot not worked for me :/
I also wiped everything including internal storage before, and bootet into each of the two recoveries and to the system from there.
Maybe the carliv recovery changes some things on the system, idk.
Hi, I am so glad that this is still alive project
I upgraded recovery via mtk flesher. Just rename twrp 3.1.1... into recover.img and click "download".
My wifi and bluetooth are working. Sometimes bluetooth have conflict with wifi and plain reboot fix things.
It is strange that not a single one sensor work(acceleration and gravity, magnetic field, orientation and rotation. They all worked in 12.1 beside rotation. Hope thing are going to get fixed up.
Had a few freezes also(hard reset do the job)
Overall I have a feeling that this is smoother than 12.1.
EDIT: It was misleading about recovery flash. You need to extract from twrp_3.1.1_ME173X.zip "recovery.img" and replace in folder where scatter file with old "recovery.image" is.
Gronkdalonka said:
I also wiped everything including internal storage before, and bootet into each of the two recoveries and to the system from there.
Maybe the carliv recovery changes some things on the system, idk.
Click to expand...
Click to collapse
interesting... likely the wiping of internal storage fixed it..
if anyone is having this issue, please try and report back if the following fixs:
in twrp:
Flash this test kernel
AndroidFileHost.com | Download GApps, Roms, Kernels, Themes, Firmware and more. Free file hosting for all Android developers.
Download GApps, Roms, Kernels, Themes, Firmware, and more. Free file hosting for all Android developers.
www.androidfilehost.com
cheers
Merry Xmas
superdragonpt said:
interesting... likely the wiping of internal storage fixed it..
if anyone is having this issue, please try and report back if the following fixs:
in twrp:
Flash this test kernel
AndroidFileHost.com | Download GApps, Roms, Kernels, Themes, Firmware and more. Free file hosting for all Android developers.
Download GApps, Roms, Kernels, Themes, Firmware, and more. Free file hosting for all Android developers.
www.androidfilehost.com
cheers
Merry Xmas
Click to expand...
Click to collapse
not working :/
edit: Flashed old recovery trough Flash Tool, than TWRP in Flash tool wipe all what i can and then install LOS 13. Wifi working like a charm
Any chance you can help with source patches?
First of all thanks to snapdragon for the new LOS13 support.
I'm sorry to tell you that all of your mentioned ways to get WiFi back to work did not work for me. What I did and what I tried:
Normal installation way:
Flashed new recovery via old custom recovery
complete wipe
flashed new LOS13 via new TWRP recovery
WiFi not working!
Going back to old custom recovery and back to TWRP
Flashed old custom recovery via TWRP
complete wipe
flashed new TWRP custom recovery via adb sideload since my sd card can only be mounted via new TWRP recovery
complete wipe
flashed new LOS13
WiFi still not work!
This is all I did. I realized that fastbood mode is not working for my device, could be a driver problem since my device is installed as ùó something when plugging it into the pc in fastboot mode, so I tried the way via adb.
Hint: I have the model with the alternative hardware, so the second kernel is required to fix flickering display issue.
I realized that the new TWRP recovery has this issue aswell, so my display is flickering from the right side to the center sometimes in TWRP recovery.
Any ideas what could help getting WiFi back to work?
Thanks in advance!
Edit: Could it be that this WiFi problem has something to do with the following thread:
FIX FOR MAC 02:00:00:00:00(WiFi and hotspot not turning ON)
Important. Root required..... Hey everyone,I saw so many posts regarding Android & iOS that the Mac address is changing to 02:00:00:00:00 and WiFi is greyed out. None of the WiFi or hotspot not turning on.I get the same problem in my Condor and...
forum.xda-developers.com
I read over some postings and googled the mac address 02.00.00.00.00 and it seems that a lot of devices had this problem when updating from android 5 to 6. It seems that it could have something to do with the partitions where the info (mac address, IMEI) are stored, but in general I have not found a solution and a specific description of the problem.
Anyway: If the problem can be solved by doing the steps described in the thread I provided above I’m not able to solve this. I would not describe me as a noob, but it seems that I need root and knowledge of permission management for the fix, and I am not very familiar with Linux.
Could you do the following test:
In twrp:
Full wipes ( system, etc etc and internal storage) be sure you back up your stuff
Then reboot to recovery
( It'll warn there's no OS installed)
Back to recovery
Do full wipes again , plug the tab into pc and copy the rom to internal storage
Reboot to recovery again
( It'll warn again, there's no OS installed)
Proceed to flash the rom
This has worked with a user
Issue: for an unknown reason some devices seems to fail mounting / reading nvram
@ twrp I'll do a build for people with this second hardware revision, flickering is annoying...
Thanks for your fast reply.
I did two full wipes with rebooting into recovery after each wipe as you said, then I copied the OS zip file to internal storage and rebooted again to recovery.
After installing the ROM I rebootet to system and LineageOS was preparing the first start. I started without flashing the kernel for alternative hardware (2nd kernel) to check if it works first.
I'm sorry to tell you that I still got no WiFi and Bluetooth connections, Mac address still is shown as 02-00-00-00-00, WiFi cannot be turned on.
Edit: Seems that is has nothing to do with wipes (on my device). I've tried all kind of wipes via TWRP
Format Data -> yes -> reboot to recovery
Advanced Wipe -> check all (Davlik, Cache, Data, Internal Storage, System -> Again format data -> Yes -> reboot to recovery
flashed ROM, 2nd Kernel and GApps -> Reboot to recovery -> reboot to system
Still no WiFi. Perhaps I should try to go back to stock rom and see if WiFi works there? Do you think this could make the deal?
test this
full wipes
flash rom, then this kernel afterwards
AndroidFileHost.com | Download GApps, Roms, Kernels, Themes, Firmware and more. Free file hosting for all Android developers.
Download GApps, Roms, Kernels, Themes, Firmware, and more. Free file hosting for all Android developers.
www.androidfilehost.com
Again, thanks for your efforts, it seems to be a really tough and bugging one, since the new kernel did also not fix the problem.
Edit: Just to keep u updated: I just flashed old recovery and afterwords old LineageOS 12, WiFi is working well. So there must be some problem with the update or the update process. I will try to wipe first and then install new recovery and again install new OS, perhaps this will do the job.
Edit2: BTW I forgot to tell you that I had problems with settings -> about tablet -> status on lineageos 12. Just remembered because i wanted to have a look to the mac address. I get an error telling me "unfortunately, settings has stop". Perhaps important for the update?
Important Edit3:
Guess what: I made it to work. I did the following to do it:
1. Format Data and do all wipes possible with TWRP recovery. Reboot to recovery and do the same again.
2. TWRP recovery -> install old recovery
3. In old recovery -> install via sideload (adb sideload) lineageOS12 and second Kernel (for me because of hardware)
4. Boot to system and check if WiFi works well (finish the initialization of the device and connect to a WiFi)
5. Boot to recovery (old recovery) -> WITHOUT WIPING install via sideload TWRP recovery
6. Boot to system. (Still lineageos12) check if WiFi still works
7. Boot to TWRP recovery -> WITHOUT WIPING install lineageos13.
8. Boot to system, finish initialization if necessary and check if WiFi still works.
9. Go to setting and do a factory reset from lineageos13 settings
10. Device will reboot to recovery and do the factory reset and automatically will boot back into system.
11. Finish. All should work now.
I don't know what exactly did the job, so I wanted to provide all steps I did.
Since I never flashed an android custom Rom over another without wiping I don't know what errors this procedure can cause. So if someone knows that please let me now that I can have a look if there are errors.
Thanks again for your assistance.

[ROM][Huawei][11][UNOFFICIAL] CAOS - Android 11 for Huawei device

C A O S [UNOFFICIAL]
Your warranty is now void!
We're not responsible for bricked devices, dead SD cards,
thermonuclear war, or you getting fired because the alarm app failed. Please
do some research if you have any concerns about features included in this ROM
before flashing it! YOU are choosing to make these modifications, and if
you point the finger at us for messing up your device, we will laugh at you​
CAOS (Custom AOSP OS) is a project which based on phhuson's Treble GSI AOSP 11. CAOS is a modified AOSP by eretemin which I modified to be compatible with Huawei hi6250 phones. I also provided several patches
Changelog :
CAOS 316 March 2022 version
March 2022 SPL
CAOS 315+ Febrary 2022 version
Febrary 2022 SPL
CAOS 315 January 2022 version
January 2022 SPL
Fix all storage/permission in social apps like instagram, messenger.
implemented Huawei IMS patches
added Seedvault app and option in Treble app for activating it
full fixes access for media files from some apps like WhatsApp or Telegram
backported changes from v400h device_phh_treble: All devices support unprocessed audio source
patch for gsicharger removed, should fix offline charger animation for some devices (need test)
volume dialog UI now follows rounded corners
added CAOS logo image
CAOS 314 December 2021 version
Initial build
Decembre 2021 SPL
Integrate NFC, Miracast/cast , Live Display patches
Add media patch (Fix "Error loading media" in social apps like instagram, messenger..)
Pre-requisite :
You must have TWRP installed, use this one (make sure to have the unofficial Android 11 one ! ).
Installation :
Download this file caos-v316-220321-arm64-iceows-huawei.7z:
go to TWRP
flash this file Huawei-Decrypt-Emui_8.zip to change mount data partition (disable FBE : FileBaseEncryption)
format data
reboot to TWRP again
do a full wipe (system, data, cache, dalvik/art cache) !
reboot to bootloader
extract the img from caos-v316-220321-arm64-iceows-huawei.7z
run: fastboot flash system <drag system.img here>
reboot to TWRP
resize system
(optional) flash patches :
1 - Google Apps lite : [RECOVERY]LiteGapps_arm64_11.0_v2.6_official.zip
2 - Enable AGPS : 7-AGPS-FIX-AltairVendor-v3.6-signed.zip
3 - If you are on EMUI 8.0.0.408 or sup : 8-Huawei-PRA-FixPreav-A-v1.1-signed.zip
reboot to System and set up the phone with Lineage first start assistant. You can also add most
reboot to System
(optional) install GCamGo (GoogleCamera_2.12.413042791.apk)
Enjoy !!!
Not Working :
Nothing
ROM OS Version: Android 11
ROM Kernel: Linux 4.4.x (stock 4.4.26 or Siberia_4.4.302-1.1.zip)
ROM Firmware Required: EMUI 8.0.0.360 ---> 8.0.0.402
Based On: Caos (eremitein)
Credits:
eremitein
And all the others who tested my patches and helped me improve this ROM
CAOS11 Project
GSI Treble patches. Included Phh, Andy Yan and my personal Treble works. You can using patches/solutions from here and from linked manifests (all or few my own) in none-commercial usage only and yo...
github.com
Support Group
reserved
Is there any specificity to this ROM ? I mean, compared to Lir and LeaOS you posted recently, or DotOS which is more about performance ?
Hykosit said:
Is there any specificity to this ROM ? I mean, compared to Lir and LeaOS you posted recently, or DotOS which is more about performance ?
Click to expand...
Click to collapse
CAOS , LiR, DotOS, crDRom etc. are AOSP GSI ROMs based on 'phhusson' sources, so the difference in performance, battery life, etc. is minimal. And all have some common bugs- VoLTE, native call recording, offline charging etc. If you like to take pictures, you will be disappointed with the camera...(btw, Footej camera 2-premium is a good enough replacement for gcam).
The main differences between these ROMs are in the customization options.
In my experience CAOS is faster, crDRom is customization monster, LiR is a perfect balance between battery efficiency, performance and the customization. As for DotOS, the previous version 5.1.3 was better.
hi Alf.
Indeed it is a good comparison of the different ROMs. For charging go to PHH trebble option and enable fastcharging to 4000ma. For the Volte it is in progress..., and for the camera I provide GCAM in addition
AltairFR said:
For charging go to PHH trebble option and enable fastcharging to 4000ma.
Click to expand...
Click to collapse
-Alf- said:
offline charging
Click to expand...
Click to collapse
AltairFR said:
I provide GCAM
Click to expand...
Click to collapse
try Footej 2-premium and you'll see what I'm talking about...
Thanks you two ! That's good stuff to know
AltairFR said:
For charging go to PHH trebble option and enable fastcharging to 4000ma
Click to expand...
Click to collapse
But won't this one harm the battery ?
-Alf- said:
try Footej 2-premium and you'll see what I'm talking about...
Click to expand...
Click to collapse
So I looked for this one, unfortunately the app was sell to an other company (ZipoApp), and seeing the recent opinions on google play the app was just monetized and the premium is now 10€ by damn week, and people fear for user privacy ... Smell like a bad story to me
Do you have any old apk, from before the acquisition ?
moriel5 said:
Disclaimer: I am a simple user, and am not affiliated with Semaphore or ZipoApps.
Recently, Footej Camera (or officially, Footej Camera 2) was bought by ZipoApps.
After seeing things like the buyouts of software like QuickPic or certain (legacy) parts of Nano Defender and the resulting consequences, naturally I was concerned with this, especially when ZipoApps's line of business is buying existing apps and monetizing them.
After some sleuthing, I managed to get the personal cellular number of ZipoApps's CEO, Alik Hochner (I am not going to divulge any more information about how and what was needed for this, to preserve his and other involved people's privacy), and I just spoke with him a few minutes ago.
While I am not completely reassured, due to not having experience with ZipoApps's history, he did strike me as someone who does want to be able to monetize apps while protecting user's privacy to the best of his abilities, though understandably limited by the tools the current market offers without being independent of the mass market.
Make of that what you will, I will continue to keep an eye on the matter, to see whether this turns out to be a turning point for such buyouts for the better or not.
Click to expand...
Click to collapse
from :
[Android 5.0+] Footej Camera 2 2021.5.6
Get it on Google Play A brand new, fascinating, user-friendly and robust camera app is here, ready to capture, orchestrate and give a new life to your best moments… *** If you have any problem or if you can't find manual controls, before give...
forum.xda-developers.com
Hykosit said:
Do you have any old apk, from before the acquisition ?
Click to expand...
Click to collapse
Yes, look here
-Alf- said:
try Footej 2-premium and you'll see what I'm talking about...
Click to expand...
Click to collapse
For my part I have no problem with offline charging. Can you describe the problem?
AltairFR said:
For my part I have no problem with offline charging. Can you describe the problem?
Click to expand...
Click to collapse
I suppose it was a question for me.
I was wondering if changing initial charging values could be harmful to the longevity of the battery as those are (i think) calibrated for specific values
AltairFR said:
For my part I have no problem with offline charging. Can you describe the problem?
Click to expand...
Click to collapse
On A/B GSI doesn't work at all (Kirin-devices).
-Alf- said:
On A/B GSI doesn't work at all (Kirin-devices).
Click to expand...
Click to collapse
Ok
Hykosit said:
So I looked for this one, unfortunately the app was sell to an other company (ZipoApp), and seeing the recent opinions on google play the app was just monetized and the premium is now 10€ by damn week, and people fear for user privacy ... Smell like a bad story to me
Do you have any old apk, from before the acquisition ?
Click to expand...
Click to collapse
Here is install this apk, it is modified:
- cleaned resources,
- disable wakelock,
- disable loging and analitics,
- enable premium version
AltairFR​GOOD work !!!
AltairFR​Hi Master. Please make ROM with all patches for a variety...
Nusantara_v3.2-11-arm64_avN-29082021-OFFICIAL-0849.img.xz
NusantaraROM - GSI
NusantaraProject ROM GSI (Generic system image ROM) For all devices with supported project treble.
www.pling.com
I have flashed this to Honor 8 frd-l19 (emui 8 device). Some problems have been tackled down now with help of dev, thanks to that. Apparently only things to do for now would be able to create misc folder at /data/misc and also credstore at /data/misc/credstore to be able to boot now.*1
Any ideas how to get those folders done? atm. I can access to phone via adb while phone stays at CAOS logo screen, maybe between 10-15mins.
I've tried to:
sudo adb root
adb remount rw, /data
which succees
then
sudo adb shell
cd data
mkdir misc
but get error
mkdir: '/data/misc': Read-only file system
I've also tried to install busybox at twrp*2, but using it via twrp terminal doesn't give su or sudo. When trying without su and just busybox mkdir /data/misc/ it seems to create one and I can even cd to it and create subfolder. After changing right permissions and using chown to those folders everytjing seems to be good. Sure twr doesn't show misc_ce and misc_de etc under data which were tegere when using adb.
Well no surprise that reboot habgs to CAOS logo and when xhecking via adb shell thete's no misc folder under data.
Can anyone give some tips how to be able to create those folders since I can't use adb via twrp or stock recovery. Also strange that when remounting /system as rw I can push & echo changes to there, but not able to create directories to /data after doing the same.
If someone can help, I will shere needed steps to get this running at Honor 8 frd, unless that will just revel next layer of problems.
*1 Device will boot to OS at first boot, won't boot after restart. So after logs there could b found reasons and now tried to fix those with help of dev and might be at the stage that to create folders just once again will be fix.
*2 I have found only 2 different twrp images, both at version 3.2.1-0 which are suitable for this device, others haven't work at all.
I don't have a solution but LiR build doesn't seem to have that problem. I could reboot many times on a hi3650 P9
huuhaa_tm said:
I have flashed this to Honor 8 frd-l19 (emui 8 device). Some problems have been tackled down now with help of dev, thanks to that. Apparently only things to do for now would be able to create misc folder at /data/misc and also credstore at /data/misc/credstore to be able to boot now.*1
Any ideas how to get those folders done? atm. I can access to phone via adb while phone stays at CAOS logo screen, maybe between 10-15mins.
I've tried to:
sudo adb root
adb remount rw, /data
which succees
then
sudo adb shell
cd data
mkdir misc
but get error
mkdir: '/data/misc': Read-only file system
I've also tried to install busybox at twrp*2, but using it via twrp terminal doesn't give su or sudo. When trying without su and just busybox mkdir /data/misc/ it seems to create one and I can even cd to it and create subfolder. After changing right permissions and using chown to those folders everytjing seems to be good. Sure twr doesn't show misc_ce and misc_de etc under data which were tegere when using adb.
Well no surprise that reboot habgs to CAOS logo and when xhecking via adb shell thete's no misc folder under data.
Can anyone give some tips how to be able to create those folders since I can't use adb via twrp or stock recovery. Also strange that when remounting /system as rw I can push & echo changes to there, but not able to create directories to /data after doing the same.
If someone can help, I will shere needed steps to get this running at Honor 8 frd, unless that will just revel next layer of problems.
*1 Device will boot to OS at first boot, won't boot after restart. So after logs there could b found reasons and now tried to fix those with help of dev and might be at the stage that to create folders just once again will be fix.
*2 I have found only 2 different twrp images, both at version 3.2.1-0 which are suitable for this device, others haven't work at all.
Click to expand...
Click to collapse
I have tried several roms on my honor 8 but It gets stuck with the logo ( Waiting for solutions

How To Guide [OUTDATED - PLEASE USE UNOFFICIAL LINEAGEOS INSTEAD] Installing a GSI on Samsung M12/A12.

I am deleting this guide since M12 will soon recieve an unofficial build of LineageOS 19.1. Don't ask when, as I'm not the lead developer but I helped with it
Update 1: I figured out how to make script run on boot. Instructions revised. If you followed earlier check them again
Update 2: Magisk 24.1 is now stable. Instructions revised.
Update 3: I contacted phh and he implemented the script inside his trebleapp. Instructions revised and modified trebleapp is attached. NOTE: GSIs newer than 7/Feb/2022 will include this workaround by default.
Update 4: This guide is now unnecessary now that unofficial LineageOS is very close to release
Achievement unlocked: flashed GSI with FBE enabled! ​
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
In short, I've successfully done flashing of @phhusson's latest version of Android 12 GSI (which is v402 as of today). To do this, I needed to modify the multidisabler script so it won't disable FBE, format the userdata using the stock recovery, flash TWRP, resize tmpfs to proper size, push GSI image into tmpfs and flash it using TWRP. I used the securized image with vndklite variant, since there was no securized images for regular vndk releases (but it seemed that vndk was working better for me, at least I have no USB connection anymore where with VNDK I was able to have USB debugging). Maybe I'll try re-flashing it once I'll patch the regular images and securize them (since I'm on *nix, I can just mount them and modify their contents) and take an approach of finding how Samsung ROMs are working OK. For now, I need to take a break from all bootloops I had in the process of FBE flashing .
Anyway, the goal of this experiment was to use GSI ROMs as a daily driver and having FBE disabled could otherwise cause a serious problem on device loss.
So, onto the list what's been tested (that wasn't noted before):
Screen locking – it seems that the workaround for the screen is not applied before unlocking the phone, probably because the app is not running yet. This might work with the script used as postfs module.
EDIT: I've found some notes in the Magisk documentation that both post-fs data and late_start services are run after data is decrypted, which basically means applying this workaround using Magisk seems to be pointless for now (maybe not after PPH app will stop providing the workaround)... Probably the best option would be patching the ROM itself, either with flashable ZIPs or directly before flashing it (most GSIs can be mounted under Linux and tweaked).
Adaptive brightness – not working, since all virtual sensors are not working for now. Might be easy to fix through as I've found some stuff in the official ROM that I had an idea to experiment with putting them into GSIs (as a Magisk module, to avoid a breakage).
USB – as I said, a data transfer via USB is not working for me for some reason. It worked for me once I had VNDK Android 12 GSI installed (same version).
Booting with stock kernel – I had some successful attempts doing that, but it further was a cause of a bootloop, at least once I had installed Magisk. Therefore, I'll recommend patching the Magisk the way as in tutorial (after patching the kernel) to have everything working for now.
For people who wants to play with stock images but don't know how: you can use simg2img, lpunpack and Linux to extract and mount the official ROM image in approach of finding there some tips like in initrc services why some stuff is working fine on Samsung while it doesn't on GSIs. Maybe I would tinker with it a bit, trying to export a few services and libraries in an approach to create a Magisk module with all stuff needed to have a fully functional GSI, but I'm tired of modding for now, especially when this is my first Samsung phone I had to deal with.
Edit: Typo fixes, added additional text formatting.
Amazing work. If you need testers feel free to PM me. As a sidenote, poking in sysfs led me to believe that android is sending the info needed to read the proximity but the kernel is sending garbage which gets interpreted as the sensor not being triggered. Also phh should have added the workaround into his trebleapp starting from phh AOSP 12 v401, so aside from installing magisk no post install workarounds should be needed.
Attached is a photo of what cmd_result reads when a whatsapp voice message is played which reads proximity to play the message in the earpiece and turn screen off when proximity is triggered
ap4ss3rby said:
Also phh should have added the workaround into his trebleapp starting from phh AOSP 12 v401, so aside from installing magisk no post install workarounds should be needed.
Click to expand...
Click to collapse
Unfortunately, the commit was reverted as of master branch, so we should prepare for it to stop to work unless phh will work on it before releasing an another version. Also I wrote that the workaround didn't seem to apply itself before unlocking the phone (FBE encrypted) the first time and therefore decrypting sensitive data after boot. For now this makes it an requirement when using PHH app to unlock the phone before it sleeps so the touch is going to be responsive.
Anyway, it seems that even Magisk (v24.1) is not capable of running the services before data is decrypted, so now I have no idea how to bypass that in other way than patching the ROM itself and creating the `initrc` service... Anyway, this is also a hint that what samsung is doing starts before basically everything, so no APK file nor script is going to really fix it since they are meant to start after data is decrypted...
SB3P said:
Unfortunately, the commit was reverted as of master repo, so we should prepare for it to stop to work unless phh will work on it before releasing an another version. Also I wrote that the workaround didn't seem to apply itself before unlocking the phone (FBE encrypted) the first time and therefore decrypting sensitive data after boot. For now this makes it an requirement when using PHH app to unlock the phone before it sleeps so the touch is going to be responsive.
Anyway, it seems that even Magisk (v24.1) is not capable of running the services before data is decrypted, so now I have no idea how to bypass that in other way than patching the ROM itself and creating the `initrc` service... Anyway, this is also a hint that what samsung is doing starts before basically everything, so no APK file nor script is going to really fix it since they are meant to start after data is decrypted...
Click to expand...
Click to collapse
I guess for now we have two options:
A: Build custom kernel/vendor specifically for GSIs that correctly reports sensors as GSIs expect them to
B: Fix GSI issues through Magisk services implementing various workarounds in scripts. (an example is the touchscreen sleep/wake issue)
ap4ss3rby said:
Attached is a photo of what cmd_result reads when a whatsapp voice message is played which reads proximity to play the message in the earpiece and turn screen off when proximity is triggered
Click to expand...
Click to collapse
Also that's interesting those virtual sensors are still present, I personally thought that Samsung made it the way there's an virtual device create as on Linux and there's their proprietary software running somewhere in the system that uses the camera as an input and calculates it to provide the data... On the other hand, when I think about that logic, even some (if not all) virtual devices on Linux (e.g. v4l2loopback) needs to have their module loaded with the kernel to work. I'm glad at least there's no need to reinvent the wheel and no one really needs to recreate the entire algorithm for it if it's going to be in the kernel sources...
ap4ss3rby said:
I guess for now we have two options (...)
Click to expand...
Click to collapse
I feel like the B option is worse than patching the GSI ROMs, either via flashable ZIPs or on your own... This is because I couldn't find anything in docs that would let me run services before /data is going to be decrypted... Personally, I've made myself a such service using the statically-compiled Linux ARM binary (non-NDK, using GNU libs – yes, it is still runnable on Android as well) – it applies the workaround for now both when screen is turned on and off (I had no idea on which event it should really run, so I made it to run on both just to be safe) by watching the file changes based on (AFAIK) filesystem events – so it has a major advantage over your script, as it won't run in endless loop, yet watch the file responsible for brightness to change and then do its job. But even with that, TSP doesn't seem to make touch available immediately and it is still expected to be revived after 1-2 seconds.
Also, as of the methods of applying these workarounds, the other way could be modifying the ramdisk (maybe with the help of Magisk, which I believe has documented how it's actually doing it itself and how others could modify the root and init as Magisk does to load files before the OS will properly initalize itself. Yet I don't like an idea of messing myself with the boot partition, at least for now...
Debug info: I tried flashing stock to grab logs from the touchscreen driver. The logs attached here do not appear at all on an unpatched GSI (I.E flashing the GSI as is without any touch workaround).
ap4ss3rby said:
Hi, I installed LineageOS 18.1 GSI on my M127F. I want to share my guide to installing this GSI.
Code:
DISCLAIMER:
By following this guide you accept that you
may do irreversible damage to your phone.
If something breaks the responsibility is
yours only. If you want stable software that
is guaranteed to work 100% don't follow
this guide.
I assume you are running a fully stock system and and locked bootloader and firmware U3/U4.
Installing TWRP and custom kernel
Enable Developer Options by tapping on software information > build number 7 times
Enter developer options then toggle OEM Unlocking on.
Power off your phone.
Hold Vol Up + Vol Down then plug in your phone to enter download mode
THIS WILL ERASE ALL YOUR DATA AND VOID YOUR WARRANTY. Follow on screen instructions to unlock your bootloader. THIS WILL ERASE ALL YOUR DATA AND VOID YOUR WARRANTY
After this you want to download and install attached Orangefox recovery using odin. After odin is done flashing enter recovery
Format data (not wipe) in recovery
Enter terminal and type multidisabler twice
Reboot to system and verify that under security encryption is disabled
Download TWRP and custom kernel for your phone
Reboot into recovery and locate the downloaded twrp image
Select recovery.
Reboot into recovery
Install kernel, then wipe cache and reboot. You should now see that it is complaining about some internal issue. This is normal.
Installing the GSI
Download your favorite ROM from the list provided below. You want to install an arm64 a/b image.
Extract the image file
Reboot to recovery.
Select install then install image
Locate the GSI image
Select install system
After that is done return to recovery and select factory reset.
Reboot then do setup (if applicable) then download attached magisk and phh trebleapp. If your phone is stuck on bootanimation check under to fix it.
IMPORTANT: DO NOT LET THE SCREEN TURN OFF OR YOU WILL HAVE TO REBOOT TO MAKE TOUCH WORK AGAIN.
Install attached magisk
Open magisk and click on install then direct install
Download and install the attached phh-treble app apk.
Touch should now work. Enjoy your GSI.
Extras
Magisk 24.1
Open Magisk
Go to settings
Update Magisk Manager app to version 24.1
Relaunch Magisk then install magisk
Choose direct instal
Migrating to patched trebleapp
Download and install attached trebleapp
Open your root file manager
go to /data/adb/service.d
Delete the script you added earlier
Tips in case things don't work
In case after rebooting to the GSI the phone bootloops:
Download stock image from wherever you download your firmware (I use a python program called samloader)
Extract the AP of the downloaded firmware
Find userdata.img.lz4 and create a .tar archive only containing this file
Reboot to download mode
In odin select AP then locate the newly created .tar archive Then click on flash
Reboot
Continue from step 7 under the "Installing the GSI" portion of the guide
To revive the touchscreen using ADB:
In case you didn't grant adb root access but installed magisk, run adb shell then su. A root access for the app shell will appear. Grant root permission
Plug in phone to a computer with ADB
adb shell
su
cat /sys/class/sec/tsp/cmd_result
echo check_connection > /sys/class/sec/tsp/cmd
What works:
Boots
RIL
Fingerprint
Main rear camera
Front camera
Sleep/Wake (workaround in steps above, may need to sleep wake several times before it works)
WiFi
Flashlight
Rotation
Magisk 24
90Hz (M12 only. A12 doesn't have 90Hz refresh rate)
LineageOS 18.1
LineageOS 19
CAOS (GApps variant available)
phh AOSP 11 v313
phh AOSP 12 v400h
Untested
GPS
Flashing GApps. (I use fdroid and aurora store on LineageOS and CAOS has built in GApps)
USB-OTG
A127F
M127G
If I didn't list it under broken or working I didn't try it or forgot to test it.
Broken
Double tap to wake. Touchscreen turns off and I have no idea how to keep it alive while lcd is off
MTP
Virtual Proximity. Screen will stay on in phone calls and WhatsApp will always play voice messages through speaker
Flashlight brightness. Flashlight will always stay on weakest brightness with no way to adjust.
Adaptive refresh. The framerate you set in phh addons is what you get. Be prepared for slightly reduced battery.
You tell me (even though I probably don't have the solution)
Bugs
You may need to wait a little bit before touchscreen responds or sleep/wake several times before screen responds after turning the screen off
Credits
@physwizz for kernel, TWRP and orangefox
@phhusson for implementing workaround in trebleapp as well as GSI list
me for touch workaround
Links
Kernels and recoveries: https://t.me/a127f_res/113
GSIs: https://github.com/phhusson/treble_experimentations/wiki/Generic-System-Image-(GSI)-list
Click to expand...
Click to collapse
Great guide.
Well done
Thanks for the great guide. Unfortunately, I don't know how to resize tmpfs. Can anybody tell me how to do that? I only have 4 GB or less on my Samsung Galaxy A12 with 64 GB of Storage (it should have, it only shows something like 3 or 4 gigabytes like I mentioned)
matahbeyz said:
Thanks for the great guide. Unfortunately, I don't know how to resize tmpfs. Can anybody tell me how to do that? I only have 4 GB or less on my Samsung Galaxy A12 with 64 GB of Storage (it should have, it only shows something like 3 or 4 gigabytes like I mentioned)
Click to expand...
Click to collapse
You don't have to resize TMPFS if you don't want to have FBE encryption or have the external SD card (you can use microSD for flashing, which might be a better choice if you need to flash a larger devices). Also you can't resize TMPFS to 64 GB, it uses your RAM to store regular data instead of storage (this is basically the concept of TMPFS). What I was mentioning is that /data won't work under FBE and custom recoveries for now, so you need to use your RAM instead if you don't have any external storage device to save images somewhere via ADB.
As of resizing the TMPFS, you should be able to find some Linux tutorial how to do that, on Android this is works basically the same (even on both Linux and Android you have /tmp directory with TMPFS by default).
Anyway, I've decided to share some stuff that you may need for that. Here's the multidisabler script I was using for flashing GSIs with FBE encryption preserved. I was also working on the native binary that would work as the workaround for the touchscreen so it can be used instead of the script. The advantages are that it actually listens to filesystem events and therefore does not need to read file in loop in order to get the information if brightness has changed. Maybe I'll share it with you once I find it to be ready, right now I'll just share my multidisabler script with patches.
BTW, I've tested LineageOS GSIs (both 11 and 12) and noticed they behave completely different, no matter of variant (the USB actually uses some driver, which is not fully compatible with M12 but close enough to provide basic communication through ADB). I guess pphusson just changed something and now these drivers aren't applied by default, yet I think I've noticed the issues with Bluetooth's HSP/HFP profiles which as I remember was not the case with latest stable pphusson's vanilla Android 12 GSIs. Now I just hope these problems are going to be resolved in the next builds of Android's GSIs with phhusson's patches and with the knowledge that MTP just worked fine on TWRP I used, there's a little hope that we will gain the proper combination of drivers/firmware to have both USB and Bluetooth functional at the same time someday.
I've also approached patching the kernel under newer kernel base 4.19.112, yet I gave up on properly resolving its conflicts. I may work on that as well in order to patch some vulnerabilities, with a hope that I'll succeed updating kernel as closest to the latest patch as possible. The 4.19.112 is going to be just a test if Samsung is capable of actually booting from it and if I may be able to use git with common human logic and my limited programming skills to actually patch it the way it would do so (without much understanding about the code itself, yet basic knowledge about C syntax). For now I've only succeed reproducing the upstream Linux kernel commit structure from 4.19.111, with a single additional commit for Samsung changes and another one for physwizz ones.
can anyone guide me how to unlock bootloader on Samsung Galaxy M12G ?
@SB3P Thanks so much. Sorry for my late reply, but thank you!
SB3P said:
Achievement unlocked: flashed GSI with FBE enabled! ​View attachment 5533799​In short, I've successfully done flashing of @phhusson's latest version of Android 12 GSI (which is v402 as of today). To do this, I needed to modify the multidisabler script so it won't disable FBE, format the userdata using the stock recovery, flash TWRP, resize tmpfs to proper size, push GSI image into tmpfs and flash it using TWRP. I used the securized image with vndklite variant, since there was no securized images for regular vndk releases (but it seemed that vndk was working better for me, at least I have no USB connection anymore where with VNDK I was able to have USB debugging). Maybe I'll try re-flashing it once I'll patch the regular images and securize them (since I'm on *nix, I can just mount them and modify their contents) and take an approach of finding how Samsung ROMs are working OK. For now, I need to take a break from all bootloops I had in the process of FBE flashing .
Anyway, the goal of this experiment was to use GSI ROMs as a daily driver and having FBE disabled could otherwise cause a serious problem on device loss.
So, onto the list what's been tested (that wasn't noted before):
Screen locking – it seems that the workaround for the screen is not applied before unlocking the phone, probably because the app is not running yet. This might work with the script used as postfs module.
EDIT: I've found some notes in the Magisk documentation that both post-fs data and late_start services are run after data is decrypted, which basically means applying this workaround using Magisk seems to be pointless for now (maybe not after PPH app will stop providing the workaround)... Probably the best option would be patching the ROM itself, either with flashable ZIPs or directly before flashing it (most GSIs can be mounted under Linux and tweaked).
Adaptive brightness – not working, since all virtual sensors are not working for now. Might be easy to fix through as I've found some stuff in the official ROM that I had an idea to experiment with putting them into GSIs (as a Magisk module, to avoid a breakage).
USB – as I said, a data transfer via USB is not working for me for some reason. It worked for me once I had VNDK Android 12 GSI installed (same version).
Booting with stock kernel – I had some successful attempts doing that, but it further was a cause of a bootloop, at least once I had installed Magisk. Therefore, I'll recommend patching the Magisk the way as in tutorial (after patching the kernel) to have everything working for now.
For people who wants to play with stock images but don't know how: you can use simg2img, lpunpack and Linux to extract and mount the official ROM image in approach of finding there some tips like in initrc services why some stuff is working fine on Samsung while it doesn't on GSIs. Maybe I would tinker with it a bit, trying to export a few services and libraries in an approach to create a Magisk module with all stuff needed to have a fully functional GSI, but I'm tired of modding for now, especially when this is my first Samsung phone I had to deal with.
Edit: Typo fixes, added additional text formatting.
Click to expand...
Click to collapse
Could you explain how you done this.... i mean please explain step by step... i am using Galaxy M12G Varient....thanks in advance
milindbhaliwade said:
Could you explain how you done this.... i mean please explain step by step... i am using Galaxy M12G Varient....thanks in advance
Click to expand...
Click to collapse
If you would see the *untested* section at the initial post of this thread, it is unknown whetever this works or not for M127G phones (if it bootloops it might not work at all). Anyway, here's how I did it on M127F (at least how I remember this):
1. I did steps from 1-6, I believe I skipped 7 since I was aware it will mess something up with the data partition.
2. I modified the multidisabler script and pushed it to my phone via the ADB (to TMPFS). You can find this script pushed as xz compressed file. Before executing multidisabler script I have done a backup of the recovery and system partitions (using dd tool) which I am going to reflash later.
3. I rebooted to download mode and flashed TWRP image.
4. After TWRP ended flashing, I booted into the recovery. I flashed the physwizz kernel and then my own GSI image as it was described in the instructions at the initial post. Just remember that /data partition is not functional with FBE and TWRP so you need to push your images somewhere else like microSD card or TMPFS partition. OTG might work here as well, this is something I haven't tested yet through...
5. Once you are done with flashing you need to restore the original recovery partition via the download mode. TWRP won't boot the GSIs with FBE encryption enabled actually it does boot now for me, yet I still recommend switching to stock recovery if your phone bootloops or you need to format/wipe userdata partition. You can then safely format your /data partition with the stock recovery.
ap4ss3rby said:
Hi, I installed LineageOS 18.1 GSI on my M127F. I want to share my guide to installing this GSI.
Code:
DISCLAIMER:
By following this guide you accept that you
may do irreversible damage to your phone.
If something breaks the responsibility is
yours only. If you want stable software that
is guaranteed to work 100% don't follow
this guide.
I assume you are running a fully stock system and and locked bootloader and firmware U3/U4.
Installing TWRP and custom kernel
Enable Developer Options by tapping on software information > build number 7 times
Enter developer options then toggle OEM Unlocking on.
Power off your phone.
Hold Vol Up + Vol Down then plug in your phone to enter download mode
THIS WILL ERASE ALL YOUR DATA AND VOID YOUR WARRANTY. Follow on screen instructions to unlock your bootloader. THIS WILL ERASE ALL YOUR DATA AND VOID YOUR WARRANTY
After this you want to download and install attached Orangefox recovery using odin. After odin is done flashing enter recovery
Format data (not wipe) in recovery
Enter terminal and type multidisabler twice
Reboot to system and verify that under security encryption is disabled
Download TWRP and custom kernel for your phone
Reboot into recovery and locate the downloaded twrp image
Select recovery.
Reboot into recovery
Install kernel, then wipe cache and reboot. You should now see that it is complaining about some internal issue. This is normal.
Installing the GSI
Download your favorite ROM from the list provided below. You want to install an arm64 a/b image.
Extract the image file
Reboot to recovery.
Select install then install image
Locate the GSI image
Select install system
After that is done return to recovery and select factory reset.
Reboot then do setup (if applicable) then download attached magisk and phh trebleapp. If your phone is stuck on bootanimation check under to fix it.
IMPORTANT: DO NOT LET THE SCREEN TURN OFF OR YOU WILL HAVE TO REBOOT TO MAKE TOUCH WORK AGAIN.
Install attached magisk
Open magisk and click on install then direct install
Download and install the attached phh-treble app apk.
Touch should now work. Enjoy your GSI.
Extras
Magisk 24.1
Open Magisk
Go to settings
Update Magisk Manager app to version 24.1
Relaunch Magisk then install magisk
Choose direct instal
Migrating to patched trebleapp
Download and install attached trebleapp
Open your root file manager
go to /data/adb/service.d
Delete the script you added earlier
Tips in case things don't work
In case after rebooting to the GSI the phone bootloops:
Download stock image from wherever you download your firmware (I use a python program called samloader)
Extract the AP of the downloaded firmware
Find userdata.img.lz4 and create a .tar archive only containing this file
Reboot to download mode
In odin select AP then locate the newly created .tar archive Then click on flash
Reboot
Continue from step 7 under the "Installing the GSI" portion of the guide
To revive the touchscreen using ADB:
In case you didn't grant adb root access but installed magisk, run adb shell then su. A root access for the app shell will appear. Grant root permission
Plug in phone to a computer with ADB
adb shell
su
cat /sys/class/sec/tsp/cmd_result
echo check_connection > /sys/class/sec/tsp/cmd
What works:
Boots
RIL
Fingerprint
Main rear camera
Front camera
Sleep/Wake (workaround in steps above, may need to sleep wake several times before it works)
WiFi
Flashlight
Rotation
Magisk 24
90Hz (M12 only. A12 doesn't have 90Hz refresh rate)
LineageOS 18.1
LineageOS 19
CAOS (GApps variant available)
phh AOSP 11 v313
phh AOSP 12 v400h
Untested
GPS
Flashing GApps. (I use fdroid and aurora store on LineageOS and CAOS has built in GApps)
USB-OTG
A127F
M127G
If I didn't list it under broken or working I didn't try it or forgot to test it.
Broken
Double tap to wake. Touchscreen turns off and I have no idea how to keep it alive while lcd is off
MTP
Virtual Proximity. Screen will stay on in phone calls and WhatsApp will always play voice messages through speaker
Flashlight brightness. Flashlight will always stay on weakest brightness with no way to adjust.
Adaptive refresh. The framerate you set in phh addons is what you get. Be prepared for slightly reduced battery.
You tell me (even though I probably don't have the solution)
Bugs
You may need to wait a little bit before touchscreen responds or sleep/wake several times before screen responds after turning the screen off
Credits
@physwizz for kernel, TWRP and orangefox
@phhusson for implementing workaround in trebleapp as well as GSI list
me for touch workaround
Links
Kernels and recoveries: https://t.me/a127f_res/113
GSIs: https://github.com/phhusson/treble_experimentations/wiki/Generic-System-Image-(GSI)-list
Click to expand...
Click to collapse
try to install @phhusson (system-squeak-arm64-ab-vndklite-gapps-secure.img) GSI using above method on Samsung Galaxy M12G (SM-M127G) BUT failed to boot up
facing following issue:
1) unable to boot in OrangeFox Recovery
2) boot in TWRP Recovery but not detected MicroSD Card
3) samehow manage to push Kernal.zip, SystemGSI.img by adb push file_name_with_extension /sdcard BUT not flash properly as TWRP reboot again and again in 2-3 minutes
so friends, don't try this method on Samsung Galaxy M12G (SM-M127G) unless Senior member come up with this specific model
For anyone who has starred this thread, I and other devs have released a proper build of LineageOS with /vendor. Aside from VoLTE (which I don't think worked in GSIs anyways) everything should work. Moderators, please close this thread
ap4ss3rby said:
For anyone who has starred this thread, I and other devs have released a proper build of LineageOS with /vendor. Aside from VoLTE (which I don't think worked in GSIs anyways) everything should work. Moderators, please close this thread
Click to expand...
Click to collapse
LineageOS is not only GSI available, I think someone might still find it useful if they want to flash another ROMs. Also Phhuson's GSI also contains some features that unofficial GSI release don't have (i.e. flashlight control in Phhusson's app), so they still might be useful for someone.
This is why I think it is better to not close this thread and maybe revive original guide.
SB3P said:
LineageOS is not only GSI available, I think someone might still find it useful if they want to flash another ROMs. Also Phhuson's GSI also contains some features that unofficial GSI release don't have (i.e. flashlight control in Phhusson's app), so they still might be useful for someone.
This is why I think it is better to not close this thread and maybe revive original guide.
Click to expand...
Click to collapse
Our rom is built completely from source, not a GSI, and it is more or less a complete replacement of stock firmware. If you want you can use a GSI over that instead, and it should function much better than just replacing stock firmware
ap4ss3rby said:
Our rom is built completely from source, not a GSI, and it is more or less a complete replacement of stock firmware. If you want you can use a GSI over that instead, and it should function much better than just replacing stock firmware
Click to expand...
Click to collapse
I haven't said GSI are better, I personally use this unofficial LineageOS build. But what I've said, GSI brings much more variety of picking the OS you can install. Even Linux can be installed on phones nowadays using GSI with only Halium-patched kernel as an requirement. This is why I think leaving this tutorial archived (no updates, interest on fixing bugs etc.) is better than removing it.

Categories

Resources