How Do I Install LineageOS and Google HDR Modded Camera on Xiaomi Redmi Note 4X?

Hi all,

Purpose of this post:

  • For me to clarify some of the problems I'm having and get some help
  • For others to use this as a point of reference if they are going through the same process and having trouble

I recently bought a Xiaomi Redmi Note 4X from this deal and am in the process of setting it up. I'm trying to do two things:

  • Install latest Stable LineageOS
  • Install Google HDR camera

I've rooted phones before so I'm not entirely new to this, but have always found it difficult to find all the information I need in one place. Different websites sometimes state different things are required, some of which may contradict each other and therefore cause confusion. Given the popularity of this phone here, I thought this would be useful to have.

I have tried going through some previous comments.. here's a compilation of what I've found:

Some other more direct links:

What I'd like some help with:

  • Where to download the latest stable LineageOS? Can only find the weeklys (which are called nightlys) from this link
  • Do I need to install some "lazy firmware"? The YouTube video I linked to above suggests to install "lazyflasher-no-verity-opt-encrypt" which is required to allow the phone to reboot, as Xiaomi otherwise blocks unlocked phones from starting up.. which doesn't sound right given you have to apply to get your bootloader unlocked? Seems unnecessary.
  • Can't find too much info on how to install the modded Google HDR camera (haven't tried too hard to look for it so far, admittedly) but I assume it just requires the installation of an .apk so technically root isn't required, unlike for installing LineageOS.
  • SlimROM or LineageOS? SlimROM has less bloat, but from my experience of using SlimROMs in the past is also a bit bare (lacking in features). Given LineageOS is CyanogenMOD reborn, I'd probably go with LineageOS.
  • After installing LineageOS, are there OTA OS updates available? Are there any built-in features that will stop working (e.g. fingerprint reader)?

I might put this together with a step by step if I get my head around the whole thing + if I get some time to do it.

Thanks in advance!

Comments

  • Hey,

    Can't help you with those issues unfortunately however it'd be worthwhile crossposting to the XDA forums.

    Good luck!

    • +1

      Ah, might do that once I get desperate!

      Just thought posting it here would be fine (and I prefer Ozbargain forums) because of the popularity but this hasn't received as much activity as I had anticipated!

  • +1

    out of interest, any particular benefit in using this OS over another non stock rom? Just couldnt find any outstanding reasons when googling

    EDIT Ahhh just worked it out - cyannogen mod tried to become a business, shutdown, but maintained the naming rights. So it's a fork continuation of cyannogen mod

  • -4

    unless you're some kind of sex offender why do you need to

    • I guess you're not too familiar with rooting?

  • +1

    Can't help much OP as I'm a newbie myself.

    With the help of a guide from the Whirlpool forums I was able to install CM13 onto my Xiaomi Redmi Note 3. I haven't since installed Lineage yet, as I don't know the steps but I'm sure there is someone there who knows.

    • Me too, but those familiar with the matter don't seem to be checking this out at the moment!

  • -1

    I've always found CM and LineageOS to be far more unstable than stock.

    You can get all or most of the battery savings (and lowered device performance) of Lineage by flashing a third party kernel and then setting the cpu governor to whatever Lineage uses these days or something close to it.

  • +2

    Please log in the Xiaomi(Mi) account on your device. You can find Mi Account option somewhere in settings. If you already have a Xiaomi account, you can use that else create one. This Mi account is essential for further steps. Since it is Chinese company account I would not recommend putting your primary email address and phone number. But make sure both email address and phone number that you put are accessible. After your phone has been set up/ linked with a Mi account, reboot the device and check that Mi account is correctly linked even after reboot(not really necessary but better to ensure).

    Next step is to request for bootloader unlock code. Head over to Mi Unlock Request. Click on Unlock Now and log in with same Mi Account as the one on the device. Request for unlock code there. You need to give reason for the request. Just mention 2-3 sentences along the lines that you need to install custom ROM and/or want to maximize the performance of the device. After you submit the request, you may need to wait anywhere between 3-10 days to receive unlock code. This is the worst part about Xiaomi Custom ROM installation.

    I will try to create further instructions when I have time. (Hopefully by the time you get your unlock code). Else XDA is your best friend :D

    @OP: You have mentioned that you have rooted before and not a newbie. I will still try to keep the instructions detailed for others.

    • Thanks for your input!

      I had already done everything you've mentioned - i.e. I've got my bootloader unlocked already. Although I've had a Mi Account from before using real email and phone number..

      I'm basically stuck at:

      • Finding a stable LineageOS as opposed to weekly
      • Whether I need to install some sort of "lazy firmware" but I assume I don't - only seen one mention of it
      • How to install Google HDR camera? If it's just an .apk, then very easy.

      Agree with leaving it detailed for others - but I might (once I get all the steps together) do a summarised step by step in the description for others to follow.

      • +3

        Finding a stable LineageOS as opposed to weekly

        As far as I know, they have not released stable build for any device till now. Having said that, the nightlies/weeklies are stable enough for using the phone as daily driver

        Whether I need to install some sort of "lazy firmware" but I assume I don't - only seen one mention of it

        If you are currently on MiUI then flashing the file "lazyflasher-no-verity-opt-encrypt.zip" is absolutely necessary. After running the flash command for installing recovery, you have to boot into TWRP and flash that zip file in TWRP. For that, you need to have that file in phone memory/sd card before. (obvious but needed to mention. You will need to use MTP from TWRP otherwise to get that file.)

        Do I need to install some "lazy firmware"? The YouTube video I linked to above suggests to install "lazyflasher-no-verity-opt-encrypt" which is required to allow the phone to reboot, as Xiaomi otherwise blocks unlocked phones from starting up.. which doesn't sound right given you have to apply to get your bootloader unlocked? Seems unnecessary.

        You have to flash this lazyflasher while installing custom recovery, otherwise you wont be able to boot into system! This is required only for MiUi. Once you flash an AOSP ROM, this lazyflasher requirement is no longer there.

        Second thing regarding firmware file is while installing lineage os. If you are currently on Marshmallow, you need to install the firmware file found here. Main Thread on XDA

        If you are already running MiUi Nougat through global beta, then no need to flash the second firmware. But lazyflasher is absolutely essential while installing TWRP.

        To summarise, run TWRP flash command in ADB, boot into TWRP immediately without booting into system, flash the lazyflasher.zip. Reboot. After that, installing lineage os is normal stuff. The steps are as follows:

        1. Full wipe in TWRP(In TWRP, WIPE-> Advanced wipe, select dalvik cache, cache, system and data, and swipe to wipe)
        2. Flash firmware.(this file is different from lazyflasher.zip)
        3. Flash ROM
        4. Flash gapps
        5. Flash any root addons if required.
        6. Reboot.

        How to install Google HDR camera? If it's just an .apk, then very easy.

        Can't find too much info on how to install the modded Google HDR camera (haven't tried too hard to look for it so far, admittedly) but I assume it just requires the installation of an .apk so technically root isn't required, unlike for installing LineageOS.

        You need to edit build.prop file of your device to enable camera2 API. This can be done with ADB commands without needing to root the device. After enabling camera2 API, you can download the Google HDR camera app mentioned here and install it as any normal APK. Just make sure to uninstall any official google camera app previously installed. The Google HDR camera gives amazing results. It really feels like a complete different camera altogether.

        You dont require root for installing lineage os either. Just unlocked bootloader and custom recovery :)

        After installing LineageOS, are there OTA OS updates available? Are there any built-in features that will stop working (e.g. fingerprint reader)?

        Yes OTA updates are available. All of the built in features are working fine for me (including fingerprint scanner).

        • As far as I know, they have not released stable build for any device till now. Having said that, the nightlies/weeklies are stable enough for using the phone as daily driver

          Ah very good. I think the wording under "Downloads" confused me.. "Official Build (weekly)" sounded a little contradictory but I suppose it is possible to have an official build released weekly which isn't technically a "stable" version.

          You have to flash this lazyflasher while installing custom recovery, otherwise you wont be able to boot into system! This is required only for MiUi. Once you flash an AOSP ROM, this lazyflasher requirement is no longer there.

          i.e. Generally should only be required the first time you flash from MIUI to other OS, unless you return to MIUI some time in the future then wish to re-flash to another custom ROM, in which case you'll need to flash lazyflasher again.

          Second thing regarding firmware file is while installing lineage os. If you are currently on Marshmallow, you need to install the firmware file found here. Main Thread on XDA

          Hm that sounds super important but it doesn't seem mentioned anywhere - neither on the Youtube link nor the official XDA thread that you linked to, nor the official instructions.

          The official XDA thread has a link to that under "Downloads" but it is not specified that it is for if you are on Marshmallow.

          1. Full wipe in TWRP(In TWRP, WIPE-> Advanced wipe, select dalvik cache, cache, system and data, and swipe to wipe)
          2. Flash firmware.(this file is different from lazyflasher.zip)
          3. Flash ROM
          4. Flash gapps
          5. Flash any root addons if required.
          6. Reboot.

          Step 2 refers to the firmware that you refer to above which is necessary if you are on Marshmallow?
          Does this also mean that the ROM by itself does not have the Google apps?
          The Youtube link suggests to install the OS before the lazyflasher (which sounds like an odd sequence to me). Your order sounds more logical, but I assume it doesn't matter then given he's suggesting for it to be done the other way round?

          The Google Apps page gives you options before downloading.. how do we know what options to select? Android version is quite logical as that should correspond to the Android version of LineageOS that you are installing (7.1) but what about Platform and Variant?

          What type of root addons are usually selected? I assume you are referring to the ones on this page? I obtained this link from the official XDA LineageOS thread under "Downloads" -> "LineageOS addons download". None of them appear necessary except

          You dont require root for installing lineage os either. Just unlocked bootloader and custom recovery :)

          Does following the process of unlocking the bootloader not result in a rooted Xiaomi Redmi Note 4? lol

        • @illumination:

          I suppose it is possible to have an official build released weekly which isn't technically a "stable" version.

          Unless you return to MIUI some time in the future then wish to re-flash to another custom ROM, in which case you'll need to flash lazyflasher again.

          Yes correct :)

          Hm that sounds super important but it doesn't seem mentioned anywhere - neither on the Youtube link(youtube.com) nor the official XDA thread(forum.xda-developers.com) that you linked to, nor the official instructions(wiki.lineageos.org).

          It is there on the official XDA thread. Taken directly from XDA thread:
          Instructions :

          • Flash Twrp :- LINK
          • Download Firmware (Important)
          • Download the latest build and GApps
          • Reboot to recovery
          • Flash the latest firmware, build and GApps
          • Reboot

          This section is between known issues and downloads.

          The official XDA thread has a link to that under "Downloads" but it is not specified that it is for if you are on Marshmallow.
          Step 2 refers to the firmware that you refer to above which is necessary if you are on Marshmallow?

          If you search this thread with firmware, you will get your confirmation :)

          Does this also mean that the ROM by itself does not have the Google apps?

          That is correct. Reason for that as mentioned on LineageOs wiki

          "Google apps are the proprietary Google-branded applications that come pre-installed with most Android devices, such as the Play Store, Gmail, Maps, etc. Due to licensing restrictions, these apps cannot come pre-installed with LineageOS and must be installed separately. The Google apps are not required to boot or run LineageOS, however many users find them beneficial to take full advantage of the Android ecosystem.

          These apps have been packaged by a developer independent of LineageOS, and download links have been provided for your convenience only. It is possible to perform a “backup” of the Google apps on your device and then “restore” them, but this does take additional steps which are not covered here."

          You can technically have Google-free android. But i don't see the point of that :P

          The Youtube link suggests to install the OS before the lazyflasher (which sounds like an odd sequence to me). Your order sounds more logical, but I assume it doesn't matter then given he's suggesting for it to be done the other way round?

          The order should not matter ideally. But i followed the order as mentioned in the official XDA post. Maybe you can try the other way and post the result :P

          The Google Apps(opengapps.org) page gives you options before downloading.. how do we know what options to select? Android version is quite logical as that should correspond to the Android version of LineageOS that you are installing (7.1) but what about Platform and Variant?

          Platform corresponds to 32-bit or 64-bit version of Android OS installed on the device. Our Redmi Note 4 is 64-bit so we have to select ARM64 variant. You can check if the OS is 64-bit or not using any of the apps on playstore. I personally use Droid Hardware Info

          variant is where the things get interesting. Have a look at Package Comparsion as given on the GitHub page of OpenGapps.

          Whenever you flash a particular gapps package, the apps mentioned in that package are installed as system apps. It means that you can only disable them but not uninstall them.
          Pico installs bare minimum Google Play Services. You can install rest of the google apps like maps, gmail from play store. I personally prefer installing pico/micro because that way I can avoid Google bloat apps like play music,movies, newsstand etc. as superior alternatives exists for them.

          What type of root addons are usually selected? I assume you are referring to the ones on this page(download.lineageos.org)? I obtained this link from the official XDA LineageOS thread under "Downloads" -> "LineageOS addons download". None of them appear necessary except

          Please finish the last part of that sentence. The suspense is killing me :D Anyway, the su addon refers to SuperUser aka Root addon. su-removal refers to unrooting. The weatherprovider addon is self explanatory. Here also we have to use the 64-bit version of the addon denoted by (arm64).

          Does following the process of unlocking the bootloader not result in a rooted Xiaomi Redmi Note 4? lol

          Nope. Bootloader unlock will allow you to install custom recovery. Custom recovery will help you to root. This is mostly true but not always. Anyway, point is bootloader unlock and rooting are not same :)

        • @jtrvk:

          Maybe you can try the other way and post the result :P

          I'll follow your/XDA's order :P Sounds more logical

          Please finish the last part of that sentence. The suspense is killing me :D Anyway, the su addon refers to SuperUser aka Root addon. su-removal refers to unrooting.

          LOL whoops. My bad.. I actually don't know what I was trying to type, and upon looking back, none of them appear necessary!

          But now that you say su addon refers to SuperUser, aka root, that means this will be required to root the device (as opposed to simply an unlocked bootloader)?

          I think I'll want the device rooted.. so looks like I'll need su addon! And again, I notice there are variants here too:

          • su (arm)
          • su (arm64)
          • su (x86)

          Given as you mentioned our Note 4 runs a 64-bit OS, looks like the one in bold will be the one required!

          The weatherprovider addon is self explanatory.

          Yea definitely sounds self explanatory.. but it makes me wonder, any advantage of getting these weather addons as opposed to a weather app from the Play Store?

        • @illumination:

          Given as you mentioned our Note 4 runs a 64-bit OS, looks like the one in bold [su(arm64)] will be the one required!

          Correct

          Yea definitely sounds self explanatory.. but it makes me wonder, any advantage of getting these weather addons as opposed to a weather app from the Play Store?

          I guess that addon is specifically for the cLock widget built into the LineageOS. Not sure about it though.

        • @jtrvk: Thank you so so so much for your help so far..

          Final few questions (I hope):

          • What is the difference between downloading SuperSU from here (the LineageOS addons) and here (link provided from Youtube link). The one provided from the Youtube link appears to be "general" SuperSU whereas the LineageOS one seems specific to LineageOS? In addition, the LineageOS one seems to allow you to specify 64-bit whereas the general SuperSU one doesn't.
          • You know that "lazy firmware" I referred to above? You pasted the steps to install this from the LineageOS XDA thread directly. The file it points to is this. A file called "cm-14.1-mido-firmware-20170430.zip". This file is 46324KB, compared to 421KB "lazyflasher-no-verity-opt-encrypt" from the Youtube video. This seems like a HUGE difference in size for a firmware that is supposed to be.. the same? Also referred to in the XDA thread for TWRP Recovery - this refers to the lazyflasher-no-verity-opt-encrypt instead.
          • Android 8.0 version of LineageOS for Redmi Note 4 available?!
        • @illumination:

          What is the difference between downloading SuperSU from here(download.lineageos.org) (the LineageOS addons) and here(supersu.com) (link provided from Youtube link). The one provided from the Youtube link appears to be "general" SuperSU whereas the LineageOS one seems specific to LineageOS? In addition, the LineageOS one seems to allow you to specify 64-bit whereas the general SuperSU one doesn't.

          All of them essentially do the same thing. I think General SuperSU inlcudes all ther versions in a single flashable zip. Only thing is if you face any issues regarding root, you will have to post in corresponding XDA thread for solutions. ALso note that after you flash everything and lineage os boots, you have to go in developer options and enable root access for Apps and ADB, otherwise your apps will think that your phone is not rooted!

          You know that "lazy firmware" I referred to above? You pasted the steps to install this from the LineageOS XDA thread directly. The file it points to is this(androidfilehost.com). A file called "cm-14.1-mido-firmware-20170430.zip". This file is 46324KB, compared to 421KB "lazyflasher-no-verity-opt-encrypt(goo.gl)" from the Youtube video. This seems like a HUGE difference in size for a firmware that is supposed to be.. the same? Also referred to in the XDA thread for TWRP Recovery(forum.xda-developers.com) - this refers to the lazyflasher-no-verity-opt-encrypt instead.

          Please look here at my previous post. Apologies for any confusion, but I have specified that "lazyflasher-no-verity-opt-encrypt" and the "cm-14.1-mido-firmware-20170430.zip" are two different files with different purpose required at different times during installation.

          lazyflasher-no-verity-opt-encrypt: Required for installation of TWRP on MIUI. This file directly does not have anything to do with lineage os isntallation. This file ensures that phone boots into MIUI after flashing the custom recovery. This file is always essential when installing custom recovery regardless of version of MIUI.

          cm-14.1-mido-firmware-20170430.zip: This is required only when you want to install Nougat based AOSP custom ROM when coming from marshmallow based MIUI. This is flashed along with the ROM file and the GAPPS file.

          I hope this makes it clear :)

          Android 8.0 version of LineageOS for Redmi Note 4 available?!

          Yes it is available. There are few issues still which should hopefully be worked out sooner rather than later. I will suggest waiting a week or two more before jumping on the oreo train.

          As for the official Nougat weekly builds, the maintainer of that ROM has water damaged his device. So I think there won't be any device specific changes anymore unless somebody else continues the development. That seems unlikely because developers will now mostly focus on oreo development. However, since our device is officially supported, we will receive changes made by LineageOS team through weekly OTA updates. So monthly security should not be an issue. And of course any of this does not affect Google HDR Camera in anyway. That thing continues to take amazing pictures :D

          Which redmi note 4 variant you have? Since you are looking into lineage os, i assume (and hope) it is Snapdragon 625 version. But what is the configuration 3 GB / 32 GB or 4 GB / 64 GB? Not that it matters, just curious.

        • @jtrvk: Ah yes you did explain it (the differences between lazyflasher and the "firmware" for installing the Nougat based ROM from Marshmallow MIUI) relatively clearly - it was the other guides that I felt didn't differentiate it particularly clearly. Apologies!

          I don't think I'll try Oreo just yet. I'll move over some time later!

          Which redmi note 4 variant you have?

          I bought it for $145 from Shopmonk from this deal, so it's the 16GB/3GB RAM version. A bit restrictive (space-wise) but I'm ultimately planning to give this to my mum to use.

          I am pretty certain this is the Snapdragon 625 variant, seeing as the chipset is Qualcomm 8953 in the Droid Hardware Info app, which is listed on GSMArena as "Qualcomm MSM8953 Snapdragon 625".

  • +1

    Some notes for me to add to the future guide:

    • +1

      Just wanted to say thanks for posting all this. I'm hopefully getting an X4 as soon as I find a good deal. And hope to do this too. Will come back here for sure to see how you went! Hope it worked out ok.

      • +1

        Welcome :)

        Still in the middle of doing everything!

        Obviously the fact I'm taking so long is because I'm not in a major hurry to get this done. Hopefully the guide will make it a lot quicker and smoother for others.

        • Thanks. Much appreciated.
          I'm a newbie to altering systems. I feel like I'll need a couple of months to digest this. Am terrified I'll brick my phone. Might wait until my 4x is my backup phone and take my time with it. I'll bookmark this conversation for when I'm confident ready. 😊

    • Update:

      I've just tried unlocking the device again even though it hasn't been 72 hours. It now says "After 17 hours of trying to unlock the device". So trying to unlock within that 72 hour period doesn't work, and surprisingly the time remaining does get updated! Impressive!

  • +1

    Here's what I've done so far, roughly in this order:

    • Unlocked bootloader successfully using Mi Unlock (Youtube Link) (after 72 hours had passed from the time Mi Account was added, as per above comments)
    • Downloaded and extracted ADB Files (Youtube Link)
    • Flashed "recovery.img" (TWRP) (link from XDA LineageOS thread for Redmi Note 4) using a command window from the ADB folder
    • Flashed "lazyflasher" firmware (Youtube link)
    • Flashed SuperSU from SuperSU's website/the link provided in the Youtube video

    And now paused at this stage. Will probably continue tonight

    Other prep things I've done:

    • Downloaded LineageOS, 20171012 version (from XDA LineageOS Thread for Redmi Note 4)
    • Downloaded Gapps "Pico" (i.e. bare minimum Google apps) from opengapps.net (linked from XDA LineageOS Thread)
  • Noticed an issue that I've got which appears to be a somewhat known problem. Haven't looked into the solutions in detail as yet but here is the problem.

    After rooting your Xiaomi Note 4, USB connections between your Redmi Note 4 and your computer will be purely "Charging only". Pre-rooting, you would've been given the option of changing to MTP (Media Transfer Mode - the mode you use to tranfser files) and PTP (Picture Transfer Protocol). These options are no longer available after rooting. Even when plugged in, it will only say "Charging" without giving you the option to change modes.

    Even when going into Developer Options and changing "Select USB Configuration" to MTP/PTP, it stays on "Charging Only".

    Here are some links that I've found related to the issue:

    • I am assuming the issue you are facing is on MIUI?

      Since you have done the hardwork of flashing twrp, just install lineage os. You will never want to go back to miui ever again :p

      • I am assuming the issue you are facing is on MIUI?

        Yes

        Since you have done the hardwork of flashing twrp, just install lineage os. You will never want to go back to miui ever again :p

        Lol I agree. But the funny thing is, the only reason I'm trying to get MTP working right now is because pre-rooting, I only managed to transfer the 20171105 version of LineageOS. I am now trying to transfer the 20171112 version to my phone.. but unable to because of lack of MTP.

        Other things I've tried:

        • Transferring via TWRP - computer doesn't appear to detect any connection
        • Transferring via a Wifi File Transfer app - everything appears, except Internal storage of the phone! LOL
        • Adding some lines of code to build.prop via Solid Explorer using a text editor - didn't work for me at all but appears to work for others (albeit temporarily)

        It appears (from reading that I've done) that the issue is related to SuperSU.

        Anyway, my options from here are:

        • Use a microSD to transfer 20171112 version of LineageOS to my phone
        • Re-download 20171112 version of LineageOS onto Redmi Note 4
        • Install 20171105 version of LineageOS first, and then use MTP after that is installed to transfer 20171112 LineageOS and update to that - or update to the 20171112 version using OTA update

        Sorry, kinda using this thread as a personal log for my issues etc.

        • +1

          @illumination:

          Transferring via TWRP - computer doesn't appear to detect any connection

          Strange. You may try playing with device connections in Windows Device Manager (provided you are using Windows of course :D)

          Anyway, my options from here are:

          Did you try using ADB commands to push files to device?

          Install 20171105 version of LineageOS first, and then use MTP after that is installed to transfer 20171112 LineageOS and update to that - or update to the 20171112 version using OTA update

          Preferred option :D

        • Made some typos there when referencing the version of LineageOS (month was typed as November!)

          Anyway, just writing to update that I've successfully installed LineageOS. Haven't played much with it because it's late but at this stage, I'm actually thinking I might regret this decision because I'm giving this to my mum who is very technologically illiterate and she was previously using MIUI on a Xiaomi Redmi Note 2. This means even though this is a new Xiaomi it would effectively feel like a brand new system to her.

          I'll consider rolling back to MIUI if I feel the need to but I'll probably play with LineageOS over the next few days and see how it is. It feels incredibly similar to CyanogenMod from the Oneplus One.

          Next goal is to get the Google HDR camera mod installed and after that to look at revamping the OP with a set of fairly precise steps to do what I've done.

        • @illumination:

          Maybe install a theme to mimic MIUI. Security-wise LineageOS is much better than MIUI.

        • @jtrvk:

          Good idea. I'll definitely consider that.

          Security-wise LineageOS is much better than MIUI.

          Oh, how so?


          Just google'd the following terms:

          • LineageOS themes
          • LineageOS xiaomi redmi note 4 themes
          • LineageOS MIUI theme

          Couldn't find anything :(

        • +1

          @illumination:

          Oh in that case, why don't you give Nova launcher a try? I found couple of YouTube videos showing how to customise to look like MIUI

          Regarding the security of lineage os, you get timely monthly security patches. Plus there is no opaque part of the system (IMO) unlike miui e.g. unknown mi services

        • @illumination:

          It feels incredibly similar to CyanogenMod from the Oneplus One.

          It is. After Cyanogen Inc flopped, the open source development part of the community got the (profanity) out and forked their works into LineageOS. Its essentially just stock Android with a small set of custom tweaks and apps (due to stock AOSP not having any alternative for Google Apps, making it unusable for people who do not want to use Google's ecosystem).

          Google's HDR Camera is just a flashable file you can flash from TWRP. I'd also recommend flashing the unroot addon (if you flashed su already). Its unnecessary for a general user, you do not need it for HDR Camera to run (you only need root if your device doesn't have a custom recovery), and more apps are running root check and blocking things nowaday. In addition to that, there's this patch: https://drive.google.com/file/d/0B8e7Gjb1XkJ0eHozYmFoTHJFcEU…

          which changes the build code to user, from userdebug, as well as disabling debugging. LineageOS despite coming unrooted nowadays, is still built with the debugging tag, which trips up some apps. Normally the process require editing a few files, but this automates everything

        • @tatsulotto:

          Google's HDR Camera is just a flashable file you can flash from TWRP

          Not quite sure if I did this "right" then..

          I edited build.prop from miXplorer (a file explorer) and added the enable.camera API line. I then downloaded the Google Camera and installed it as a standalone .apk. It appears to work..? Just not sure lol.

          The file you linked to.. fgo_patch.. What is that?

          Upon googling, the only thing that looked somewhat relevant that I could find was this. Interestingly, it looks like it's some super recovery that's better than TWRP (more feature filled)?

          Your explanation appears to suggest it's to prevent apps from identifying the fact that LineageOS is a custom ROM (or something like that?)

        • +1

          @illumination:
          The earlier google camera packages came as a flashable zip, but seems like they've gotten it to work without needing it to be installed onto the /system partition, so its distributed as an apk. If it works it works

          The file you linked to.. fgo_patch.. What is that?

          Its an automated patch to fully disable debugging inside the kernel's ramdisk, as well as change the build code from userdebug to user inside build.prop. It originally came from the Fate/Grand Order (a mobile game) community, which had a very sensitive and very thorough root checker, the smallest of things would set it off. Even though LineageOS comes unrooted by default, it still comes with debugging/logging feature enabled by default for bug reports and such, tripping the check. This patch automate the process of disabling it, which normally would be quite complicated by hand. To my knowledge its only this, and a few other Japanese games that has this level of checking so far, but 6-12 months down the line more companies will adopt similar practices.

          Incidentally, this is also why a lot of Chinese phones sets off root checkers. The manufacturer just plopped the development build straight onto the device, so it ends up triggering everything.

        • @tatsulotto:

          To be honest your explanation sounds thorough and it sounds like you know what you're saying, but I don't think I fully understand.

          It basically sounds as if LineageOS in its default mode is not rooted, but there are small things that trip the root checks (even though it's not actually rooted). The fgo_patch you linked to is something to be flashed via recovery that masks this?

          How does this differ to, for example, using Magisk?

        • @illumination:

          Hmm, let me try and simplify it further.

          In software development, there are multiple release "branches", for different targets. Stable, nightly, etc… as you can see with LineageOS. When compiling Android, one of the parameter you have to set is the build type, which dictate what development features are enabled or disabled.

          For the stable build deployed to production model phones, the build type is user. This disable all development/debugging function such as logging, doesn't come with Android's own Superuser manager nor the su binary.

          For the beta build released to developers (Xiaomi release these weekly, they're really good about providing test build to users who wants it), the build type is userdebug. This build type has a few logging function available, so logs can be added to bug report, giving the manufacturer/developer better feedback on how to fix it. It also comes with the Superuser manager, just disabled by default.

          For in house build used for internal development. It logs everything, comes rooted by default, as well as having other debugging feature enabled.

          Traditionally, LineageOS (and previously, CyanogenMod) came rooted by default. Due to popular demand its no longer the case, you have to flash the su "addon" that comes in the additional zip file to enable root. However, the build type is user debug to facilitate this. What the patch does, is make the necessary changes to disable all the debugging/logging functions still enabled, then finally changing the build name inside build.prop, changing it to the "user" build type. Its not masking, but rather a complete, 100% unroot. This change is necessary for Android Pay, which recently also adopted similar level of root checking, and other apps are sure to follow

          Magisk

          Magisk is just a way to cheat the root checker, by not making any modification to the system partition. The su binary is located on a secondary image which is mounted at boot time. A more thorough root checker would still detect it.

    • Have you tried Magisk instead?

      • I didn't bother because once I installed LineageOS, it worked fine!

        The problem I faced was basically when I was in this "awkward" middleground between having MIUI with an unlocked bootloader and LineageOS, so it wasn't really a state that I was realistically going to use the phone.

      • So the answer is no but I'm now wanting to install Magisk as a replacement for SuperSU. You replied to my comment about having issues with doing file transfers though. What were you asking about Magisk in relation to?

        • Yeah, you mentioned that the transfer issues occurred after rooting.

          I thought maybe Magisk might work better because everything runs systemless, in that all mods are in the boot img, and the system partition is left untouched. (I'm not sure if your SuperSU was installed in systemless mode)

          BTW, check out Red Wolf as an alternative to TWRP. Based on it, but with added features (including automatic lazy flasher and built-in Magisk installer).

          Not really an issue since you're on Lineage but it also doesn't break MIUI OTA updates.

  • Closest to a step by step to install Google Camera port I could find. XDA version (posted by the same guy)

    I believe I have now managed to successfully do this and I am now in the process of finalising the step by step.

    Out of curiosity.. who is actually reading this? I am actually feeling a little bit demotivated because I don't feel like this has helped as many people as I thought it would have!

    • +1

      Hey @illumination, I haven't read the whole thread, but really appreciate the post. I currently have a OnePlus 3 and also wish to install the Google Camera.

      I actually just googled it, and found this for the OnePlus 3, and just installed it on my phone. Can't vouch for the quality difference since it's late, but looks pretty legit.

      Anyway, thanks for the post! I've been meaning to download the Google Camera app but have been putting it off since I thought I'd need to root the device or whatnot, but my experience was ridiculously simple, no root needed. Thanks again!

    • I guess it could be linked to the xiaomi redmi note 4 deals that keep popping up often. Could help a lot of people!

      • I'd agree with that. Hopefully I'm active enough to be able to be one of the first to comment on each of the future posts though :P

        Either that or hopefully whoever posts future deals remembers or knows about this post so they can link to this.

    • I finally ordered my Redmi Note 4X and knew to come back here to read all this. Don't feel demotivated this thread has been great for me!

      Quick question though, is/was it worth it? Never flashed a phone before (other stuff yea), and it looks like a lot of work. Is Lineage and the Google HDR+ worth the effort? I did some googling and hear that HDR+ take a lot longer to take a photo and Lineage isn't necessarily any better. What do you think?

      • I think it was worth it. I didn't put that much effort into it but I dragged my feet. It's kind of like cooking. You need to get your ingredients all prepared first, and the actual cooking itself doesn't take long.

        This was similar. Get your files ready, apply to unlock your bootloader ahead of time, and then the actual processing of having everything installed probably takes less than an hour.

        The whole point of me putting this together though was ideally to make it easier for you guys (once it's up and running).

        To be fair though, I don't have a great point of comparison because I didn't use MIUI on the phone for long at all. I have experience from using an older version of MIUI on my Xiaomi Redmi Note 2 though, and I generally do think LineageOS seems to offer a more refined experience. What really stands out though is how clean and pure the OS feels.

        As for camera, everyone says it's better but I'm the wrong person to ask about photography. I can't really tell the difference between iPhone cameras and Coles $50 phones (ok I'm exaggerating but you get my point), but people say it's better and I believe them. It looks better, I guess? But I can't put my finger on what it is. The problem is there are times that I might think it's better, but other people think a photo's too saturated/fake. If you google it, you'll see people sharing their before and after shots.

        • Great metaphor with the cooking. I get exactly what you mean (from previous things I've modded). Your finished guide will be a huge help to anyone wanting to cook.

          Quick question about the unlocking thing. I just ordered an unlock with my old phone. That's fine right? In a few days they'll give me a code or something and all I have to do is put it in my new phone right? It doesn't somehow detect my exact phone when I request does it?

          As for the photo thing, I can actually help with that (a bit)! So from my understanding Google HDR just takes HDR images. (Which most camera apps do, but I gather Google has a more optimal forumla or something.). Cameras, like our eyes have a limited dynamic range. Cameras are worse at it than we are. If you were outdoors on a bright day and were to look somewhere dark like in a underground car park, it'd be pitch black down there. But as soon as you yourself go downthere your pupils adjust and you can see what's down there. Cameras are the same, this is why sometimes your sky will be so bright it just sees white, and why some parts are so dark it just sees black. An HDR image takes 2+ photos and merges them. It takes a photo with the camera's 'pupil' wide open and another photo with the pupil low. So it gets the bright details and the dark details and combines them. If you Google "HDR Photos" you'll see examples of exaggerated ones. The exaggerated ones look fake because they capture too much detail that we wouldn't even see with our eyes. And this is also why HDR photos take longer to shoot (because its multiple photos). And finally, this is why you'll very rarely ever see HDR Video (it can't capture video that fast). So practically, its cool to use but I wouldn't trust it for any fast shots like sports.

          My interest is mainly in video but I trust your judgement and will follow your tutorial. Can't wait! My phone arrives today!! Thanks so much!

        • @amrdeus:

          Quick question about the unlocking thing. I just ordered an unlock with my old phone. That's fine right? In a few days they'll give me a code or something and all I have to do is put it in my new phone right? It doesn't somehow detect my exact phone when I request does it?

          Unlocking in the context of this is actually referring to applying for the ability to unlock your bootloader from Xiaomi. It sounds like you're describing unlocking your phone from a telco such that you can use any SIM card in your network locked phone (e.g. Telstra/Optus locked phone). This is different.

          In addition, the lock is tied to your Mi Account, so it's not tied to your phone.

          Your description about the images makes a lot of sense! I could've probably googled it but I've never been interested enough to try and understand it better.

    • I'm reading this

  • +3

    Ok. I'm going to compile this over the next couple of weeks when I get time. Work's been really busy but I think I'm basically ready to share everything and put it into a step by step!

    • +2

      Nice work illumination.

    • +2

      Thanks, just got my xiaomi, and I'm finding it difficult to find a good guide, so I look forward to your tutorial!

  • +3

    I applaud you for taking the time and trouble to post this, and also for sharing it.

  • +2

    Extra notes for myself:

    • To change SuperSU installation to Magisk

    Magisk is an alternative method of obtaining root (as opposed to SuperSU) which hides itself better than SuperSU. Haven't personally done this yet myself, but I do intend to do this. Closest to guide I can find

    Summary of guide to come:

    • Unlock Bootloader
    • Flash "custom recovery" TWRP
    • Flash "lazy firmware" (required for MIUI to boot up after unlocking bootloader)
    • Install LineageOS
    • Flash "cm-14.1-mido-firmware-20170430.zip"
    • Install GApps
    • Flash Magisk
    • Edit build.prop, install Google Camera

    Summary of changes:

    • Custom Recovery TWRP installed
    • LineageOS replaces MIUI
    • Root access via Magisk
    • Google Camera mod installed
    • Yeah definitely interested in the Magisk installation. When do you reckon you'll get your guide up?

    • I just installed Magisk a few days ago on my RN3 and will definitely be doing it on my RN4X when it arrives.
      I had already unlocked bootloader, firmware etc so just flashed the LineageOS, Gapps, and Magisk. Worked perfectly.

      Can confirm it hides itself much better than SuperSU and I am able to use 7-Eleven Fuel app now after having issues with other Superuser variants. Other apps also work now that it can't detect root.

    • Thanks for your efforts. I'm the same as you were, finding all this info on how to do it, but a lot of it is not clear and one guide is different to another.

      Thanks to @jtrvk and @tatsulotto for their help and explanations. Has helped me heaps.

      Just received my Note 4x and have started the process of unlocking. Hope to get all my other ingredients and have cook up on the weekend :-)

      • Hi Guys, third time trying to write this. Converted from MiUi yesterday following a combination of steps from here, the video mentioned in the op and the Lineage installation page. Went pretty well but was getting frustrated and tired towards the end.

        Basically I:
        * Unlocked the bootloader after waiting three days, used the video to help there
        * Flashed TWRP following the Lineage webpage
        * Don't think I did the lazy firmware step
        * Installed Lineage and Google apps following Lineage webpage
        * Flashed Magisk, was going to use Red Wolf but was getting tired and frustrated and had Magisk downloaded already
        * For the camera I found a slightly updated page on the XDA forums and it seems to back up what @Mattystein says below and the editing of the build.prop isn't required
        + Link to the updated camera https://www.xda-developers.com/google-camera-hdr-customizati…
        + Note there are two links on the page I used the first one "Download Google Camera Port with HDR+, ZSL, and RAW Capture" Have a read of the page.
        * Finally I flashed the zip that @tatsulotto mentioned https://drive.google.com/file/d/0B8e7Gjb1XkJ0eHozYmFoTHJFcEU…

        Been using it for the last 24 hours and all seems to be good.

        Thanks to everyone who has contributed especially @illumination, @jtrvk and @tatsulotto.

        Was fun but frustrating at times and rewarding when you see it boot up and everything works. I still have a lot to learn but has been a good start.

  • @illumination:
    So I have just today unlocked bootloader and installed LineageOS, Gapps, Magisk etc on my brand new RN4X.

    A quick note:
    It seems with latest Lineage or other custom ROMs there is no need to edit build.prop as the Camera2 stuff is already enabled.
    So you can simply download the ported HDR camera APK from the link you provided and install.
    The camera app worked for me without editing build.prop.

    Use Manual Camera Compatibility app from Play Store to confirm Camera2 API stuff is all enabled if you really want to (which I did before attempting a build.prop edit).

  • Apologies all. I haven't neglected this (entirely). I've just been overseas and still am and honestly haven't had the time to get around to this. I actually had to reinstall the OS on my phone once about a month ago (don't even know what happened) and haven't even get back around to trying to root using Magisk or reinstalling Google Camera.

    In other news, it seems that Xiaomi are not releasing a Xiaomi Redmi Note 5. At least not with that name. It supposedly has already been released as the Xiaomi Redmi 5 Plus..

    You know what. Considering the popularity of the Redmi Note 4, I think this deserves its own post.

Login or Join to leave a comment