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.