Resurrection Remix is always one of my favorite Android variants. It did have official builds for Xperia Z3 (D6603/D6653) but not availabe any more. Since its device are free to access on the web, I decided to build one for my Xperia Z3.
Source Code, Environment and Other Preperations
- Install Dependencies. On Ubuntu 17.04, use
sudo apt install bc bison build-essential curl flex g++-multilib gcc-multilib git gnupg gperf imagemagick lib32ncurses5-dev lib32readline-dev lib32z1-dev libesd0-dev liblz4-tool libncurses5-dev libsdl1.2-dev libssl-dev libwxgtk3.0-dev libxml2 libxml2-utils lzop pngcrush rsync schedtool squashfs-tools xsltproc zip zlib1g-dev
- Download the source code following RemixResurrection's guide.
- Use
local_manifests.xml
to download additionaldevice
and blobs. - Use
extract_files.sh
indevice/sony/z3/
to extract properties. This script can either extract them from a up and running Xperia Z3 usingadb pull
, or extract from a expended ROM. vendor/sony/msm8974-common/proprietary/vendor/lib/libWVStreamControlAPI_L3.so
andvendor/sony/msm8974-common/proprietary/vendor/lib/libwvdrm_L3.so
is still missing. Use the blobs from other Snapdragon 801 target to build. Here I'm using vendors from OnePlus.- When device and blobs are ready, run
source build/envsetup.sh
thenbreakfast z3
. Note thatbuild/envsetup.sh
may not work properly with shells other thanbash
. - Setup
CCACHE
using
echo "export USE_CCACHE=1" >> ~/.bashrc
prebuilts/misc/linux-x86/ccache/ccache -M 50G
brunch z3
.
Once the compile is completed, you can find the package in out/product/sony/z3
or $OUT
.
Solving Errors
-
ERROR android_frameworks_base/libs/hwui/tests/microbench/FrameBuilderBench.cpp: No member named 'range' in 'benchmark::State'
The error is introduced by this commit. It's originally a fix to deprecatedstate.range_x()
calls, but this function is still provided as a standard API and being widely used (even in official demos) in Nougat MR2.3 release.FrameBuilderBench.cpp
in AOSP Nougat MR2.3 release still userange_x()
but notrange(0)
. The newer version ofgoogle/benchmark
library also utilize a new building system by providing aAndroid.bp
file instead ofAndroid.mk
file as a make script. It would be a problem of messing up different versions of repos when RemixResurrection team merge to Android Oreo.
Simply replace all thestate.range(0)
withstate.range_x()
solves the problem. -
ERROR /frameworks/base/media/tests/CameraBrowser/src/com/android/camerabrowser/CameraBrowserApplication.java:42: Locale cannot be resolved
Seems to be a problem of callingResources.getSystem()
without importingandroid.res.content.Resources
package, as well as callingLocale.CHINESE
without importingjava.util.Locale
. Adding theimport
sentences will get rid of it. -
frameworks/base/packages/SystemUI/res/layout/battery_bar_rot0.xml:28: error: No resource identifier found for attribute 'viewLocation' in package 'com.android.systemui'
andframeworks/base/packages/SystemUI/res/layout/battery_bar_rot0.xml:35: error: No resource identifier found for attribute 'viewLocation' in package 'com.android.systemui'
. It may related to a bug in Android with custom widget namespace detection (?). In layout files, change the namespace declarationxmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui"
toxmlns:systemui="http://schemas.android.com/apk/res-auto"
seems to work. There're some more files have the same problem and can be similarily modified to get them fixed and built.
See also this commit in AOSP source.
Note: This error is gone while compiling usingbrunch z3
instead ofmake
-
frameworks/base/packages/SystemUI/res/layout/card.xml:22: No resource identifier found for attribute 'cardBackgroundColor' in package 'com.android.systemui.tests'
The codes seem to be alright. No idea about it till now. Deleting it solves the problem.
The above two bugs happened with records here.
Note: This error is gone while compiling usingbrunch z3
instead ofmake