yashsingh1/xdaforums huggingface dataset:
[Treble-Enabled Device Development A/AB ROMS] mihaistefan88:
Depends on what you call easy. As i said in my older posts, the steps I made are the following:

- copied the apk from the stock rom, signed it using phhusson's script

- copied the library in the #4 th post to /vendor/lib64

- copied the library in the #54 th post to /vendor/lib64

It worked, but apparently there are some graphics fixes implemented in the AOSP ROM by phhusson which weren't implemented in the Lineage OS 15.1 source code, so i got some bugs with the viewfinder and crashes when trying to select slow motion mode. Additionally, I couldn't select some of the photo resolutions I have on the stock ROM.
[Treble-Enabled Device Development A/AB ROMS] ngoralph:
can you open the pictures directly from the camera app??
[Treble-Enabled Device Development A/AB ROMS] mihaistefan88:
Nope. I think it's something about missing the huawei gallery app (just a hunch)
[Treble-Enabled Device Development A/AB ROMS] 4RK4N:
confirmed working on honor 9 lite running lineageOS view 10 rom. repacking was neccessary indeed. without it camera fc'ed when opened.
[Treble-Enabled Device Development A/AB ROMS] daina:
Stupid Question, Maybe...?

I have spent the better part of my workday getting my Mate 9 to this place. I unlocked my bootloader, I installed Resurrection Remix, I installed TWRP, Magisk, I'm passing SafetyNet...

This is my first stump-point.

Without the stock camera, the Mate 9 is... less...

I know there's a script, I just lack the experience or know-how to run it.

Can someone point me in the right direction? I have moved the apk into the proper directory, and applied the two fixes, I think that there's a script I was supposed to run before anything, though.

Pleeeeease - I can't go back to EMUI...
[Treble-Enabled Device Development A/AB ROMS] daina:
I did it.

I used an app called ZipSigner, available in the Playstore. I signed the apk, swapped it out with the existing non-working version, rebooted, and BAM!

I am running a rooted, Safety-Net-passing, Magisk-having, Resurrection Remix Oreo build, on the Mate-freaking-9 with the Stock Camera.

I am a badass. Thanks for your help.

Oh that's right, I figured it out myself.

---------- Post added at 02:12 AM ---------- Previous post was at 01:40 AM ----------

Actually, thanks to all the badasses who are making the Treble-thing possible, including phhusson and others waaaay before me in and around this thread.
[Treble-Enabled Device Development A/AB ROMS] cooper2909:
Wow, nice job. So the only missing is volte and wifi calling? Did you check if the ai working?
[Treble-Enabled Device Development A/AB ROMS] devanshu99:
Hi dear great effort , can u check is everything working like a stock camera ,every mod ?
[Treble-Enabled Device Development A/AB ROMS] Mindar95:
Good evening

i want to flash phh treble rom(or ressurection remix rom). I have an Mate 9.

can someone explain me step by step how can i install the stock camera app?
[Treble-Enabled Device Development A/AB ROMS] drift08:
I am using RR O rom and it didn't work for me. The camera app crashes. Any idea? Thanks.
[Treble-Enabled Device Development A/AB ROMS] daina:
I haven't tested every single mod.

Wide aperture works, but since Stock Gallery isn't included, can't be adjusted after the fact. 20MP works, as does Pro mode. Front-facing camera works, but Portrait Mode does not.

---------- Post added at 05:30 PM ---------- Previous post was at 05:26 PM ----------

It's my understanding that the Mate 9's AI is involved in app-switching, mostly? And that's hard to say, as even EMUI needs to build up its profile of your usage habits. Yeah, no volte or wifi calling, though.

---------- Post added at 05:47 PM ---------- Previous post was at 05:30 PM ----------

This is what I did. I placed the apk linked in the first post in the /priv-app folder. Got force-close.

Apply the fix in post #4. Force-close.

Apply the fix in post #54. Force-close.

Downloaded and installed ZipSigner

Copy original apk (HWCamera2.apk) to a navigable place in storage (for me it was Internal Storage/Downloads—ZipSigner couldn't read my SD Card).

In ZipSigner, select the Input/Output button, and select the copied apk. The two fields below the Input/Output button will automatically fill—the Output field will be automatically named HWCamera2-signed.apk.

Still in ZipSigner, select the Sign button. You'll see the app do its thing, and then, your apk will be signed. There are a couple of different ways (keys) of signing. Choose whichever one works for you.

From there, I used Solid Explorer to navigate to the priv-app folder, but not before copying HWCamera2-signed.

Paste HWCamera2-signed into priv-app. You should now have two apps in that folder, the original (HWCamera2) and your signed app (HWCamera2-signed)

Delete HWCamera2.

Rename HWCamera2-signed to HWCamera2.

Check your permissions, make sure the new apk is at 644.

Exit Solid Explorer.

Reboot.

Profit.
[Treble-Enabled Device Development A/AB ROMS] devanshu99:
But these were already had been fix by [MENTION=4960686]OldDroid[/MENTION] treble rom last month. I thought you made it fully stable like emui camera . But even though good work and great efforts .
[Treble-Enabled Device Development A/AB ROMS] Hannestilt:
Hi, I'm on LineageOS 15.1 build for Honor View 10 (my device is an Huawei Mate 10 Pro).

It's confuses me cause I don‘t have a /system/priv-app/HwCamera2/ directory so there is no way to put it there ...

Can someone help?

Thanks in advance!
[Treble-Enabled Device Development A/AB ROMS] The3File:
Just create it, with the same permissions as the other folders in that dir.
[Treble-Enabled Device Development A/AB ROMS] drift08:
I did the above and stock camera nowhere find. After reboot, no stock camera at all. Any idea? Thanks.
[Treble-Enabled Device Development A/AB ROMS] devanshu99:
U can flash Huawei stock camera magisk module to put stock camera by [MENTION=4960686]OldDroid[/MENTION] . Simple and quality like stock camera.
[Treble-Enabled Device Development A/AB ROMS] rufik:
Could you post link to this module, please?
[Treble-Enabled Device Development A/AB ROMS] ValQuev:
Thanks for your answer, do you know where can I find this module ? I have searched on xda and google but I can't find this.
[Treble-Enabled Device Development A/AB ROMS] Mohammed_M.:
What errors have you faced with RROS ROM except the camera is everything working as well as in the stock ROM. thanks in advance ?
[Treble-Enabled Device Development A/AB ROMS] drift08:
I did the above and stock camera nowhere find. After reboot, no mate 9 stock camera app. Any idea? Thanks.
[Treble-Enabled Device Development A/AB ROMS] devanshu99:
https://mega.nz/#!7hQDhQAK!p2s7jQp9-nhp2-O1U2s2GrBB9UVBhgKDtFfHTq_CHvI
[Treble-Enabled Device Development A/AB ROMS] drift08:
Everything else works smoothly besides the RROS built in camera bad. Quality wise. Tried open camera app but it doesn't work with video recording at all.
[Treble-Enabled Device Development A/AB ROMS] daina:
I can't think of why the camera should disappear unless somehow you cut-and-pasted instead of copy-and-pasted. Even then, once you replace the original apk in priv-app, your signed apk should remain after a reboot...
[Treble-Enabled Device Development A/AB ROMS] drift08:
The signed apk is still there but no stock cam app on app drawer at all.
[Treble-Enabled Device Development A/AB ROMS] daina:
Weird thought just occurred to me... Have you tried actually installing the app after signing the apk? Once you bring up the signed apk in the priv-app folder, select it, and go through the Android-install process? After that, reboot, and see what happens. I think I might have had to do that...? Just a thought...
[Treble-Enabled Device Development A/AB ROMS] Hannestilt:
Is someone able to extract the stock EMUI Huawei Mate 10 Pro camera App?!

Unfortunately I‘m not cause by lack of skill.

I tried it with the update.zip and UPDATE.APP but I failed extracting system.img ...
[Treble-Enabled Device Development A/AB ROMS] Mohammed_M.:
Ok, thanks I hope you will get the camera issue fixed as soon as possible, good luck ???
[Treble-Enabled Device Development A/AB ROMS] f0rb1d:
You have to use huawei firmware extractor. If you encounter any extracting issues, unselect verify sum in the settings.

Then you have to select system.img to extract, and try to extract it with Android kitchen or whatever.
[Treble-Enabled Device Development A/AB ROMS] Hannestilt:
Actually I managed it in a different way:

1. I went to the nearest phone store, grabbed the Mate 10 Pro and sended the .apk-file of the stock camera app via bluetooth to my phone... :)

2. Signing the file with the ZipSigner from the PlayStore (The signed .apk is attached)

3. Copying the libHwPostCamera_jni.so file, for example the P10 Plus fix [#4], to /vendor/lib64 (maybe someone can extract the original Mate 10 Pro file)

(4. Moving HwCamera2.apk into the /system/priv-app/HwCamera2 folder of my Mate 10 Pro.

5. Reboot and done.)

It also works by installing it right away without placing the apk in the priv-app directory but reboot is needed in any case.

It worked perfectly for me (with LinageOs 15.1) !

(Sadly photos are just an empty grey box)
[Treble-Enabled Device Development A/AB ROMS] Boolable:
Nice ! Can you send me the APK ?
[Treble-Enabled Device Development A/AB ROMS] devanshu99:
All modes are working fine ? Like stock camera.
[Treble-Enabled Device Development A/AB ROMS] ChriKn:
This solution was the one which worked to install the app, BUT (!) As soon as I shoot a picture and try to open the newly shot picture, everything freezes... The only solution is to wipe the camera app out of recents... any ideas ? I don't want to go back to EMUI :(

Edit : When restarting the camera, I also have to set it up again... something is fishy.
[Treble-Enabled Device Development A/AB ROMS] Gryphie:
Tried this and the app works but the pictures are just empty. When I take a picture and then open Google photos to look at it the picture is just a gray box.
[Treble-Enabled Device Development A/AB ROMS] Hannestilt:
Yes I'm sorry, I didn't noticed it ... :/
[Treble-Enabled Device Development A/AB ROMS] phhusson:
Between your step 1. and 2. did you apply my script?

Because this is the behaviour you get if you don't.

You need to include hwpostcamera *java* framework inside the APK (possibly including it in firmware works as well, but I find it easier to put it in the app)
[Treble-Enabled Device Development A/AB ROMS] ChriKn:
I think most people just miss the script thing (as I did)

Do you think in future there might be an easier solution for all this ? As in flashing a totally generic image as well as a "device-zip" with all the necessary bits and scripts to get each device running properly ?

Thanks for your work !
[Treble-Enabled Device Development A/AB ROMS] phhusson:
Most people take the one in this very thread rather than from a raw device :P
[Treble-Enabled Device Development A/AB ROMS] Gryphie:
Didn't work at first on my Mate 10 pro. But after I applied the other fixes in this thread, post 4 and 54 it worked.
[Treble-Enabled Device Development A/AB ROMS] Hannestilt:
Hi, I did noticed your script but: 1. I'm not sure if running your script is legal in Germany and 2. I don't know how to apply it ... :)

Are you able to do this for us (Mate 10 Pro user's) ? The camera app from Mate 10 Pro is a bit advanced
[Treble-Enabled Device Development A/AB ROMS] ChriKn:
I discussed it with him in PM, he doesn't really want to become a camera app maintainer, it is more to help people use his AOSP from what he told me.

Nobody has to know you did the script and people would be glad ;)
[Treble-Enabled Device Development A/AB ROMS] ChriKn:
Could you share your app please ?

Thanks !
[Treble-Enabled Device Development A/AB ROMS] tiennemannes:
Can anyone confirm the instructions and version as published in the OP is still applicable for V12, Huawei mate 9?
[Treble-Enabled Device Development A/AB ROMS] drift08:
I tried to install the signed app. It wouldn't install. It says "there was a problem parsing the package". Not exactly understand what it means.
[Treble-Enabled Device Development A/AB ROMS] Lazy131:
I also had this problem and guess it has something to do with permissions. Fixed it by granting the apk all rights.

But now after successfully installing the EMUI Stock Camera I can take picture, but when I want to see them in the gallery there is just a grey box. I think this already was mentioned but I haven't read any solution for this. I am on the Honor View 10 btw.
[Treble-Enabled Device Development A/AB ROMS] ngoralph:
after the grey box appears press recents apps button then open the camera app again the image should already be shown there
[Treble-Enabled Device Development A/AB ROMS] Lazy131:
I don't understand exactly what you mean. When I start the camera app I have a photo preview. After taking a photo the preview still works and I can take another one. The photos also are shown correctly in the bottom left corner where you can go to the gallery. But when I go to the gallery the photo is just shown as white / grey box.

I then tried to realize your advise by opening the recent apps while in the gallery but nothing changed.

Could you explain a bit more in detail what you mean?
[Treble-Enabled Device Development A/AB ROMS] ngoralph:
1. take a picture

2. press the lower right box (which should bring you to gallery on stock rom but not on this one)

3. while still on the gray/black screen press the recent button to open the camera app back
[Treble-Enabled Device Development A/AB ROMS] drift08:
Can u share that apk file? I am on Mate 9. Also, the built in Hotspot doesn't work. My laptop connected to my hotspot but no internet connection. Tested with another android phone and it have the same issue. Any ideas? Thanks.
[Treble-Enabled Device Development A/AB ROMS] Lazy131:
Thanks for your reply. But I cannot check if this works anymore as I changed back to EMUI until an official release of Lineage OS is there.

---------- Post added at 01:27 PM ---------- Previous post was at 01:26 PM ----------

Just have a look on the very first post in this thread. I used this apk.
[Treble-Enabled Device Development A/AB ROMS] Yagal:
Is there a Google camera who works with Kirin+Treble ROMs?
[Treble-Enabled Device Development A/AB ROMS] ngoralph:
arnova build partially working but the stock camera on this thread is still way better
[Treble-Enabled Device Development A/AB ROMS] mudnightoil:
I'll be very curious to see whether this can be made to work fully on the P20 Pro, when it appears.

I know someone who's been testing one. Whilst they wouldn't discuss any specific details, they seem pretty certain that it will be in a class of its own until the new dual-camera Sonys and possibly Note 9 launch in the autumn.

He said it was the best smartphone image output he'd seen since the old big sensor Nokias and stillborn Panasonic. Though stressed it was still some way behind these.

If that's the case, I think this will be more than enough to sway me from the S9+ (even though notches make me want to feed the phones concerned into the sink's waste disposal shredder).
[Treble-Enabled Device Development A/AB ROMS] hensur:
Hi,

i just created my own apk from the Mate 10 Pro firmware and it works so far thanks to [MENTION=1915408]phhusson[/MENTION] 's scripts.

I guess there is no real fix for the photo preview freeze. If I click on the preview, the camera image turns black and the app freezes. But it works again right after pressing the back key. I just don't get a image preview, but that would probably require the Huawei Gallery App...

However, video recording is broken as well. Has anyone working video recording using this app on a custom rom?
[Treble-Enabled Device Development A/AB ROMS] Hannestilt:
Would you mind sharing your .apk file?
[Treble-Enabled Device Development A/AB ROMS] mudnightoil:
Given that Huawei now seem to be engaged with the custom ROM community, is there not a chance that an option could be added in the stock app to point preview at a different gallery app? It would in no way harm the app or anyone's experience, and the option could be tied to root or developer mode being active, if they were concerned about 'noobs' messing around.

Who's their rep here?

Though I assume if Huawei/Leica Camera can be made to work, porting the Huawei Gallery app would be quite easy?
[Treble-Enabled Device Development A/AB ROMS] Pretoriano80:
Don't get to much hope, mate. Huawei/Honor didn't made any official commitment regarding custom roms or open source. It's mostly an advertising move from Honor USA to promote the device, nothing more, at least not yet.

Now, to be back on topic, phh's treble rom was available even before Honor View 10 was out and Huawei Mate 10 users can confirm that. Thumb up to phh and his work.
[Treble-Enabled Device Development A/AB ROMS] holigan360:
Work on honor 7x With project treble?
[Treble-Enabled Device Development A/AB ROMS] hensur:
There you go:

https://mega.nz/#F!aSRGnDKK!lMGMMynKIZINM9bXL5iNXg

I put the libHwPostCamera_jni.so in there as well, I have it under /system/priv-app/HwCamera2/lib/arm64/libHwPostCamera_jni.so

Actually, this kind of works already. I noticed that after pressing the small image preview the camera screen turns black. Then I pressed the recents button and selected the camera app again. After doing this, the selected image appears in the lineage stock gallery. Of course, that's far from optimal, but there is some kind of support for non Huawei Gallery Apps...

I will try to install the Huawei Gallery as well and report back how that worked out
[Treble-Enabled Device Development A/AB ROMS] renatofontes:
How do you get the rom keys?
[Treble-Enabled Device Development A/AB ROMS] SuperIain:
I received an 'App not installed' message when I try. I'm using a root file explorer, and have the apk in the correct folder. This is on a Mate 10 Pro BLA-L09.
[Treble-Enabled Device Development A/AB ROMS] mudnightoil:
Seems my friend was right. The main 40MP sensor on the P20 Pro is the largest one in years. 1/1.7". Hope the new version of Leica / Huawei camera works properly in Treble.
[Treble-Enabled Device Development A/AB ROMS] SuperIain:
Update: I was able to install the app using Hannestilt's apk, however the images do not save. This is on the Lineage 15.1 build.

Edit: Read a bit further that others had this problem - please ignore this post.
[Treble-Enabled Device Development A/AB ROMS] MrDanMak:
So it looks like a lot of people have managed to get the camera installed and working. Would simply porting the EMUI gallery work or is there something else underlining that's needed for the images to be saved and viewable?
[Treble-Enabled Device Development A/AB ROMS] rav101:
Hi all,

I have just ordered the Huawei P20 Pro. I was wondering if people on prior Huawei devices were getting the same quality out of this camera port technique on none EMUI based ROMs than on EMUI?

I know we won't know about camera quality on AOSP for the P20 Pro for some time yet, but just wondering about how Huawei phones generally perform in this area?

On reading through this thread, I can see there are references to the camera quality with this port being good but not sure if it's doing the exact same quality?
[Treble-Enabled Device Development A/AB ROMS] MrDanMak:
It's pretty hard to tell currently. Images can't actually be 'viewed' once they've been taken. It certainly looks much better in the viewfinder however but without being able to see the finished product there's no way of telling.
[Treble-Enabled Device Development A/AB ROMS] rav101:
Ah okay,

I was under the impression the photos could be viewed in a different gallery app like the AOSP stock gallery app?

If the photos can be taken, can they be transferred to a pc for comparison and/or other forms of consumption?
[Treble-Enabled Device Development A/AB ROMS] mudnightoil:
Surely the problem is previewing images in the camera app, or opening the gallery from the camera app?

You must be able to view the images taken separately in any gallery app or file browser?

Presumably you can't yet edit the images in Huawei Camera yet ... or is that done in the EMUI Gallery app anyway?
[Treble-Enabled Device Development A/AB ROMS] Hannestilt:
where did you get the apk file from.?this is not a mate 10 apk, isnt it?
[Treble-Enabled Device Development A/AB ROMS] mark_at:
thank you very much! that was so easy!! downloaded your apk and installed.

but I can not solve the problem with the grey photos ... any idea someone?

I am using Honor View 10 with LineageOS

edit: with the apk from Hensur I could solve problem with grey photos. See following post of mine.
[Treble-Enabled Device Development A/AB ROMS] hensur:
Yes, the images get saved and I can view them in every other gallery app. Well, at least the ones from the rear camera(s). The front camera still has some problems I guess. One can see the camera preview, but when pressing the shutter button nothing gets saved. So apps like snapchat, which just captures the preview work fine, but the actual camera app doesn't save anything from the front camera. The rear camera on the other hand works fine.

Maybe the wording was a bit confusing, I meant the image preview in the lower left corner that was causing a black screen when trying to open the gallery. The camera preview and taking pictures works for the rear camera.

I got it from the Mate 10 Pro stock rom. I got the link from this site: http://pro-teammt.ru/firmware-database/?firmware_model

I followed this guide (https://xdaforums.com/mate-10/how-to/guide-mate-10-flash-oreo-update-package-t3716814) because every custom rom I flashed just bootlooped. I guess it was because I flashed TWRP before flashing a custom rom and a factory reset in the stock recovery is needed before flashing anything else.

So afterwards I extracted the system.img and got all files from there.
[Treble-Enabled Device Development A/AB ROMS] mark_at:
Hensur, wow! I installed your apk plus the other file in the directory you wrote ... and I have working camera! Photo is in gallery ... as you described ... with this small trouble. But it is so far best way to have a good working camera. I am already curious about your try with Huawei Gallery.
[Treble-Enabled Device Development A/AB ROMS] hensur:
Well, this is mostly based off of phhusson's work, I just used his script with a different apk :)

I just tried the same with the Gallery, however, I'm stuck on a problem. Here is what I got so far:

gallery.log

I guess this error message is what prevents the gallery from starting:

java.lang.ClassNotFoundException: Didn't find class "com.huawei.android.os.SystemPropertiesEx" on path: DexPathList[[zip file "/system/priv-app/Gallery2/Gallery2.apk"],nativeLibraryDirectories=[/system/priv-app/Gallery2/lib/arm64, /system/lib64, /vendor/lib64, /system/lib64, /vendor/lib64]]

I don't know if it's possible to somehow work around this... Maybe someone else has an idea what to do?
[Treble-Enabled Device Development A/AB ROMS] MrDanMak:
Ok, I have the camera installed and running. Only issue is obviously the gallery problem but hitting recents and tapping on the camera app again gives me the image. I've also noticed that certain modes aren't working such as portrait for example. It's failing to save images in this mode. Wide aperture works fine. There's also some slight lag when switching between camera modes.

Hopefully the more this is worked on then these issues can be fixed.
[Treble-Enabled Device Development A/AB ROMS] mudnightoil:
Ordered the P20 Pro. Hope it works well on the new camera app.
[Treble-Enabled Device Development A/AB ROMS] drift08:
I tried the file at post#1 plus additional file at post#4. Camera app shows but crashes. See screenshot. Any idea?
[Treble-Enabled Device Development A/AB ROMS] hensur:
Hi,

it's possible that some library is missing. Can you take a logcat while opening the app?

Or try this apk, I works for me on Mate 10 Pro, but I'm not sure about the Mate 9: