Bueno chicos necesito ayuda a ver si entre todos terminamos la rom miui compilada para nuestro
thl w8 ya llevo hecho hasta la stockrom.zip ahora faltaria hacer esto pero ando un poco perdido:
3.2 makefile
We need a makefile to let make work. Here is a makefile to begin with:
local-zip-file := stockrom.zip
local-out-zip-file :=
local-miui-modifed-apps :=
local-modified-apps :=
local-miui-removed-apps :=
local-phone-apps :=
local-pre-zip := local-zip-misc
include $(PORT_BUILD)/porting.mk
local-zip-misc:
We will explain some definitions in this file, for thorough understanding, you definitely
should look at the whole build system.
local-zip-file: the
recovery-ROM generated in previous section, must be specified
for each device.
local-out-zip-file: the output recovery-ROM filename when you run "make zipfile"
local-miui-modified-apps: all the miui apps are listed in the file
patchrom/build/miuiapps.mk. This variable defines those miui apps which we
modified.
local-modified-apps: This variable defines those apps from local-zip-file which we
modified.
local-miui-removed-apps: Normally not all the miui apps is suitable for our
device(e.g. some device will not want Phone.apk). This variable defines those miui
apps which we don't want.
local-phone-apps: This variable is used to remove some apps from local-zip-file.
As you can see, we use blacklist for miui apps and whitelist for stock ROM apps.
This variable defines those stock ROM apps which we want to keep.
local-zip-misc: This target permits you to do some customization before we
generate the final recovery-ROM.
3.3 workspace
The first make command we will run is "make workspace". This will prepare the
workspace
for
you.
The
operation
is
simple,
it
will
extract
framework/android.policy/services.jar and framework-res.apk from stockrom.zip and run
apktool to disassemble them.
3.4 firstpatch
The second make command we will run is "make firstpatch". Before diving into
this command, we need to talk about smali.
We use apktool to disassemble the jar/apk which generates smali code. We will
use framework.jar.out(which is the disassembled smali code from framework.jar) as an
example to discuss this:
There are 3 smali code directories involved:
(1) old framework.jar.out
(2) new framework.jar.out
(3) target framework.jar.out
At first time, the old framework.jar.out will be the disassembled framework.jar which is
compiled from google released source code, the new framework.jar.out will be
the disassembled framework.jar which is compiled from miui's source code. The target
framework.jar.out will be the disassembled framework.jar from target device which is
already prepared in "make workspace".
In order to facilitate this process, we try the best to make minimum change to the google
released source code. You can see these change by compare miui/src and android/src.
But most often there will be some conflicts when applying the patch.
After running this command, there will be a temp directory. There will be 5 child directories:
(1) old_smali: the smali code from old framework.jar.out with .line removed
(2) new_smali: the smali code from new framework.jar.out with .line removed
(3) dst_smali_orig: the smali code from target framework.jar.out with .line removed
(4) dst_smali_patched: the smali code after applying the patch into target
framework.jar.out with .line removed
(5) reject: the rejected patch. We should use this directory to resolve the conflicts.
You may raise a question: what if miui makes further change to the source code, how canwe track these changes.
Firstly, please record the newest commit number of android/framework.jar.out when you
run "make firstpatch". Assume the commit number is abcdefg.
Then at some time, the android/framework.jar.out will be updated and assume the newest
commit number is hijklmn. run "tools/git.patch abcdefg..hijklmn > patch.file".
Finally at your device directory, run "tools/git.apply < ../android/patch.file". Now you can
resolve any conflict.
3.5 fullota
After resolved the conflicts, you can run "make fullota" to build the final recovery-ROM.
This command will generate fullota.zip under out directory. Flash this file in recovery mode.
And now your device may boot successfully and see the miui lockscreen. But most often
things are not going so well, don't worry. "
adb logcat" will be the great tool to help us.
From now on, there will be a problem-solving loop. Solve the problem or exception we
encountered.
3.6 suggestion
First of all, you should read the source code to understand the whole build system.
Secondly, you can refer to the devices we already finished, especially for the devices from
same manufacturer.
Finally, please post your issue and we will try to answer it. It will be highly appreciate if you
open source your device, you can use our server to release the ROM to users and enjoy
the live MIUI through OTA update.
eso me falta chicos a ver si alguien puede arrojar un poco de luz please.... asi la acabo y la subo para todos...