• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

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

Search This thread

JonnyJaap

Senior Member
Jul 3, 2012
175
28
Thought I'd give it a shot on 12 :( nope.

Shame.

Tbh I barely used the photochrom but because it's gone now I want it back lol.

They made some changes, after the last update it is no longer possible to open the factory camera.

I also only use it very rarely, but when they sale a phone and marked with with 4 lenses, but changing 1 of the lenses to be used as an filter, not as an standalone, as intended. I fell ripped of.
Now it's 3 lens with a special filter.... I could image that it is possible to get very similar images without the ir lens.

Really a shame seeing how they active work against there customer..
 
  • Like
Reactions: franco985

franco985

Senior Member
Feb 9, 2011
281
54
OnePlus 8 Pro
OnePlus 9 Pro
They made some changes, after the last update it is no longer possible to open the factory camera.

I also only use it very rarely, but when they sale a phone and marked with with 4 lenses, but changing 1 of the lenses to be used as an filter, not as an standalone, as intended. I fell ripped of.
Now it's 3 lens with a special filter.... I could image that it is possible to get very similar images without the ir lens.

Really a shame seeing how they active work against there customer..
I am writing all day in OnePlus forum about that, I feel cheated by OnePlus
 

__niflheim

New member
Jan 14, 2018
2
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.
 
Last edited:

dladz

Senior Member
Aug 24, 2010
13,181
4,218
Liverpool
Huawei Watch 2
OnePlus 8
I'm running the latest NoLimits xXx ok an EU version of the 1+8 pro 10.5.12

Using the factory mode code:

*#808#

Then going to the camera tab

Then selecting the "back" "fourth" camera as a preview.

I can use the IR as expected.

Taking pictures isn't allowed but I can take a screen shot which is fine.

Not sure if this has been reported just my observation.
 
  • Like
Reactions: Matr0x

franco985

Senior Member
Feb 9, 2011
281
54
OnePlus 8 Pro
OnePlus 9 Pro
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.

Maybe if you carry out the same investigation on a previous version of camera app, for example camera app from 10.5.8, you could figure out the differences.
 

drevel123

Senior Member
Apr 28, 2013
115
38
I'm running the latest NoLimits xXx ok an EU version of the 1+8 pro 10.5.12

Using the factory mode code:

*#808#

Then going to the camera tab

Then selecting the "back" "fourth" camera as a preview.

I can use the IR as expected.

Taking pictures isn't allowed but I can take a screen shot which is fine.

Not sure if this has been reported just my observation.

Thank you very much for this tip. I'm on 10.5.13 (EU), using the factory mode code nothing happened. After installing the latesr NoLimits xXx the method you described also works for me.
 

dladz

Senior Member
Aug 24, 2010
13,181
4,218
Liverpool
Huawei Watch 2
OnePlus 8
Thank you very much for this tip. I'm on 10.5.13 (EU), using the factory mode code nothing happened. After installing the latesr NoLimits xXx the method you described also works for me.

Very welcome mate.

Yep after upgrading to .13 it also didn't work for me, then after installing xXx the code worked again.

I'd imagine this is the factory mode switch being enabled via installing xXx..

So in theory it could be enabled by just using a module to enable factory mode..

Or just stick with xXx ;)
 
  • Like
Reactions: Matr0x

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.