ANXCamera9
Goto XEonAX/ANXCamera. This repository is kept for historic reasons.
Install / Use
/learn @XEonAX/ANXCamera9README
ANXCamera10
MiuiCamera Port for Beryllium
Self sufficient repository to decompile to smali, recompile, sign, decompile to java, push to device app port.
miui_POCOF1Global_9.4.26_146a17240f_9.0 was used as src.
Recommended to open this Repository in VSCode
This repository requires git-lfs
Get it from https://git-lfs.github.com/
Follow Step 1 of Getting Started. i.e. run once git lfs install
Then clone this repository. If you have already cloned, run clone once again.
Also requires Java 1.7 or 1.8, and 7-zip.
Instructions for Development:
- Clone this repository
- Run redo.bat
- Start porting
Instructions for Testing:
- Download the
zipfrom https://camera.aeonax.com/ - Install the Magisk
zipwith Magisk, or Unityzipwith recovery - Reboot Once, if it doesn't work properly, reboot twice.
- Start Testing
Special Thanks to Abhishek Aggarwal (https://github.com/TheScarastic) for bringing this up to Beta version Mustang_ssc (https://github.com/Mustang-ssc) for his help in adding support for other devices Amogha Maiya (https://github.com/amog787) for sponsoring, and all-round help Sandeep (https://github.com/CodeElixir) for help with the libs Psygarden (https://forum.xda-developers.com/member.php?u=7645131) for his general help.
Steps to Port MiuiCamera from scratch:
- Unpack System of Miui
- Setup Original files for Decompiling
- Copy following to ANXCamera10\orig\MiuiFrameworks. Files to be taken from Latest ROM
- framework\framework-ext-res\framework-ext-res.apk
- framework\framework-res.apk
- app\miui\miui.apk
- app\miuisystem\miuisystem.apk
- Copy following to ANXCamera10\orig
- priv-app\MiuiCamera\MiuiCamera.apk
- Copy following to ANXCamera10\orig\MiuiFrameworks. Files to be taken from Latest ROM
- Prepare APKTool for decompiling
- Install above framework files by running following commands
java -jar ..\ANXMiuiPortTools\apktool.jar if -p ..\ANXMiuiPortTools\MiuiFrameworks .\orig\MiuiFrameworks\framework-res.apkjava -jar ..\ANXMiuiPortTools\apktool.jar if -p ..\ANXMiuiPortTools\MiuiFrameworks .\orig\MiuiFrameworks\miui.apkjava -jar ..\ANXMiuiPortTools\apktool.jar if -p ..\ANXMiuiPortTools\MiuiFrameworks .\orig\MiuiFrameworks\framework-ext-res.apkjava -jar ..\ANXMiuiPortTools\apktool.jar if -p ..\ANXMiuiPortTools\MiuiFrameworks .\orig\MiuiFrameworks\miuisystem.apk
- Install above framework files by running following commands
- Decompile MiuiCamera by running
java -jar ..\ANXMiuiPortTools\apktool.jar d -p ..\ANXMiuiPortTools\MiuiFrameworks -f -b -o .\src\ANXCamera .\orig\MiuiCamera.apk- Parameters
- d, decode
- -p, --frame-path <DIR>
- -f, --force
- -b, --no-debug-info
- -o, --output <DIR>
- Open
src\ANXCamera\AndroidManifest.xmland format the document - First Compile Attempt
- Run
recompile.batjust to check whether we are able to recompile without any modification - Run
sign.batto sign and zipalign - Run
jadx.batto create java code from compiled apk. This fails, don't worry, it does whatever it can
- Run
- Next we will Deodex rom and decompile the required libs
- Run in WSL or Linux
$ /<path to vdexExtractor>/tools/deodex/run.sh -i /<path to system>/framework -o /<path to deodex destination>/framework - Above will deodex the system framework
- Now we decompile the required libs
- Copy latest baksmali.*.jar to
<path to deodex destination> - To identify what libs you need to decompile. Open
src\ANXCamera\AndroidManifest.xml- Find the
uses-libraryXML Nodes. We need to decompile these - We will skip
miui-stat.jaras we will disable miui-stats from sending data to miui.
- Find the
- Open a cmd inside
<path to deodex destination>folder. And run the following:java -jar baksmali-2.2.7.jar d -o android-support-v7-recyclerview .\framework\vdexExtractor_deodexed\android-support-v7-recyclerview\android-support-v7-recyclerview_classes.dex.dexjava -jar baksmali-2.2.7.jar d -o android-support-v13 .\framework\vdexExtractor_deodexed\android-support-v13\android-support-v13_classes.dex.dexjava -jar baksmali-2.2.7.jar d -o boot-framework .\framework\vdexExtractor_deodexed\boot-framework\boot-framework_classes.dexjava -jar baksmali-2.2.7.jar d -o boot-framework2 .\framework\vdexExtractor_deodexed\boot-framework\boot-framework_classes2.dexjava -jar baksmali-2.2.7.jar d -o boot-framework3 .\framework\vdexExtractor_deodexed\boot-framework\boot-framework_classes3.dexjava -jar baksmali-2.2.7.jar d -o boot-miui .\framework\vdexExtractor_deodexed\boot-miui\boot-miui_classes.dexjava -jar baksmali-2.2.7.jar d -o boot-miuisystem .\framework\vdexExtractor_deodexed\boot-miuisystem\boot-miuisystem_classes.dexjava -jar baksmali-2.2.7.jar d -o gson .\framework\vdexExtractor_deodexed\gson\gson_classes.dex.dexjava -jar baksmali-2.2.7.jar d -o volley .\framework\vdexExtractor_deodexed\volley\volley_classes.dex.dexjava -jar baksmali-2.2.7.jar d -o zxing .\framework\vdexExtractor_deodexed\zxing\zxing_classes.dex.dex
- Copy latest baksmali.*.jar to
- Run in WSL or Linux
- Now we will add few of the above decompiles libs to our code
- Create a folder
src\ANXCamera\smali_classes2 - Copy the contents of
<path to deodex destination>\android-support-v7-recyclerview<path to deodex destination>\android-support-v13<path to deodex destination>\gson<path to deodex destination>\volley<path to deodex destination>\zxing
- to
src\ANXCamera\smali_classes2. It should finally contain two foldersandroidandcom
- Create a folder
- Set required = false in AndroidManifest of these libs as their code is now included
- Add missing smali files from decompiled miui rom
- Add native libs
- Edit Smali
- ...
