How to edit Epsilon Notes AOK file.

20 views
Skip to first unread message

petr.m...@gmail.com

unread,
Sep 25, 2025, 2:02:40 AMSep 25
to Epsilon Notes
<!-- AI-generated English translation of the user's final Czech guide. -->

<h3>Editing and Re-Signing APK in Termux + proot-Ubuntu — Version 3</h3>

<h5>Introduction</h5>
<p>
This guide shows how to unpack, modify, and recompile any APK file on Android without using a PC. As an example,
Epsilon Notes is used, which is a handy program for Android but unfortunately abandoned and no longer developed.
</p>

<p>
The prepared environment allows modifications to all parts of the application — from images, texts, and configuration files to the <code>.smali</code> files.
</p>

<p>
Because compilation directly in Termux does not work reliably, Ubuntu running in a proot environment is used for it. The source code is stored
so that it is accessible both from Ubuntu and from Termux, so edits of code, images, etc. can conveniently be done in Termux.
</p>

<p><strong>The result is a fully functional working environment directly on Android</strong> that allows you to:</p>
<ul>
  <li>unpack any APK,</li>
  <li>make changes to source files and <code>.smali</code> code,</li>
  <li>recompile and digitally sign the application,</li>
  <li>and immediately install it back into the system.</li>
</ul>

<p>All this without the need to connect the device to a computer.</p>

<h4>Requirements</h4>
<ul>
  <li>Android device with Termux (ARM)</li>
  <li>about 200 MB free space for Ubuntu</li>
  <li>original APK in <code>~/work-local/Epsilon/Epsilon Notes 2.31[1].apk</code></li>
</ul>

<h4>1) Termux – prepare the environment</h4>
<p>Update the system:</p>
<pre><code>pkg update &amp;&amp; pkg upgrade</code></pre>

<p>Install the tool for Ubuntu:</p>
<pre><code>pkg install proot-distro</code></pre>

<p>Create a shared folder accessible to both Termux and Ubuntu:</p>
<pre><code>mkdir -p ~/work-local/Epsilon</code></pre>

<h4>2) Termux – install and launch Ubuntu</h4>
<p>Install Ubuntu:</p>
<pre><code>proot-distro install ubuntu</code></pre>

<p>Start Ubuntu:</p>
<pre><code>proot-distro login ubuntu</code></pre>

<p>Create symlinks in Ubuntu for easy access:</p>
<pre><code>ln -s /data/data/com.termux/files/home /root/home
ln -s /sdcard /root/sdcard</code></pre>

<p>Thanks to this, <code>/root/home/work-local/Epsilon</code> in Ubuntu will point to the same directory used by Termux (<code>~/work-local/Epsilon</code>).</p>

<h4>3) Ubuntu – install tools</h4>
<p>Update repositories:</p>
<pre><code>apt update</code></pre>

<p>Install packages (basic option):</p>
<pre><code>apt install openjdk-17-jre-headless apktool zipalign apksigner</code></pre>

<h5>Alternative: install the full Java (JDK)</h5>
<p>If you want to have all Java tools available, you can install the full JDK:</p>
<pre><code>apt install openjdk-17-jdk apktool zipalign apksigner</code></pre>

<h5>Difference between <code>headless</code> and full JDK</h5>
<ul>
  <li><strong>openjdk-17-jre-headless</strong><br>
    Contains only the minimum for running Java programs.<br>
    Does not include graphical libraries (AWT, Swing), so X11 dependencies are not installed.<br>
    Advantages: smaller size (about 200 MB), faster installation.<br>
    Disadvantages: you do not have some JDK tools (e.g., <code>javac</code>, development utilities).
  </li>
  <li><strong>openjdk-17-jdk</strong><br>
    Complete Java Development Kit.<br>
    Includes the <code>javac</code> compiler and all libraries including GUI support.<br>
    Advantages: full compatibility, all development tools available.<br>
    Disadvantages: significantly larger (about 600 MB) and more dependencies.
  </li>
</ul>

<h5>Recommendation</h5>
<p>
For working with APK (apktool, zipalign, apksigner, keytool) the headless variant is sufficient.
The full JDK only makes sense if you plan to develop software in Java in Ubuntu as well.
</p>

<h4>4) Create a key (keystore)</h4>
<p>Create a folder for keys:</p>
<pre><code>mkdir -p ~/keystores</code></pre>

<p>Generate a key:</p>
<pre><code>keytool -genkeypair -keystore ~/keystores/android-apk-keys.jks -alias epsilonkey -keyalg RSA -keysize 2048 -validity 30000</code></pre>

<p>Enter the details and password as prompted. This key will be used every time you sign.</p>

<p><strong>Note on backup:</strong><br>
The file <code>~/keystores/android-apk-keys.jks</code> is your “signing key”.<br>
If you lose it, you will not be able to update the application (new versions will not match the old signature).<br>
Therefore, back it up (copy it) outside the device (PC, external card, cloud). You may need it your whole life.
</p>

<h4>5) Unpack APK (in Ubuntu)</h4>
<p>Unpack the original APK into the shared folder (so that it is also accessible in Termux):</p>
<pre><code>apktool d ~/home/work-local/Epsilon/Epsilon\ Notes\ 2.31[1].apk -o ~/home/work-local/Epsilon/EpsilonNotes2.31W000</code></pre>

<p>This creates the folder <code>~/work-local/Epsilon/EpsilonNotes2.31W000</code>, which will be visible to both Ubuntu and Termux.</p>

<h4>6) Edit sources (in Termux or Ubuntu)</h4>
<p>Go to the folder:</p>
<pre><code>cd ~/work-local/Epsilon/EpsilonNotes2.31W000</code></pre>

<p>Possible edits:</p>
<ul>
  <li><code>assets/</code> — replace MathJax</li>
  <li><code>res/</code> — images, texts, layouts</li>
  <li><code>AndroidManifest.xml</code> — name, permissions, version</li>
  <li><code>smali/</code> — edit <code>.smali</code> files (Java bytecode in text form)</li>
</ul>

<p>Because the folder is in <code>~/work-local/Epsilon/</code>, you can edit it directly in Termux (e.g., <code>vim</code>, <code>nano</code>) as well as in Ubuntu.</p>

<h4>7) Repack APK (in Ubuntu)</h4>
<p>After edits, start Ubuntu again:</p>
<pre><code>proot-distro login ubuntu</code></pre>

<p>Repack:</p>
<pre><code>apktool b ~/home/work-local/Epsilon/EpsilonNotes2.31W000 -o ~/home/work-local/Epsilon/EpsilonNotes2.31W000/unsigned.apk</code></pre>

<h4>8) Align and sign (in Ubuntu)</h4>
<p>Go to the folder:</p>
<pre><code>cd ~/home/work-local/Epsilon/EpsilonNotes2.31W000</code></pre>

<p>Align:</p>
<pre><code>zipalign -v 4 unsigned.apk aligned.apk</code></pre>

<p>Sign:</p>
<pre><code>apksigner sign --ks ~/keystores/android-apk-keys.jks --ks-key-alias epsilonkey --out signed.apk aligned.apk</code></pre>

<h5>What does <code>epsilonkey</code> mean?</h5>
<ul>
  <li>When creating the keystore (chapter 4) you chose the alias of the key, in our example <strong><code>epsilonkey</code></strong>.</li>
  <li>The alias is the name of a specific key stored in the file <code>android-apk-keys.jks</code>.</li>
  <li>The keystore can contain several keys (for different applications), so it is always necessary to specify which key to use when signing.</li>
  <li>If you had entered another alias when generating (e.g., <code>mojeapk</code>), you must use it in the <code>apksigner</code> command as well.</li>
</ul>

<p>The alias itself is not secret, what is important is the <strong>password</strong> for the key and the <strong>keystore file</strong> itself — those you must protect.</p>

<h4>9) Install the resulting APK (in Termux)</h4>
<p>In Termux run:</p>
<pre><code>termux-open ~/work-local/Epsilon/EpsilonNotes2.31W000/signed.apk</code></pre>

<p>or open the resulting file in a file manager.</p>

petr.m...@gmail.com

unread,
Sep 25, 2025, 2:10:18 AMSep 25
to Epsilon Notes
[This is an AI-generated English translation of the original Czech guide.]


Editing and Re-Signing APK in Termux + proot-Ubuntu — Version 3

Introduction

This guide shows how to unpack, modify, and recompile any APK file on Android without using a PC. As an example, Epsilon Notes is used, which is a handy program for Android but unfortunately abandoned and no longer developed.

The prepared environment allows modifications to all parts of the application — from images, texts, and configuration files to the .smali files.

Because compilation directly in Termux does not work reliably, Ubuntu running in a proot environment is used. The sources are stored so that they are accessible both from Ubuntu and Termux, so edits of code, images, etc. can be comfortably done in Termux.

The result is a fully functional working environment directly on Android, which allows you to:
- unpack any APK
- make changes to source files and .smali code
- recompile and digitally sign the application
- and install it back into the system


All this without the need to connect the device to a computer.

Requirements
- Android device with Termux (ARM)
- about 200 MB free space for Ubuntu
- original APK in ~/work-local/Epsilon/Epsilon Notes 2.31[1].apk


1) Termux – prepare the environment
Update the system:
pkg update && pkg upgrade


Install the tool for Ubuntu:
pkg install proot-distro


Create a shared folder accessible to both Termux and Ubuntu:
mkdir -p ~/work-local/Epsilon


2) Termux – install and launch Ubuntu
Install Ubuntu:
proot-distro install ubuntu

Start Ubuntu:
proot-distro login ubuntu


Create symlinks in Ubuntu for easy access:
ln -s /data/data/com.termux/files/home /root/home
ln -s /sdcard /root/sdcard

Thanks to this, /root/home/work-local/Epsilon in Ubuntu will point to the same directory used by Termux (~/work-local/Epsilon).

3) Ubuntu – install tools
Update repositories:
apt update

Install packages (basic option):

apt install openjdk-17-jre-headless apktool zipalign apksigner

Alternative: install the full Java (JDK)
apt install openjdk-17-jdk apktool zipalign apksigner

Difference between headless and full JDK
- openjdk-17-jre-headless

  Contains only the minimum for running Java programs.
  Does not include graphical libraries (AWT, Swing), so X11 dependencies are not installed.
  Advantages: smaller size (about 200 MB), faster installation.
  Disadvantages: you do not have some JDK tools (e.g., javac, development utilities).
- openjdk-17-jdk
  Complete Java Development Kit.
  Includes the javac compiler and all libraries including GUI support.

  Advantages: full compatibility, all development tools available.
  Disadvantages: significantly larger (about 600 MB) and more dependencies.

Recommendation

For working with APK (apktool, zipalign, apksigner, keytool) the headless variant is sufficient.
The full JDK only makes sense if you plan to develop software in Java in Ubuntu as well.

4) Create a key (keystore)
Create a folder for keys:
mkdir -p ~/keystores

Generate a key:

keytool -genkeypair -keystore ~/keystores/android-apk-keys.jks -alias epsilonkey -keyalg RSA -keysize 2048 -validity 30000

Enter the details and password as prompted. This key will be used every time you sign.

Note on backup:
The file ~/keystores/android-apk-keys.jks is your “signing key”.

If you lose it, you will not be able to update the application (new versions will not match the old signature).
Therefore, back it up (copy it) outside the device (PC, external card, cloud). You may need it your whole life.

5) Unpack APK (in Ubuntu)
Unpack the original APK into the shared folder (so that it is also accessible in Termux):
apktool d ~/home/work-local/Epsilon/Epsilon\ Notes\ 2.31[1].apk -o ~/home/work-local/Epsilon/EpsilonNotes2.31W000

This creates the folder ~/work-local/Epsilon/EpsilonNotes2.31W000, which will be visible to both Ubuntu and Termux.


6) Edit sources (in Termux or Ubuntu)
Go to the folder:
cd ~/work-local/Epsilon/EpsilonNotes2.31W000

Possible edits:
- assets/ — replace MathJax
- res/ — images, texts, layouts
- AndroidManifest.xml — name, permissions, version
- smali/ — edit .smali files (Java bytecode in text form)

Because the folder is in ~/work-local/Epsilon/, you can edit it directly in Termux (e.g., vim, nano) as well as in Ubuntu.


7) Repack APK (in Ubuntu)
After edits, start Ubuntu again:
proot-distro login ubuntu

Repack:

apktool b ~/home/work-local/Epsilon/EpsilonNotes2.31W000 -o ~/home/work-local/Epsilon/EpsilonNotes2.31W000/unsigned.apk

8) Align and sign (in Ubuntu)
Go to the folder:
cd ~/home/work-local/Epsilon/EpsilonNotes2.31W000

Align:

zipalign -v 4 unsigned.apk aligned.apk

Sign:

apksigner sign --ks ~/keystores/android-apk-keys.jks --ks-key-alias epsilonkey --out signed.apk aligned.apk

What does epsilonkey mean?
- When creating the keystore (chapter 4) you chose the alias of the key, in our example epsilonkey.
- The alias is the name of a specific key stored in the file android-apk-keys.jks.
- The keystore can contain several keys (for different applications), so it is always necessary to specify which key to use when signing.
- If you had entered another alias when generating (e.g., mojeapk), you must use it in the apksigner command as well.

The alias itself is not secret, what is important is the password for the key and the keystore file itself — those you must protect.


9) Install the resulting APK (in Termux)
In Termux run:
termux-open ~/work-local/Epsilon/EpsilonNotes2.31W000/signed.apk
Reply all
Reply to author
Forward
0 new messages