[GUIDE][ROOT][MAGISK] Photochrom Filter Enabler

Search This thread

xian1243

Member
Mar 1, 2010
45
56
Disclaimer: you accept responsibility by flashing this magisk module to your device at your own risk. If you experience any issues with Magisk, please refer to https://github.com/topjohnwu/Magisk/issues

This magisk module was created by isolating the diff between the full payload.bin of OOS 10.5.8 and the delta payload.bin of OOS 10.5.9 which had entirely disabled the Photochrom camera.

- Tested on OOS 10.5.10 IN2025.
- Currently not working on OOS 10.5.11 IN2025 due to additional changes that were made, I am working on fixing this. Please do not ask me for an ETA or complain about my internet uploads speeds.

Please advise: this has not tested on Indian or European models, and I cannot guarantee compatibility.

Download link (compatible with OOS 10.5.10) for IN2025: https://www.androidfilehost.com/?fid=8889791610682885705

I identified the following changes:

/system/priv-app/OnePlusCamera.apk: removal of the photochrom filter selection, confirmed via changes in smali bytcode
/vendor/lib/camera/: various camera firmware binaries were recompiled, including changes to what I presume to be the 5MP camera with the built-in infrared lens filter (gc5035)
/vendor/lib/camera/components/: various camera component feature stubs/wrappers for the camera apk
/vendor/lib/hw/: changes to camera.qcom.so, which is compiled against the previously mentioned binaries, statically linked
/vendor/lib64/camera/: same as above
/vendor/lib64/camera/components/: same as above
/vendor/lib64/hw/: same as above

This magisk module will restore these changed files, including the stock camera application, camera firmware binaries/drivers and dependencies systemlessly. If you would like to revert the changes, simply disable or remove the magisk module via magisk manager.

Enjoy!
 
Last edited:

Oswald Boelcke

Senior Moderator / Moderator & RC-RT Committees
Staff member
  • Like
Reactions: Mar-cel

xian1243

Member
Mar 1, 2010
45
56
please for non root device please. (can flash over twrp without root ?)
because root is fail cts profile is false?
for oneplus 8 pro 10.5.10

Root with Magisk shouldn't break CTS profile. That being said, you could theoretically put these files directly onto the /system and /vendor partitons, however making changes to those partitions will most definitely cause you to fail CTS profile checks.

edit: I've been advised by Some_Random_Username that with HW attestation keys being enforced by Google now that will cause Magisk to fail SafetyNet/CTS.
 
Last edited:

xian1243

Member
Mar 1, 2010
45
56
Broken also on 10.5.11 on IN2025.

This was tested on IN2025 10.5.10. It seems like Global version 10.5.11 and EU version 10.5.10 breaks the module, I'll have to look and see what changes were made. The changelog for this new update includes "adjustments" to the photochrom filter which was reenabled... but now doesn't "see through" plastics and such. That being said we may be able to reverse those changes with a similar module.
 
Last edited:
  • Like
Reactions: ask77

Dashwood Foxe

Senior Member
Dec 23, 2014
162
55
This was tested on IN2025 10.5.10. It seems like Global version 10.5.11 and EU version 10.5.10 breaks the module, I'll have to look and see what changes were made. The changelog for this new update includes "adjustments" to the photochrom filter which was reenabled... but now doesn't "see through" plastics and such. That being said we may be able to reverse those changes with a similar module.

Update disables the unfiltered camera and uses the ultrawide instead.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 14
    Unfortunately this is proving to be harder than I thought. There are dozens of changes to the camera libraries and new changes I am not familiar with. No ETA yet but still working on this.
    7
    Disclaimer: you accept responsibility by flashing this magisk module to your device at your own risk. If you experience any issues with Magisk, please refer to https://github.com/topjohnwu/Magisk/issues

    This magisk module was created by isolating the diff between the full payload.bin of OOS 10.5.8 and the delta payload.bin of OOS 10.5.9 which had entirely disabled the Photochrom camera.

    - Tested on OOS 10.5.10 IN2025.
    - Currently not working on OOS 10.5.11 IN2025 due to additional changes that were made, I am working on fixing this. Please do not ask me for an ETA or complain about my internet uploads speeds.

    Please advise: this has not tested on Indian or European models, and I cannot guarantee compatibility.

    Download link (compatible with OOS 10.5.10) for IN2025: https://www.androidfilehost.com/?fid=8889791610682885705

    I identified the following changes:

    /system/priv-app/OnePlusCamera.apk: removal of the photochrom filter selection, confirmed via changes in smali bytcode
    /vendor/lib/camera/: various camera firmware binaries were recompiled, including changes to what I presume to be the 5MP camera with the built-in infrared lens filter (gc5035)
    /vendor/lib/camera/components/: various camera component feature stubs/wrappers for the camera apk
    /vendor/lib/hw/: changes to camera.qcom.so, which is compiled against the previously mentioned binaries, statically linked
    /vendor/lib64/camera/: same as above
    /vendor/lib64/camera/components/: same as above
    /vendor/lib64/hw/: same as above

    This magisk module will restore these changed files, including the stock camera application, camera firmware binaries/drivers and dependencies systemlessly. If you would like to revert the changes, simply disable or remove the magisk module via magisk manager.

    Enjoy!
    2
    OnePlusCamera.apk simulated InfraredCamera flags

    While examining OnePlusCamera.apk with a friend (see also: OnePlusCameraService.apk, CameraPicProcService.apk), we found flags for simulating the 'photochrom' (infrared) camera in the apk version from the official 10.5.13 images for the OnePlus 8 Pro (OnePlus8ProOxygen_15.O.22_OTA_022_all_2008080055(_29200cde68411c2)):

    Code:
    package com.oneplus.camera.hardware.camera2.wrappers;
    ...
    /* compiled from: InfraredCameraBuilder.kt */
    public final class InfraredCameraBuilder implements CameraInterfaceBuilder<Camera> {
        public static final Companion Companion = new Companion(null);
        private static final Feature FEATURE_ENABLE_IR_CAMERA = Feature.Companion.create("InfraredCameraBuilder.EnableInfraredCamera");
        /* access modifiers changed from: private */
        public static final Feature FEATURE_MODELS_TO_DISABLE_IR_CAMERA = Feature.Companion.create("InfraredCameraBuilder.ModelsToDisableInfraredCamera");
        private static final Feature FEATURE_SIMULATE_BY_UW_CAMERA = Feature.Companion.create("Simulation.OPInfraredCamera.UseUWCamera");
        private Boolean isRtbInfraredCameraSupported;
        private final Lazy modelsToDisable$delegate = LazyKt.lazy(InfraredCameraBuilder$modelsToDisable$2.INSTANCE);
    ...

    Code:
    package com.oneplus.camera.hardware.camera2.wrappers;
    ...
    /* compiled from: OPInfraredCameraImpl.kt */
    public final class OPInfraredCameraImpl extends OPSimpleFeatureCamera implements InfraredCamera {
        public static final Companion Companion = new Companion(null);
        /* access modifiers changed from: private */
        public static final Feature FEATURE_SIMULATE_BY_UW_CAMERA = Feature.Companion.create("Simulation.OPInfraredCamera.UseUWCamera");

    Code:
    package com.oneplus.camera.features;
    ....
            featureInitializer.set("Simulation.OPInfraredCamera.UseUWCamera", false);

    This made us wonder whether 'Simulation.OPInfraredCamera.UseUWCamera' (fake infrared camera) might be somewhere in shared_prefs for the camera app, e.g. '/data/data/com.oneplus.camera/shared_prefs/' or similar.

    I do not currently have the hardware myself. I just want to understand whether it is possible to somehow force enabling the real IR camera without paying USD 900+ for it beforehand. I tried to check using the Android emulator, but getting OnePlusCamera.apk to run was too difficult for me (custom ARM AVD using the official images would be needed as the apk contains native ARM code and checks system environment details, and I couldn't make it boot). Hence:

    If someone with a root file manager would be interested in checking around in /data/data/com.oneplus.camera/shared_prefs or thereabouts for a value called 'Simulation.OPInfraredCamera.UseUWCamera', we might be able to find a way to turn it back on.

    Do you see this value there somewhere?

    EDIT:

    Note that 'Simulation.OPInfraredCamera' and 'UseUWCamera' and similar do not occur anywhere in CameraPicProcService.apk, though simulation options for other cameras do. Also, OnePlusCameraService.apk is very simple internally and does not do any of this stuff in general. Internally, the 'photochrome' mode is referred to simply as 'InfraredCamera' and *'chrom'* does not appear in any relevant contexts except in some tutorial and menu-related text in other locations.

    It kind of looks like the disabling changes may have been made entirely in OnePlusCamera.apk. However, OnePlusCamera.apk contains native code interfacing with the libraries for the camera drivers themselves, which have been updated in successive releases, so downgrading the apk without downgrading the entire release ROM breaks the camera app (as other users here have confirmed). Point being: even if shared_prefs does not contain the strings discussed above, it may still be possible to patch the apk with dexpatcher-tool or similar to hard-code a value to avoid the fake IR camera.
    2
    Update disables the unfiltered camera and uses the ultrawide instead.

    As far as I'm concerned that's just as bad as outright disabling it. Nobody asked for an overlay of the ultrawide. I'm spending some time looking through all the changes but it looks like there is a substantial amount.
    1
    ...

    Download link: (pending)

    ...
    Taking a bit longer than expected to upload, but it is coming. :)

    @xian1243 THREAD CLOSED! Placeholder are not accepted.

    Please advise the moderators' team (best via the report function) when ready to provide a download link.