-
Notifications
You must be signed in to change notification settings - Fork 1
Building clank for Android
Note: This building method of clank for MIPS requires android source tree to be present.
In the Android root directory do the following command sequence to checkout code:
cd external
git clone git://github.com/paul99/clank.git chrome
cd chrome
git clone git://github.com/paul99/third_party.git third_party
This building method consists of building native 'libchromeview' library for MIPS and replacing that library in final apk by repacking it.
To build the library it is essential that android build environment is set and android libraries for MIPS are present.
To set up Android environment variables and eventually build the android use following commands in android root directory:
. build/envsetup.sh && lunch full_mips-eng && m -j8
If you are building on aosp master, you need to setup a path used by out/host/{host-arch}/bin/bison (which is now in the search path before your system bison):
export BISON_PKGDATADIR=$ANDROID_BUILD_TOP/external/bison/data
In external/chrome directory build the 'libchromeview' library with the following commands:
export TARGET_ARCH=mips
cd external/chrome && . build/android/envsetup.sh && clank_gyp && make -j8 libchromeview.so
In external/chrome/ directory download the Chrome apk for Download section.
apktool d Chrome.apk
rm -rf Chrome/lib/armeabi-v7a
mkdir Chrome/lib/mips
cp ../out/Release/target.lib/libchromeview.so Chrome/lib/mips
mipsel-linux-android-strip Chrome/lib/mips/libchromeview.so
./change_chromium_package.py -u Chrome -p com.mips.chromium -a "Mips Chromium"
apktool b Chrome Chromium_unaligned.apk
First step, generate key-store if it does not exist with:
keytool -genkey -alias my_keystore_alias -keypass mypass -keystore /path_to_keystore/mykeystore.keystore -storepass mypass -validity 180
Sign the apk with generated keystore from previus step.
jarsigner -verbose -keystore /path_to_keystore/mykeystore.keystore Chromium_unaligned.apk my_keystore_alias
When asked for password use the phrase you put after -keypass in key
generation step, which is "mypass" in this example.
zipalign -f -v 4 Chromium_unaligned.apk Chromium.apk
adb install -r Chromium.apk