Z3/Z3C Sony Stock camera on AOSP/CM

Search This thread

curlyboi

Member
Jan 3, 2008
44
5
Prague
Not being stranger to ROM changing, after buying my Xperia Z3 Compact, I went straight for the bootloader unlock (following CM official wiki page). I did not backup my TA partition and therefore, my DRM keys are gone forever. Such is life. But I am not giving up...

I installed ResurrectionRemix (AOSP/CM based) and I am quite happy with it, but I thought it would be nice to have the original stock Sony camera functionality.
What I managed to do so far:
  1. Mod the RR framework using this guide, which means:
    - get /system/framework/framework.jar from your phone
    - unpack classes.dex using your favorite archive tool
    - decompile the classes.dex using Rom Tools (direct download link)
    - overwrite the files with the ones from the linked guide
    - compile it back to new classes.dex
    - pack the modded classes.dex to the framework.jar
    - copy the new framework.jar to /system
  2. Install Sony Stock camera using this guide:
    - flash the stock camera port
    - flash panorama sweep fix
    - flash face detection fix
  3. Deactivate the standard CM camera apps
    - including CameraWorkaround, Camera2, etc.
  4. Clear data of all camera-related apps
    - if you don't, the Sony Stock camera might crash, I checked logcat and found out it was because of SQLite DB version mismatch that the CM camera created and the Sony Stock camera couldn't use.

Then I found this thread:
[Z~Z5 Series][EXRxTHS]SONY DRM FUNCTION RESTORATION FOR UB DEVICE | Z3 lines support!

If what is claimed there really works, then the Sony proprietary image processing can be enabled even without the DRM keys. That basically means that the DRM keys are only used as verification, but the software performing the processing is indeed in the ROM.
The thread itself states that it is only for stock-based ROMs as AOSP/CM ROMs don't have the functionality in the first place. I might be wrong, but I believe that by modifying my framework I have imported some of these functionalities back into the phone.
If it was possible to port some parts, it should be possible to port more of them, including the image processing.

So I am starting this thread to track progress in this and to find the last piece of the puzzle - to bridge the gap between having Stock Camera framework and app on AOSP/CM ROM and the DRM patch, which probably patches the DRM-checking core to always return "keys are fine" even if they are missing,
 
  • Like
Reactions: bane.twit

Cirra92

Senior Member
Jan 16, 2013
965
597
Nis
Xiaomi 12X
I am interested in this as well, because I always prefer using AOSP than stock rom, be it on Sony device, Samsung, whatever. But lack of proper camera is keeping me away, mainly the reversed fish eye effect.
Have you experienced some crashes with that setup? I remember that people reported various crashes with that port.
I would help, but I have zero knowledge about coding and porting and everything associated with it unfortunately.
 

curlyboi

Member
Jan 3, 2008
44
5
Prague
no crashes for me like this. but i have uninstalled most of the "fancy effects" apps in the bundle. so i got superauto, manual, livecast, some fx and stickers and thats about it
 

Cirra92

Senior Member
Jan 16, 2013
965
597
Nis
Xiaomi 12X
no crashes for me like this. but i have uninstalled most of the "fancy effects" apps in the bundle. so i got superauto, manual, livecast, some fx and stickers and thats about it

I don't need fancy stuff either, I would keep 4k video and Slow motion video out of all those and that's it. So I guess I could try some AOSP if it works on your side as you say :D

Some questions though. Do you think I can use zezadas' unlocked camera app with this port? It's just a matter of replacing apk only, nothing else.
And which version of RR do you use, based on CM13 or CM12.1?
 
Last edited:

curlyboi

Member
Jan 3, 2008
44
5
Prague
It's RR based on 12.1.

And I don't plan on updating too often... Maybe once some very important fix comes out, but before that it's not necessary. I customize everything so every ROM reinstall is so much pain in the ass for me, hours going thru all the 200 apps and setting everything
 

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    Not being stranger to ROM changing, after buying my Xperia Z3 Compact, I went straight for the bootloader unlock (following CM official wiki page). I did not backup my TA partition and therefore, my DRM keys are gone forever. Such is life. But I am not giving up...

    I installed ResurrectionRemix (AOSP/CM based) and I am quite happy with it, but I thought it would be nice to have the original stock Sony camera functionality.
    What I managed to do so far:
    1. Mod the RR framework using this guide, which means:
      - get /system/framework/framework.jar from your phone
      - unpack classes.dex using your favorite archive tool
      - decompile the classes.dex using Rom Tools (direct download link)
      - overwrite the files with the ones from the linked guide
      - compile it back to new classes.dex
      - pack the modded classes.dex to the framework.jar
      - copy the new framework.jar to /system
    2. Install Sony Stock camera using this guide:
      - flash the stock camera port
      - flash panorama sweep fix
      - flash face detection fix
    3. Deactivate the standard CM camera apps
      - including CameraWorkaround, Camera2, etc.
    4. Clear data of all camera-related apps
      - if you don't, the Sony Stock camera might crash, I checked logcat and found out it was because of SQLite DB version mismatch that the CM camera created and the Sony Stock camera couldn't use.

    Then I found this thread:
    [Z~Z5 Series][EXRxTHS]SONY DRM FUNCTION RESTORATION FOR UB DEVICE | Z3 lines support!

    If what is claimed there really works, then the Sony proprietary image processing can be enabled even without the DRM keys. That basically means that the DRM keys are only used as verification, but the software performing the processing is indeed in the ROM.
    The thread itself states that it is only for stock-based ROMs as AOSP/CM ROMs don't have the functionality in the first place. I might be wrong, but I believe that by modifying my framework I have imported some of these functionalities back into the phone.
    If it was possible to port some parts, it should be possible to port more of them, including the image processing.

    So I am starting this thread to track progress in this and to find the last piece of the puzzle - to bridge the gap between having Stock Camera framework and app on AOSP/CM ROM and the DRM patch, which probably patches the DRM-checking core to always return "keys are fine" even if they are missing,