<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Android on Terminal</title><link>https://muisti.atk-neuvos.fi/tags/android/</link><description>Recent content in Android on Terminal</description><generator>Hugo</generator><language>en</language><lastBuildDate>Mon, 09 Nov 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://muisti.atk-neuvos.fi/tags/android/index.xml" rel="self" type="application/rss+xml"/><item><title>Wireguard VPN networking</title><link>https://muisti.atk-neuvos.fi/posts/wireguard/</link><pubDate>Mon, 09 Nov 2026 00:00:00 +0000</pubDate><guid>https://muisti.atk-neuvos.fi/posts/wireguard/</guid><description>&lt;h1 id="background"&gt;Background&lt;/h1&gt;
&lt;p&gt;As easier or ad-hoc VPN solution to openvpn, wireguard provides user space tools for point-to-point networking with roaming clients.&lt;/p&gt;
&lt;p&gt;One static public host is needed.&lt;/p&gt;
&lt;h1 id="network-topology"&gt;Network topology&lt;/h1&gt;
&lt;h2 id="server"&gt;Server&lt;/h2&gt;
&lt;p&gt;Any publicly reachable host with optional DNS name.&lt;/p&gt;
&lt;p&gt;It also has private address 172.16.0.1 for WG interface.&lt;/p&gt;
&lt;h2 id="roaming-peer-1"&gt;Roaming peer 1&lt;/h2&gt;
&lt;p&gt;Using any network anywhere.
WG address is 172.16.0.2&lt;/p&gt;
&lt;h1 id="package-setup-for-all-hosts"&gt;Package setup for all hosts&lt;/h1&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;sudo apt install wireguard-tools
&lt;/code&gt;&lt;/pre&gt;&lt;h1 id="key-generation"&gt;Key generation&lt;/h1&gt;
&lt;h2 id="server-1"&gt;Server&lt;/h2&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;wg genkey &amp;gt;/root/wg/srv.key
wg pubkey &amp;lt;/root/wg/srv.key &amp;gt;/root/wg/srv.pub
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id="peer-1"&gt;Peer 1&lt;/h2&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;wg genkey &amp;gt;/root/wg/stinky.key
wg pubkey &amp;lt;/root/wg/stinky.key &amp;gt;/root/wg/stinky.pub
&lt;/code&gt;&lt;/pre&gt;&lt;h1 id="server-setup"&gt;Server setup&lt;/h1&gt;
&lt;h2 id="allow-traffic-at-udp12345"&gt;Allow traffic at udp/12345&lt;/h2&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;ufw allow udp/12345 comment &amp;#39;wireguard&amp;#39;
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id="public-server-config"&gt;Public server config&lt;/h2&gt;
&lt;p&gt;The peer key below is stinky.pub contents&lt;/p&gt;</description></item><item><title>Dump your own L3 CDM</title><link>https://muisti.atk-neuvos.fi/posts/cdm/</link><pubDate>Thu, 22 Oct 2026 00:00:00 +0000</pubDate><guid>https://muisti.atk-neuvos.fi/posts/cdm/</guid><description>&lt;p&gt;Sometimes you need widevine keys/device for whatever reason, like dumping content from your streaming service.&lt;/p&gt;
&lt;h3 id="install-android-studio-by-whatever-means-necessary"&gt;Install android studio by whatever means necessary&lt;/h3&gt;
&lt;h3 id="prepare-a-virtual-device"&gt;Prepare a virtual device&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;create new device in device manager&lt;/li&gt;
&lt;li&gt;choose Pixel 4 XL&lt;/li&gt;
&lt;li&gt;install API 34 and select Google APIs Intel x86_64 Atom System Image&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="prepare-host-and-host-software"&gt;Prepare host and host software&lt;/h3&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;mkdir keydive &amp;amp;&amp;amp; cd keydive
python3 -m venv .venv keydive &amp;amp;&amp;amp; .venv/bin/activate
pip install frida frida-tools keydive
&lt;/code&gt;&lt;/pre&gt;&lt;h3 id="download-or-build-frida-server-apk"&gt;Download or build frida server apk&lt;/h3&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;git checkout https://github.com/frida/frida.git
wget https://github.com/frida/frida/releases/download/17.24.3/frida-server-17.24.3-android-x86_64.xz
&lt;/code&gt;&lt;/pre&gt;&lt;h3 id="launch-the-android-virtual-device-from-studio"&gt;Launch the android virtual device from studio&lt;/h3&gt;
&lt;h3 id="check-that-emulator-is-visible-to-adb"&gt;Check that emulator is visible to adb&lt;/h3&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;adb devices
&lt;/code&gt;&lt;/pre&gt;&lt;h3 id="run-frida-server-on-virtual-device"&gt;Run frida-server on virtual device&lt;/h3&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;adb root
adb push frida-server-17.24.3-android-x86_64 /data/local/tmp/
adb shell
cd /data/local/tmp/
chmod 750 frida*
./frida-server-17.24.3-android-x86_64
&lt;/code&gt;&lt;/pre&gt;&lt;h3 id="run-keydumper-in-python-venv-keydive"&gt;Run keydumper in python venv (keydive)&lt;/h3&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;keydive -kw -a player
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Proper startup looks like this:
&lt;img src="https://muisti.atk-neuvos.fi/posts/cdm/keydive.png" alt="startup"&gt;&lt;/p&gt;</description></item><item><title>Convert android screenshots to AVIF</title><link>https://muisti.atk-neuvos.fi/posts/avif/</link><pubDate>Fri, 05 Dec 2025 00:00:00 +0000</pubDate><guid>https://muisti.atk-neuvos.fi/posts/avif/</guid><description>&lt;p&gt;Jpeg or png based phone screenshots are huge, we dont want that.
AVIF is excellent free and open image format for many purposes.
AVIF image is basically a singular AV1 video frame in a HEIF container.&lt;/p&gt;
&lt;h1 id="install-tools"&gt;Install tools&lt;/h1&gt;
&lt;p&gt;Imagemagick is bad with multithreading so we use GNU parallel to utilize all CPU cores.
Otherwise excellent graphicsmagick doesn&amp;rsquo;t know how to write avif at the time of writing, so we are stuck with IM.&lt;/p&gt;</description></item><item><title>Profiling android battery usage</title><link>https://muisti.atk-neuvos.fi/posts/profiler/</link><pubDate>Sun, 20 Jul 2025 00:00:00 +0000</pubDate><guid>https://muisti.atk-neuvos.fi/posts/profiler/</guid><description>&lt;p&gt;ADB shell access is needed so enable developer mode and allow ADB in developer settings.
ADB over tcp can be useful, but USB3 is much faster.&lt;/p&gt;
&lt;h1 id="initiate-logging"&gt;Initiate logging&lt;/h1&gt;
&lt;p&gt;Lets start measuring and logging, preferably with almost empty battery.&lt;/p&gt;
&lt;p&gt;Connect phone to computer with USB and reset battery stats.&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;adb shell dumpsys batterystats --reset
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Charge the phone to 100%. Then use the phone normally until something interesting happens, like severe battery drain.&lt;/p&gt;</description></item><item><title>Android &lt;-&amp;gt; PC notepad style file editor/sync</title><link>https://muisti.atk-neuvos.fi/posts/filesync/</link><pubDate>Wed, 30 Apr 2025 00:00:00 +0000</pubDate><guid>https://muisti.atk-neuvos.fi/posts/filesync/</guid><description>&lt;h1 id="general-info"&gt;General info&lt;/h1&gt;
&lt;p&gt;Mobile and PC can be in any different networks, ssh is used for comms.
OpenVPN is used for handy and secure access bridging any networks.&lt;/p&gt;
&lt;h1 id="android-setup"&gt;Android setup&lt;/h1&gt;
&lt;ul&gt;
&lt;li&gt;install “Simple SSHD” from play market, it is dropbear sshd daemon
&lt;ul&gt;
&lt;li&gt;inject your public key into phone sshd&lt;/li&gt;
&lt;li&gt;configure port etc&lt;/li&gt;
&lt;li&gt;create sshd shortcut on home screen&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;install fossify notepad from play market
&lt;ul&gt;
&lt;li&gt;configure new txt file with export to sd option&lt;/li&gt;
&lt;li&gt;make the file /sdcard/000notepad.txt&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h1 id="linux-setup"&gt;Linux setup&lt;/h1&gt;
&lt;ul&gt;
&lt;li&gt;working ssh client and some network required&lt;/li&gt;
&lt;li&gt;openvpn client is required&lt;/li&gt;
&lt;/ul&gt;
&lt;h1 id="place-editor-script-into-pc-binmemo"&gt;Place editor script into PC ~/bin/memo&lt;/h1&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;#!/bin/bash
MNT=$(mktemp -d); sshfs phone:/sdcard/ $MNT &amp;amp;&amp;amp; vi $MNT/000notepad.txt &amp;amp;&amp;amp; umount $MNT &amp;amp;&amp;amp; rmdir $MNT
&lt;/code&gt;&lt;/pre&gt;&lt;h1 id="ssh-client-config-setup-with-lanvpn-aliasing"&gt;SSH client config setup with LAN/VPN aliasing&lt;/h1&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;# phone in VPN network
Match originalhost op10 localnetwork 172.16.10.0/24
Hostname 172.16.10.2

# phone in home LAN
Host op10
HostName 192.168.1.44
Port 2222
&lt;/code&gt;&lt;/pre&gt;&lt;h1 id="usage"&gt;Usage&lt;/h1&gt;
&lt;p&gt;Run memo command in any network while phone sshd is running and you can view/edit the file from anywhere&lt;/p&gt;</description></item><item><title>OpenVPN networking</title><link>https://muisti.atk-neuvos.fi/posts/openvpn/</link><pubDate>Thu, 03 Apr 2025 00:00:00 +0000</pubDate><guid>https://muisti.atk-neuvos.fi/posts/openvpn/</guid><description>&lt;h1 id="package-setup-for-building-files-at-any-host-computer"&gt;Package setup for building files at any host computer&lt;/h1&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;sudo apt install easy-rsa openssl openvpn
&lt;/code&gt;&lt;/pre&gt;&lt;h1 id="package-setup-for-openvpn-server"&gt;Package setup for OpenVPN server&lt;/h1&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;sudo apt install openvpn
&lt;/code&gt;&lt;/pre&gt;&lt;h1 id="create-directory-for-building-and-keeping-keyfiles"&gt;Create directory for building and keeping keyfiles&lt;/h1&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;mkdir ~/vpn_repo
cd ~/vpn_repo
&lt;/code&gt;&lt;/pre&gt;&lt;h1 id="-from-here-on-everything-happens-at-vpn_repo--"&gt;*** From here on, everything happens at ~/vpn_repo !!! ***&lt;/h1&gt;
&lt;h1 id="fetch--prepare-easy-tls"&gt;Fetch &amp;amp; prepare easy-tls&lt;/h1&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;wget https://raw.githubusercontent.com/TinCanTech/easy-tls/refs/heads/master/easytls
chmod 750 easytls
&lt;/code&gt;&lt;/pre&gt;&lt;h1 id="for-creating-all-the-needed-openvpn-server-files"&gt;For creating all the needed OpenVPN server files&lt;/h1&gt;
&lt;p&gt;&lt;code&gt;cat &amp;gt;server.sh&lt;/code&gt;&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;#!/bin/bash

# cert &amp;amp; ca expiry 10 years
export EASYRSA_KEY_SIZE=2048
export EASYRSA_CA_EXPIRE=3650
export EASYRSA_CERT_EXPIRE=3650

TARGET=$1
USER=$2
PASS=$3

if [ -z $TARGET ]
then
 echo &amp;#34;Give servername as arg&amp;#34;
 exit
fi

make-cadir $TARGET
if [ $? -eq 0 ]
 then
 cd $TARGET

 # build server cert package
 ./easyrsa init-pki
 echo $TARGET | ./easyrsa build-ca nopass
 ./easyrsa gen-dh
 echo yes | ./easyrsa build-server-full $TARGET nopass

 # prepare tls-auth key
 if [[ ! -d pki/easytls ]]
 then
 ../easytls init-tls
 ../easytls build-tls-auth
 fi

 cd ..
 mkdir -p out
 # symlink all files needed on server side
 ln -srf $TARGET/pki/private/$TARGET.key out/
 ln -srf $TARGET/pki/ca.crt out/${TARGET}_ca.crt
 ln -srf $TARGET/pki/easytls/tls-auth.key out/${TARGET}_tls-auth.key
 ln -srf $TARGET/pki/dh.pem out/${TARGET}_dh.pem
 ln -srf $TARGET/pki/issued/$TARGET.crt out/

 echo &amp;#34;#### OpenVPN server files&amp;#34;
 find out | tail +2
 echo &amp;#34;####&amp;#34;
 echo &amp;#34;Copy these files to server /etc/openvpn/server/&amp;#34;
fi
&lt;/code&gt;&lt;/pre&gt;&lt;h1 id="for-creating-client-profiles"&gt;For creating client profiles&lt;/h1&gt;
&lt;p&gt;&lt;code&gt;cat &amp;gt;gen_user.sh&lt;/code&gt;&lt;/p&gt;</description></item></channel></rss>