No Comments

How to check the Signing Certificate on an Android app / apk (II)

{}
June 17th, 2022

This is an 2022 update of an older post.

If you own a Android Phone, and you want to use Signal instead of Whatsapp or Telegram for privacy matters, and, for the same privacy matters, you prefer to use open source Android AOSP instead of the commercial Android variant that is enriched spoiled with proprietary Google services,  or you don’t have a Google Account on your phone, or you don’t use Google Play but the free F-Droid software-store, there is a solution. You can download the Signal APK from their website.

To verify that the signing certificate on the APK matches the SHA256 fingerprint on the Signal website you can use the following one-liner.

As Matthew (kudos) pointed out, the certification file has a new name in recent Signal APK’s.

So the one-liner changed a bit:

f="Signal-Android-website-prod-universal-release-5.40.4.apk" ; unzip -p "$f" $(unzip -l "$f" | grep '.RSA' | awk '{print $4}') | keytool -printcert

Hopefully this version will be future proof as the one-liner now uses his suggestion to search/grep for a .RSA file.

Output

Owner: CN=Whisper Systems, OU=Research and Development, O=Whisper Systems, L=Pittsburgh, ST=PA, C=US
Issuer: CN=Whisper Systems, OU=Research and Development, O=Whisper Systems, L=Pittsburgh, ST=PA, C=US
Serial number: 4bfbebba
Valid from: Tue May 25 17:24:42 CEST 2010 until: Tue May 16 17:24:42 CEST 2045
Certificate fingerprints:
SHA1: 45:98:9D:C9:AD:87:28:C2:AA:9A:82:FA:55:50:3E:34:A8:87:93:74
SHA256: 29:F3:4E:5F:27:F2:11:B4:24:BC:5B:F9:D6:71:62:C0:EA:FB:A2:DA:35:AF:35:C1:64:16:FC:44:62:76:BA:26
Signature algorithm name: SHA1withRSA
Subject Public Key Algorithm: 1024-bit RSA key
Version: 3

As you can see, still the same fingerprint.

No Comments

Review AOC 16T2 15.6 inch touchscreen monitor

May 16th, 2022

The AOC 16T2 is a portable touchscreen monitor that I bought as a secondary laptop monitor, and as a touchscreen monitor for Raspberry Pi development. It has shown to be a great addition to a Raspberry Pi 400, and for experimenting with a Zero.

The AOC 16T2 offers an USB-C input and HDMI input, it has a built-in 8,000mAh  battery, so it can charge your devices as well. As a bonus it also worked great with my Samsung S20 Android phone, turning the monitor into something like a 15.6inch Android tablet. Samsung Dex software was working above expectation, although Dex doesn’t offer a portrait mode, which is a pity.

Both my laptop and Samsung phone can drive the monitor with just an USB C cable, which is a nice, clean and simple setup. The phone at the same time then is also charged by the battery pack in the monitor.

For connecting the monitor to a Raspberry Pi an HDMI cable is needed, and to get the touchscreen working you need to connect another USB A to C cable.

There is a tiny switch on the right, which is not mentioned in the manual, but a black sticker on the box states:

Please turn on the charging switch for the first time

At first I did miss that notice and then the monitor doesn’t output anything. The switch should be down for charging.

I guess the switch is there to limit charging the battery all the time. It should help your battery to live longer. At least that is what I think the switch is for. It is not mentioned in the manual.

Sound is OK, there is magnetic cover that can be used as a stand. It doesn’t really has a portrait mode, ti doesn’t stick but with some care it can be used vertically.

You can also use it with a VESA mounting bracket.

A downside is the OSD for changing the settings, that’s a bit clumsy, adjusting the volume takes some clicks and waiting, it cycles through all options sow for lowering the volume you have to max it first. That is awful.

Having a portable touchscreen is a nice addition. I also use it connect to my Samsung Phone to read books on a 15.6 inch screen instead of a 6.5 inch.

5 Comments

Kodi on Bullseye, playing 4K on the RPI4

{}
March 18th, 2022

Getting the most out of your (cheap) hardware is always a challenge. Selling hardware is easier then supporting hardware.

The Raspberry Pi 4 has strong multimedia capabilities, it can playing 4K media 60fps, but getting it done isn’t a piece of cake. Even playing 1080HD content on YouTube can be a problem, but that’s probably because YouTube is more about tracking and selling adds than playing media.

A bold statement? Think about it this way. Any 1080p movie will play fine outside a browser in Kodi, any movie will play fine without DRM (Digital Rights Management). It chokes on the DRM en-/decryption. By definition: DRM is tracking.

Historically LibreElec is the best distribution for a Raspberry Pi as a multimedia device. LibreElec’s goal: just enough OS to support Kodi, and it is highly optimized for that.

Yes it’s powerful. You can install add-ons like MPD for music, or RetroPie-alike  for games. Also docker containers are available for HomeAssistant, MQTT and Nginx. So a RPI with LibreElec can be pretty powerful.

Still LibreElec is limited, and the RPI4 is capable of doing more.

Kodi on Raspberry used to work pretty well, until big changes in the 5.10 kernel came. It more or less stopped working on Buster. Compiling it yourself was quite a hassle, that actually failed more than it succeeded. I wrote about that before and it failed in most cases for most users including myself, I must admit.

But now luckily RPI-engineers stepped up:  Kodi in Rapsberry Pi OS is more or less supported again.

At least it’s easy again to install Kodi in Bullseye. But you still need a bit more tweaks to get it running smoothly.

To install Kodi in Bullseye

No OS can beat this 🙂 :

sudo apt install kodi

Install addons

Two important add-ons that can’t be installed from within Kodi like in LibreElec, but you have to resort to apt again:

TVHeadend-client (DVB-T tv)

sudo apt install kodi-pvr-hts

Only the client is installed with this command, this assumes a TV-Headend server is running on another local IP-address.

Inputstream-adaptive helper to play DRM protected (Widevine) content

sudo apt-get install kodi-inputstream-adaptive

The add-on then will extract (and update) the needed libs from internet automatically.

To enable HEVC HW decoding, you have to tweak /boot/config.txt

Add this line (only for RPI4)

dtoverlay=rpivid-v4l2

For 4K HEVC playback tweak this line:

# Enable DRM VC4 V3D driver
dtoverlay=vc4-kms-v3d,cma-512

Mount NFS shares

Somehow Kodi on Bullseye stopped discovering NFS by default. Don’t worry to much, just give it a little manual bump.

  • Choose Browse for new share -> Add network location -> Protocol -> Network File System (NFS)
  • Entering the your ip-address as Server address and Remote path manually, adding up to something like nfs://192.168.0.3:/path/to/mnt/
  • Click OK, then it will list.
  • Select and click OK.

Conclusion

Changes in `/boot/config.txt` require a reboot.

After all these steps, playing 4K HEVC content with HW-acceleration should work fine on a Raspberry Pi 4.

That’s all. Let me know if it’s working for you.

 

No Comments

Powering a Pi Zero (2) from your laptop

{}
November 12th, 2021

The new quad-core Pi Zero 2 has a lot more horsepower than the original Zero and as a consequence it does require more power than the original Zero.

But that doesn’t necessarily means that you cannot power it from an USB port from your laptop.

Can you still power a Raspberry Pi Zero from an USB port of a laptop?

Let’s try. Be reminded all Pi’s are cleverly designed to throttle down, when they experience a power shortage.

To check if your Pi has throttled down:

> vcgencmd get_throttled
throttled=0x0

If you see some other output then 0x0 yes then you’ve had power problems. Otherwise you’re OK.

For the moment, running Raspberry Pi OS Bullseye on a Raspberry Pi Zero 2 powered form an USB port doesn’t show problems by just installing programs and updating the OS.

No Comments

No display after update to LibreElec 10.0.1 on a Raspberry Pi 4

{}
November 9th, 2021

Last weekend I did an upgrade on my Kodi/LibreElec 10.0.0 RPI4 to 10.0.1.

All went well initially, I also did a firmware upgrade, but after rebooting I got a blank screen.

For a moment I thought Kodi didn’t boot at all, but on my Kore remote app, I saw that it was connected.

Also I could hear the GUI sounds. I disconnected my monitor, tried different HDMI inputs and different settings on the monitor. To no avail. Rebooted my Pi again. Shut it down, disconnected the power, connected it again, and rebooted. Still a blank screen. Could see the blown up pixel for a while, but blank screen afterward.

Still I could hear the GUI sounds, and I could even start a DVB-T TV channel.

So Kodi was working, but there was no HDMI output! Then intuitively I changed the audio-output from IQAudioDAC to HDMI and suddenly it started working! I changed it again to IQAudioDAC and screen output kept working.

And it did since!

Somehow changing the audio output fixed the blank screen output on my Raspberry Pi 4. Weird.

And don’t ask me why, but I’m still happy with this LibreElec / Kodi setup on my Raspberry Pi 4.

Changing Audio output remotely on Kodi

To change the audio output for Kodi remotely, instead of using the GUI or the Kore remote app and a lot of clicks, you can use these commands from another PC or phone:

Change to HDMI

curl -v -H "Content-type: application/json" -d '{"jsonrpc":"2.0","method":"Settings.SetSettingValue", "params":{"setting":"audiooutput.audiodevice","value":"PI:HDMI"},"id":1}' http://yourpi.local:8080/jsonrpc

Change to analogue

curl -v -H "Content-type: application/json" -d '{"jsonrpc":"2.0","method":"Settings.SetSettingValue", "params":{"setting":"audiooutput.audiodevice","value":"PI:Analogue"},"id":1}' http://yourpi.local:8080/jsonrpc

 

Remember to change the domain/hostname ot an IP-address if you wish to run the command from your Android phone.

Above commands work great as Termux Widget shortcuts on your Android Phone.

3 Comments

Playing 4K smoothly on the Pi4, compiling Kodi 19 on Raspberry Pi OS

June 24th, 2021

Kodi is the best software to watch video on a Raspberry Pi. The Raspberry Pi 4 supports 4K, but the only software that can play it well is Kodi. That’s a bit disappointing, knowing the the Pi4 is already available since early 2019.

On the other hand, Kodi is nice open source software, with a thriving community.

Playing video in a browser is energy-wise, (privacy-wise IMHO) and performance-wise a bad thing. Try playing YouTube movies in a browser and in Kodi (unofficial YouTube plugin), and see the differences. Stuttering play, and high CPU usage in the browser, smooth play and lower CPU usage in Kodi.

The best performance for Kodi is offered by LibreELEC, a lightweight ‘Just enough OS’ Linux distribution. if you wanna run the latest Kodi on Raspberry Pi OS, you’ll need to compile it yourself at the moment.

Compile instructions Kodi 19

There isn’t yet an updated version Kodi 19 in Raspberry Pi OS, so you’ll need to compile Kodi 19 yourself. Big underlying changes in the way video and hardware-accceleration is done in the new kernel 5.10 broke Kodi 18.7 and

On the Kodi forum there are several attempts to compile a working version, but apparently that is not so simple. Still I used those instructions as a base, but added the kernel-header packages ` as a dependency and use a patched version of Kodi.

# sudo apt update && sudo apt full-upgrade -y


sudo apt install                                                     \
autoconf automake autopoint autotools-dev cmake cpp curl default-jre \
g++ gawk gcc gdc gettext git gperf libasound2-dev libass-dev             \
libavahi-client-dev libavahi-common-dev libbluetooth-dev             \
libbluray-dev libbz2-dev libcdio-dev libcec4 libcec-dev              \
libcrossguid-dev libcurl4-openssl-dev libcwiid-dev libdbus-1-dev     \
libdrm-dev libegl1-mesa-dev libenca-dev libflac-dev libfmt3-dev      \
libfontconfig-dev libfreetype6-dev libfribidi-dev libfstrcmp-dev     \
libgbm-dev libgcrypt-dev libgif-dev libgles2-mesa-dev libglew-dev    \
libglu1-mesa-dev libgnutls28-dev libgpg-error-dev libgtest-dev       \
libinput-dev libiso9660-dev libjpeg-dev liblcms2-dev liblirc-dev     \
libltdl-dev liblzo2-dev libmariadb-dev libmicrohttpd-dev libnfs-dev  \
libogg-dev libomxil-bellagio-dev libpcre3-dev libplist-dev           \
libpng-dev libpulse-dev libshairplay-dev libsmbclient-dev            \
libsqlite3-dev libssl-dev libtag1-dev libtiff5-dev libtinyxml-dev    \
libtool libudev-dev libunistring-dev libva-dev libvdpau-dev          \
libvorbis-dev libxkbcommon-dev libxmu-dev libxrandr-dev libxslt1-dev \
libxt-dev lsb-release meson nasm ninja-build python3-dev python3-pil \
python-support rapidjson-dev raspberrypi-kernel-headers swig unzip \
uuid-dev wayland-protocols yasm zip zlib1g-dev

Then you need a special GBM version of Kodi, but instead of this version.

wget https://github.com/popcornmix/xbmc/archive/gbm_matrix.zip

I used a patched version:

wget https://github.com/graysky2/xbmc/archive/refs/heads/gs-gbm_matrix.zip

Then this workaround is needed, Raspberry Pi OS uses a different path for some files. This just creates a symbolic link to the right path.


# drm_fourcc error workaround
sudo mkdir /usr/include/drm/ 
sudo ln -s /usr/include/libdrm/drm_fourcc.h /usr/include/drm/drm_fourcc.h

Extract the downloaded zip:

unzip gs-gbm_matrix.zip

Enter the map

cd xbmc-gs-gbm_matrix

Create build directory:

mkdir kodi-build

Enter build directory

cd kodi-build

Then make:

cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local -DCORE_PLATFORM_NAME=gbm -DAPP_RENDER_SYSTEM=gles -DX11_RENDER_SYSTEM=gles -DENABLE_INTERNAL_FMT=ON -DENABLE_INTERNAL_FLATBUFFERS=ON -DENABLE_INTERNAL_SPDLOG=ON -DENABLE_VAAPI=OFF -DENABLE_VDPAU=OFF

Then compile

cmake --build . -- VERBOSE=1 -j$(getconf _NPROCESSORS_ONLN)

If done properly, ti should take about 2 hours. Afterwards you can start Kodi with `kodi-build/kodi-gbm`

That’s all. And don’t forget to backup your existing Kodi profile.

Occasionally the script exits with an error. Seems it’s running out of memory. Just restart the building process, executing the cmake –build command, to finish compiling.

UPDATE:

For Raspberry Pi Bullseye see this new post: