How to get camera and gallery working for android 5.1


Question

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?



screenshot


Answer

Extracting them from a firmware is dependent on what is the file extension for the firmware. We have a variety of firmwares:




  1. Fastboot Imaged Firmwares

  2. Full Over the Air zip Updates

  3. We have Odin tar Archives

  4. LG kdz Firmwares

  5. Spreadtrum soc Firmwares

  6. Recovery Flash zip Firmwares

  7. 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


Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes