My phone recently couldn't use Camera neither the front or rear camera. It would show black screen and freeze I cleared cache and did a hard reset. It didn't solve it. So I thought of uninstall both apps(with root) and try to reinstall them. I did but nothing changed. So I decided to uninstall and replace with the gallery and camera app of my marshmallow device. Both were installed but forced stopped. So I moved them to system/app. It still didn't work. Now I don't even have a backup of the original apps. Is there a work around for this? I don't want to flash. And is there a way I can extract those files from the firmware I downloaded?
-
It's really difficult to help you without know what device have you got. But by the SoC, I think it's a Mediatek-based smartphone– zSyntexDec 10, 2017 at 13:22
-
Have you tried alternative camera and gallery apps, e.g. from Playstore or F-Droid? See if e.g. Open Camera works (available in both places).– Izzy ♦Dec 10, 2017 at 13:48
1 Answer
Extracting them from a firmware is dependent on what is the file extension for the firmware. We have a variety of firmwares:
- Fastboot Imaged Firmwares
- Full Over the Air zip Updates
- We have Odin tar Archives
- LG kdz Firmwares
- Spreadtrum soc Firmwares
- Recovery Flash zip Firmwares
- Raw binary Firmwares
So if you may want to extract from Fastboot .img firmware, you should know that img files are specially extracted and edited by repacking. Especially for true boot and recovery images. But hope for you is: /system is not a true imaged partition but its a file system. Though named as System.img in ROMs, it is natively a .tar archive that you can extract using WinRAR on computer and locate the app and extract it. The structure is arranged just like the /system partition of Android.
Recovery Flash zips and Over The Air zip updates, as the name suggests are zip archives which can also be extracted with a method similar like the above
KDZ and SOC Firmwares are also archives. But since you don't want to take a lot of time researching what types of archives they are, just open WinRAR on any device you feel convenient and use it as your file explorer. Navigate to the ROM you downloaded and click on it. This will actually do auto-detect the compression algorithm used and it will open it. It will show what type the archive is in the file name of archive. Find your files and copy them.
ODIN tar is a tarball archive. Just extract it with RAR or any other app you find convenient.
You're only locked to flash a whole ROM if your phone has a RAW binary file which can only handled by certain preloading binaries which understand them natively.
Lets come to laying the file back to rest on your file system. Android Nougat always is simple to lay the apps to system. The containing folder obviously had two or one folders in it. One for .dex classes named OAT for easier preparation by the Dalvik Virtual Machine which takes care of all application preparation. And one for libraries used by application named LIB.
They go here: for example the Camera app
/system/app/Camera/lib/arm/lib_camera.so
That's the library
/system/app/Camera/oat/arm/Camera.dex
That's for the Classes
/system/app/Camera/Camera.apk
That's for the application
After copying them. Fix the permissions to
chmod 0644
For all files
chmod 0755
For all folders
I hope this is all you need. As per your question But if they don't, just flash the whole phone and be ready to go again.
Be sure to review, vote or mark this answer if it helped you. Waiting to hear from you buddy