Ok, new update: Modified and built Kodi 20.0
b1rc1 for 32-bit ARM (armeabi-v7a) Sony XR-55A90J on Ubuntu 22.04 LTS in a WSL on Windows. This time I also added a `ClearToHome()` function so that home button can be mapped to home screen and clear window stack.
I. Ensure there is enough memory for the WSL and gradle inside the WSL
Stop all WSL instances and the service:
Code:
C:\Users\XXX>wsl --shutdown
Create %USERPROFILE%/.wslconfig with the following content:
Code:
[wsl2]
memory=8GB # Set the memory available to WSL
processors=2 # Set the number of virtualized processors for WSL
II. Build kodi follow instructions at https://github.com/xbmc/xbmc/blob/master...Android.md with changes
I had problems with running `make`with multiple processors so I ran all `make` commands without a `-j` flag.
4. Get the source code
Change the
to
to get the modified version of the source.
I am still trying out which AndroidManifest.xml options gives the snappiest feedback, feel free to play around with them yourself as the manifest is only added in the last `make apk` step (so repackaging with different options is quick). Diff of source changes.
7. Build Kodi
There seems to be an error somewhere in the makefiles resulting the latest version of `flatbuffers/flatc` being built rather than the bundled version so after having run `make -C tools/depends/target/cmakebuildsys` and `make -C tools/depends/target/cmakebuildsys BUILD_DIR=$HOME/kodi-build` correct this manually prior to building Kodi:
Code:
~/kodi$ tar xzf ~/android-tools/xbmc-tarballs/flatbuffers-2.0.0.tar.gz -C ~
~/kodi$ cd ~/flatbuffers-2.0.0
~/flatbuffers-2.0.0$ make
~/flatbuffers-2.0.0$ cp flatc ~/android-tools/xbmc-depends/x86_64-linux-gnu-native/bin/flatc
edited: worked correctly when building rc1
8. Package
Prior to `make apk`increase the gradle memory and ensure Android X support by editing `~/kodi/tools/android/packaging/gradle.properties` to look like:
Code:
android.useAndroidX=true
org.gradle.jvmargs=-XX:MaxHeapSize=1024m -Xmx2048m
edit: Probably not necessary when building rc1 and later
9. Install
To install as launcher connect to TV by ADB and run
Code:
~/kodi$ adb connect xxx.xxx.xxx.xxx:5555
~/kodi$ adb install kodiapp-armeabi-v7a-debug.apk
Then launch Kodi as a normal app from the factory launcher and go through the initial setup (storage permission etc). Once Kodi is up and running disable the factory launcher (the commands are `uninstall` but it's only disabled in reality) by adb:
Code:
~/kodi$ adb shell pm uninstall -k --user 0 com.google.android.apps.tv.launcherx
~/kodi$ adb shell pm uninstall -k --user 0 com.google.android.tungsten.setupwraith
Related notes
One suggestion is to use the open source Key Mapper (
https://f-droid.org/packages/io.github.s...keymapper/ or
https://github.com/keymapperorg/KeyMapper) to remap keys as needed to easily reach Android Settings, Sonys QuickLaunch app, scroll apps not made for non-touch screens, control sound system etc. Personally I have a IR programmable air mouse remote with keyboard from Amazon.