Browse Source

Update AOSP buildscript; Add webview fix

master
Pekka Helenius 2 years ago
parent
commit
de735821dc
2 changed files with 91 additions and 35 deletions
  1. +46
    -35
      androidOS_files/builscript.sh
  2. +45
    -0
      androidOS_files/patch_fix-webview.patch

+ 46
- 35
androidOS_files/builscript.sh View File

@ -8,49 +8,54 @@
# Required: aosp-devel packages
# https://aur.archlinux.org/packages/aosp-devel/
ROOTDIR="${PWD}"
WORKDIR="${PWD}/aosp"
rm -rf ${WORKDIR}/out/*
if [ ! -d "${WORKDIR}" ]]; then
mkdir -p "${WORKDIR}"
fi
rm -rf "${WORKDIR}"/out/*
ln -s /usr/bin/python2 ./python
export PATH=$PWD:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
cd ${WORKDIR}
# This takes A LOT of time, since ~280GiB must be downloaded.
# Full Android source code with all commit histories etc. This is not a shallow copy.
# TODO this manifest file contains old Android version tag. Should be replaced with android-9.0.0_r57 or newer
# For available versions, see i.e.: https://android.googlesource.com/platform/frameworks/support
repo init -u https://github.com/anbox/platform_manifests.git -b anbox
repo sync -j6
cd "${WORKDIR}"
sudo pacman -S repo
#sudo pacman -S repo
# Check all deps of AUR pkg aosp-devel are installed (/home/fincer/ssd/arch_linux_programs/aosp-devel)
# Get & sync AOSP source code, shallow copy ~ 27.2 GB
#
repo init -u https://github.com/anbox/platform_manifests.git -b anbox --depth 1
repo sync -j6 -c
cd /media/a2ee7134-4f0e-4aa7-a12e-ee2b949fbb0b/
# Check manually all deps of AUR pkg aosp-devel are installed (/home/fincer/ssd/arch_linux_programs/aosp-devel)
# Not merged, as of 6th June 2020
# Audio timing fix:
# https://github.com/anbox/anbox/pull/1034
cp -f ./patch_audio01_timing.patch aosp/vendor/patch_audio01_timing.patch
cp -f ./patch_audio02_pass-messenger.patch aosp/vendor/patch_audio02_pass-messenger.patch
# Web view fix:
# https://github.com/anbox/anbox/pull/1875
cp -f ./patch_initcgroups.patch aosp/patch_initcgroups.patch
cp -f "${ROOTDIR}"/patch_audio01_timing.patch "${WORKDIR}"/vendor/
cp -f "${ROOTDIR}"/patch_audio02_pass-messenger.patch "${WORKDIR}"/vendor/
cp -f "${ROOTDIR}"/patch_fix-webview.patch "${WORKDIR}"/vendor/
cp -f "${ROOTDIR}"/patch_initcgroups.patch "${WORKDIR}"/
# Disable foreground/background activity checks and functionality of built-in Gallery apps for Desktop use
# Comment onPause and onResume functions and related parts
# This helps when using multiple apps simultaneosly and playing a video/music track. Originally,
# playback pauses which is not a wanted feature in desktop Android. In this patch, we disable all relevant code
# parts which cause this pause.
cp -f ./patch_gallery2_no-activity-checks.patch aosp/patch_gallery2_no-activity-checks.patch
cp -f "${ROOTDIR}"/patch_gallery2_no-activity-checks.patch "${WORKDIR}"/
cd ${WORKDIR}/vendor/anbox
cd "${WORKDIR}"/vendor/anbox
patch -Np1 -i ../patch_audio01_timing.patch
patch -Np1 -i ../patch_audio02_pass-messenger.patch
cd ${WORKDIR}
patch -Np1 -i ../patch_fix-webview.patch
cd "${WORKDIR}"
# We don't have several cgroups in native Linux. Avoid unnecessary kernel errors.
# Disabled 'schedtune' cgroup as it targets Android ARM devices. Reason for it is to
@ -63,33 +68,32 @@ cd ${WORKDIR}
patch -Np1 -i ./patch_initcgroups.patch
# Already merged, as of 6th June 2020
#
# Server side decoration fix:
# https://github.com/anbox/anbox/pull/1415
#ln -s patch_serversidedecoration.patch aosp/vendor/patch_serversidedecoration.patch
patch -Np1 -i ./patch_gallery2_no-activity-checks.patch
# archlinux-java set java-8-openjdk
archlinux-java set java-8-openjdk
cd ${WORKDIR}/
. build/envsetup.sh
lunch anbox_x86_64-userdebug
cd "${WORKDIR}"
# Disable JACK
sed -i -r 's/(ANDROID_COMPILE_WITH_JACK := )true/\1false/' ${WORKDIR}/build/core/combo/javac.mk
source build/envsetup.sh
lunch anbox_x86_64-userdebug
#export ANDROID_JACK_VM_ARGS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx2G"
export ANDROID_JACK_VM_ARGS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx2G"
# RUN THIS IN SEPARATE SHELL!
# Jack server must be run during compilation process
#while true; do
# sleep 2
# if [ -f aosp/out/host/linux-x86/bin/jack-admin ]; then
# aosp/out/host/linux-x86/bin/jack-admin start-server
# break
# fi
#done
while true; do
sleep 2
if [ -f aosp/out/host/linux-x86/bin/jack-admin ]; then
aosp/out/host/linux-x86/bin/jack-admin start-server
break
fi
done
LC_ALL=C make -j$(nproc --ignore 1)
@ -100,9 +104,16 @@ if [[ $? -eq 0 ]]; then
rm -rf $HOME/.jack-server
fi
cd $WORKDIR/vendor/anbox/
# Once compiled, do the following:
cd "${WORKDIR}"/vendor/anbox/
scripts/create-package.sh ${PWD}/../../out/target/product/x86_64/ramdisk.img ${PWD}/../../out/target/product/x86_64/system.img
# Image will locate at aosp/vendor/anbox/android.img
# This image will locate at aosp/vendor/anbox/android.img


+ 45
- 0
androidOS_files/patch_fix-webview.patch View File

@ -0,0 +1,45 @@
Original commit: https://github.com/anbox/anbox/pull/1875/commits/a38b10b6bd519faa781d43d45f9740e5e82c4ca6
From a38b10b6bd519faa781d43d45f9740e5e82c4ca6 Mon Sep 17 00:00:00 2001
From: kuailexs <952415538@qq.com>
Date: Wed, 28 Jul 2021 20:54:32 +0800
Subject: [PATCH] emugl:fix webview,GL_SHADING_LANGUAGE_VERSION and
EGL_RENDERABLE_TYPE
---
src/anbox/graphics/emugl/RenderControl.cpp | 3 +++
src/anbox/graphics/emugl/RendererConfig.cpp | 7 +++++++
2 files changed, 10 insertions(+)
diff --git a/src/anbox/graphics/emugl/RenderControl.cpp b/src/anbox/graphics/emugl/RenderControl.cpp
index 9f2558553..99f30015d 100644
--- a/src/anbox/graphics/emugl/RenderControl.cpp
+++ b/src/anbox/graphics/emugl/RenderControl.cpp
@@ -144,6 +144,9 @@ static EGLint rcGetGLString(EGLenum name, void* buffer, EGLint bufferSize) {
};
result = filter_extensions(result, whitelisted_extensions);
+ }else if (name == GL_SHADING_LANGUAGE_VERSION) {
+ // GL_VERSION:"OpenGL ES 2.0" matched GL_SHADING_LANGUAGE_VERSION:"OpenGL ES GLSL ES 1.00"
+ result = "OpenGL ES GLSL ES 1.00";
}
int nextBufferSize = result.size() + 1;
diff --git a/src/anbox/graphics/emugl/RendererConfig.cpp b/src/anbox/graphics/emugl/RendererConfig.cpp
index 02b6b7882..f7027dc9d 100644
--- a/src/anbox/graphics/emugl/RendererConfig.cpp
+++ b/src/anbox/graphics/emugl/RendererConfig.cpp
@@ -142,6 +142,13 @@ int RendererConfigList::chooseConfig(const EGLint* attribs, EGLint* configs,
mustReplaceSurfaceType = true;
}
}
+ // EGL_RENDERABLE_TYPE , fix webview
+ if (attribs[numAttribs] == EGL_RENDERABLE_TYPE) {
+ if (attribs[numAttribs + 1] > EGL_OPENGL_ES2_BIT) {
+ ERROR("EGL_RENDERABLE_TYPE can not > EGL_OPENGL_ES2_BIT");
+ return 0;
+ }
+ }
numAttribs += 2;
}

Loading…
Cancel
Save