[Xiaomi Redmi Note 5 Pro Themes, Apps, and Mods] scricccettoni:
MIUI Camera v2 - from Mi A2 series

Working on Oreo and Pie (TWRP or Magisk), with packages for AOSP and MIUI based ROM.

Test version includes files from BDD Camera booster patch for gcam fix (front and rear module) by BeatByDad (his work is based on RN5patch from nHappyMan).

For full compatibility (with also gcam support) use build.prop_edits addon to change build.prop

Gcam version suggested

Info:

For AOSP

From dumps of Mi A2, the Camera app works on Lineage 15.1 with the help of some libs, so I've made my module to use it on Los. Thanks to others finding I've now found my perfect combination of options and quality so far.

I've solved sound issue and made a fingerprint shutter toggler (TWRP only) that works system wide.

Note: The camera don't needs camera2 api but works with it enabled too.

For MIUI

The MIUI packages are a simpler version because there is no need to install another camera, stock one is already MIUI Camera v2. The mod just enables more functions in the stock app (you can see from the function list what is enabled and what is stock).

there is no need for camera sound fix or fp shutter toggler here since it's al managed by MIUI.

Depending on the MIUI version there are more function like 60fps available.

Link github repo:

AOSP - MIUI

Functions:

in italics options added (not enabled in stock MIUI Camera for whyred)

PHOTO

AI mode

Portrait mode

Full manual mode (1/4s max shutter)

Square mode

Panorama (full quality)

Peak focus (when manual focus)

Grid toggle

Scene modes

Tonal and color presets

HHT

Straighten

Tilt-shift

Group Selfie (works good only when phone is horizontal)

Beautify and Beautify pro (v2)

Timer (3s and 5s)

HDR (on, off, auto), HDR pro (default) and live HDR

Torch mode (back and front)

Increased burst shoot (100 pics)

Better lowlight shot

VIDEO

4K record (30fps)

1080p 60fps

Video image stabilization (software, not with 4K)

Slow motion 720p,120fps - 1080p,120fps (last one, only AOSP)

Time lapse

AUDIO

Camera sound toggle

Increased aac bitrate

ADD-ON

Fingerprint shutter toggler (system wide)

Editor for build.prop with TWRP package

Known Issue:

group selfie partially working (good when taking horizontal shot).

1/2 shutter take faster speed pic at nearly 1/6s

On indian models front filter not working (for now disabled because not supported by miui camera, new version supports it)

audio fix disables system camera sound (so they don't work with camera apps that uses them like snap camera)

TWRP package need to be reinstalled after a dirty flash or ROM updates (it gets uninstalled by doing that so can be done to remove the package)

systemwide fingerprint act as a selector when out of camera app (set your camera icon up left in home screen to have fp quick shortcut to camera too)

other camera patches (for examples some gcam patches) can reduce functionality (test without any other patches if having problems at first).

Install:

Select installer you prefer:

- Magisk if you have it installed and want easy install/uninstall and OTA survival

- TWRP if you want to keep system rootless (need to be reinstalled after a dirty flash or a ROM update).

and select:

- AOSP if on Lineage or any AOSP based ROM

- MIUI if you are on a MIUI based ROM

Install Magisk modules in magisk (from magisk repo too) or TWRP (on your choice) and reboot;

For TWRP installer make a backup of system and vendor in TWRP to uninstall. Also dirty flash ROM will restore system and vendor as before installing the package.

For Magisk AOSP since v0.20 you can choose to install FPShutter_toggle also, to enable system wide fingerprint shutter. It's on a separated module so people can chose if enable it and use it on other ports too.

Note: A second install of FPShutter toggle will revert back files as before disabling the module (uninstall), so next time only need to update Camera module/installer.

If camera don't start check permission, try to clear app data (it will reset permission too).

If still not working wipe cache and dalwik from TWRP.

Download:

LAST STABLE RELEASES - AOSP or MIUI, TWRP or MAGISK

Additional packages:

For fingerprint shutter toggle (AOSP only, MIUI not needed):

Since v0.20 Fingerprint Shutter is a separate TWRP installer, so can work on other ports too.

FPShutter_toggle-TWRP_0.4 <--install from twrp ( once, if reinstalled it will revert the mod.)

tip: I have camera icon in up left corner of home screen so when tapping on fp it get selected another tap opens camera and third tap shoots a pic.

For build.prop edits:

Since the package don't need any build.prop on most system but I like to have some set. I came up with that TWRP package that can survive OTA and dirty flash.

It will backup original system/build.prop to system/build.prop.bak and edit prop saved in system/etc/build.prop_edits.sh.

So to use your config just change content in build.prop_edits.sh relative to props and recompress the package.

build.prop_edits-TWRP_v0.2.zip

TEST releases:

AOSP-TWRP:

TEST:

- MiCamV2_whyred_v1.0.3d.zip

- AOSP-TWRP_MIUICamerav2_v1.0.2_TEST

TO PROPERLY TEST AND AVOID ERRORS: DIRTY FLASH ROM AND WIPE DALVIK AND CACHE

MAKE A TWRP BACKUP TO BE SURE TO BE ABLE TO RESTORE IF SOMETHING GOES WRONG!

WARNING! If the ROM already includes MiCam as stock, updating the app with the test package can give errors.

To avoid any update error before installing the test package manually delete:

/system/priv-app/MiuiCamera
/data/data/com.android.camera

Then restart system and after install test module from twrp.

Changes:

1.0.3 Unity installer (universal for TWRP-Magisk-MIUI-AOSP) with Stable and Test version plus options to install various patches (RN5CP v1.015 or 1.035; BBDCB v3.1 or back only) and also included fp shutter fix (optional)

1.0.2

- New apk (from jasmine miui 9.6.16 with some patches by me),

- AI mode in front cam and portrait restored for testing (but don't work so can be keept off),

- restored tilt-shift (with some gcam mod can have shutter in preview),

- beautify 3d,

- 1080p 60fps

- 720p 240fps HFR

- new advanced portrait mode with scenes and AI,

- enabled indian filter,

- test support 32s shutter for india model (reported not working),

- front cam, back camera and 1080p fix for gcam by BeatByDad (included BDD camera booster v3.1),

- seems that google photo now enables unlimited free storage for full size pic like pixel (not confirmed)

- more under the hood options enabled.

Bugs:

- wrong preview in manual mode if manual shutter is set to any value.

- Shutter is enabled to go till 32s but max shutter is 1/4s (for global/china models) till we find how to patch lib.

- 240fps in HFR works only 720p (sometimes gives errors)

- front portrait is broken by BBD camera booster front cam fix, not yet found a solution.

MIUI-TWRP: no plans for now

Magisk: will be TWRP only

Magisk repository:

Latest Magisk modules are both in magisk repo choose the one you need based on system in use.

To find them easily search for "whyred"

If MIUI based rom use: MIUIcamera v2 MODs for whyred (Redmi Note 5 / pro) MIUI;

if AOSP based rom use: MIUIcamera v2 PORT for whyred (Redmi Note 5 / pro) AOSP.

Credits:

I saw the works of [MENTION=4904853]carlosggb[/MENTION] and [MENTION=7917498]ARNOB XENON[/MENTION] and from them I've took the slow-mo fix by [MENTION=7571048]Dyneteve[/MENTION] and some video recording improvements inspiration also applied with magisk the sound fix by [MENTION=2983581]lawong[/MENTION].

The audio recording fix by [MENTION=4702982]rocker00[/MENTION] is not anymore supported and on some ROMs it gives problems.

Other people working on improving our camera have inspired and helped this work to be done: [MENTION=6519039]jhenrique09[/MENTION], BeatByDad, nhappyMan and others...