[ONE General] thunderteaser:
Since getting the OPO, I heard that CM camera was nothing compared to the ColorOS one, but no one has ever provided a port. I just wanted to know why it was so hard since even I could port TouchWiz apps in a breeze. So these are my findings (and my 2 cents):

1. Pushing the app to /system or signing it and installing it as a regular apk results in a force close. This happens obviously because it requires something that could not be found on our stock CM11S. As you can read in the logcat:

E/AndroidRuntime( 1027): FATAL EXCEPTION: main
E/AndroidRuntime( 1027): Process: com.oppo.camera, PID: 1027
E/AndroidRuntime( 1027): java.lang.NoClassDefFoundError: com.oppo.os.OppoUsbEnvironment
E/AndroidRuntime( 1027): at com.oppo.camera.Storage.initializeStoragePath(Storage.java:99)
E/AndroidRuntime( 1027): at com.oppo.camera.ActivityBase.onCreate(ActivityBase.java:292)
E/AndroidRuntime( 1027): at com.oppo.camera.Camera.onCreate(Camera.java:2740)
E/AndroidRuntime( 1027): at android.app.Activity.performCreate(Activity.java:5231)
E/AndroidRuntime( 1027): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
E/AndroidRuntime( 1027): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
E/AndroidRuntime( 1027): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
E/AndroidRuntime( 1027): at android.app.ActivityThread.access$800(ActivityThread.java:135)
E/AndroidRuntime( 1027): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
E/AndroidRuntime( 1027): at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime( 1027): at android.os.Looper.loop(Looper.java:136)
E/AndroidRuntime( 1027): at android.app.ActivityThread.main(ActivityThread.java:5017)
E/AndroidRuntime( 1027): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 1027): at java.lang.reflect.Method.invoke(Method.java:515)
E/AndroidRuntime( 1027): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
E/AndroidRuntime( 1027): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
E/AndroidRuntime( 1027): at dalvik.system.NativeStart.main(Native Method)

This basically means that the definition of the class "com.oppo.os.OppoUsbEnvironment" could not be found in the class path. In simple words: the app wants to know where to store files, but the file providing that information could not be found, causing a FC. That class lies indeed in oppo's secondary framework: oppo-framework.jar.

2. Pushing oppo-framework.jar and oppo-framework-res.apk to /system/framework is no use. I even odexed it, but the results were the same. OppoCamera.apk still crashed and produced the same logs as before. No matter what I did, Oppo's framework was not included into $BOOTCLASSPATH.

3. Forcing the system to accept oppo's framework didn't work. I exported it to $BOOTCLASSPATH like this:

export BOOTCLASSPATH=$BOOTCLASSPATH:/system/framework/oppo-framework.jar

and I even added it to init.rc (or init.environ.rc) but to no avail.

4. I came up to the conclusion that ColorOS primary framework probably needed to be ported too. In fact, I decompiled framework.jar and found many smali files related exclusively to "oppo". But, at this point, my knowledge stops.

Then I stumbled upon a post on this forum where a recognized developer said he gave up on porting ColorOS camera to Xperia because it was relying too badly on oppo's framework and kernel. I read that he tried porting all the needed smalis to the xperia framework, when he realized that it required too many efforts. I would have quoted him, but I can't find the post I need anymore.

In the end, what I've learned from this experience is that I had to learn Java when I had time that porting this app is very hard and requires a lot of time, but

it IS possible

. Probably, the reason why we still don't have a ColorOS camera port is because developers have no time or no interest in doing it.

Hopefully this thread will be used as a starting point for anyone that knows how to do things the correct way , or as a way to discuss your efforts and your findings about this porting attempt to learn more from each other. :highfive:

EDIT #1: Links to firmware downloads in this post.

EDIT #2: Found a way to let CM11S know that oppo firmware is present. After packing all together and flashing, debugging will start directly from my OPO. Hold tight and please be patient! I will get to you soon.