Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,10 @@ jobs:
run: |
if [[ ! -f "$ANDROID_HOME/platforms/android-37.1/android.jar" ||
! -x "$ANDROID_HOME/build-tools/36.0.0/aapt2" ||
! -x "$ANDROID_HOME/cmake/3.22.1/bin/cmake" ||
! -f "$ANDROID_HOME/ndk/$HOTSPOT_NDK_VERSION/source.properties" ]]; then
"$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager" --sdk_root="$ANDROID_HOME" --channel=0 \
'platforms;android-37.1' 'build-tools;36.0.0' "ndk;$HOTSPOT_NDK_VERSION" < <(yes)
'platforms;android-37.1' 'build-tools;36.0.0' 'cmake;3.22.1' "ndk;$HOTSPOT_NDK_VERSION" < <(yes)
fi

- name: Prepare HotSpot runtime
Expand All @@ -69,7 +70,7 @@ jobs:
run: |
bundle=app/build/outputs/bundle/release/app-release.aab
entries=$(unzip -Z1 "$bundle")
for file in assets/hotspot/worker.jar assets/hotspot/lib/modules lib/arm64-v8a/libjvm.so lib/arm64-v8a/libshowjava_hotspot.so; do
for file in assets/hotspot/worker.jar assets/hotspot/lib/modules lib/arm64-v8a/libjvm.so lib/arm64-v8a/libshowjava_hotspot.so lib/arm64-v8a/libshowjava_observation.so; do
grep -Fxq "base/$file" <<< "$entries"
done
native=$(mktemp -d)
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Thumbs.db
.project
.idea
.gradle
/app/.cxx/
/.kotlin/
build
*.iml
Expand Down
10 changes: 10 additions & 0 deletions APP_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,16 @@ Long-press a file to select it, then tap **Export raw files**. The ZIP preserves

Open **Choose an installed app** from the workspace, the **Change** menu, or **Choose another input**. Search by app name or package name, clear the search with the **X** inside the search field, or turn on **Show system apps** to include visible system apps. The list covers launchable apps Android makes visible in your current profile. Tap a row to import that app and return to the workspace, or close the sheet to keep the current selection.

## Observe an app’s network connections

Open **App options → Network observation**, choose an installed app, and tap **Start observation**. Enable notifications and approve Android’s VPN prompt when asked. Android can run one VPN per profile. Disconnect any active VPN in Android settings before starting. Use the selected app as usual, then tap **Stop observation** here or in the notification.

The connection report shows destination IP addresses and ports, first and last activity, and sent and received IP bytes, including headers. The report keeps up to 500 connections in memory on your device. **Clear session**, starting a new session, or closing the app process removes the report.

The Android VPN forwards supported TCP, UDP, and ping traffic directly to the selected app’s original destinations. This uses the device’s live internet connection while decompilation and APK inspection work offline. Directly connected local subnets bypass observation, along with private and carrier-grade NAT IPv4 ranges on Android 17 and newer. TLS stays end-to-end. Android routes other apps normally. Apps with shared Android user IDs are excluded. Open connections may reconnect when observation starts or stops. Observation ends if the underlying network changes or loses internet access.

The prototype supports unfragmented IP packets up to 65,535 bytes at the VPN interface.

## Result history

Open **View history** from the workspace or **Manage saved results** under **Settings → Apps & storage**. **History** lists Java results and inspection reports newest first. Each row shows its type, a short summary, and the date when available. Tap a result to browse or export it.
Expand Down
2 changes: 1 addition & 1 deletion MODERNIZATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Rebuild Show Java as a single, ad-free Kotlin and Jetpack Compose app for Androi
Use JDK 17 and point Gradle to an Android SDK with platform 37.1 and build tools 36.0.0. The active app is in `app/src/main`. The top-level wrapper builds it without production credentials.

```sh
sdkmanager 'platforms;android-37.1' 'build-tools;36.0.0' 'platform-tools'
sdkmanager 'platforms;android-37.1' 'build-tools;36.0.0' 'platform-tools' 'ndk;28.2.13676358' 'cmake;3.22.1'
./gradlew assembleDebug lintDebug
```

Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

Show Java is an ad-free, offline APK, JAR, and DEX decompiler for Android 10 and newer. It reconstructs Java source on your device. [Google Play listing](https://play.google.com/store/apps/details?id=com.njlabs.showjava) · [Legacy releases](https://github.com/niranjan94/show-java/releases)

Optional per-app network observation uses a local Android VPN to forward live connections to their original destinations. Connection metadata stays on the device. [Network observation guide](APP_GUIDE.md#observe-an-apps-network-connections)

## Formats and engines

| Input | Decompiler |
Expand All @@ -20,7 +22,7 @@ Full APK resource extraction is deferred, and legacy ODEX files show an unsuppor

## Build

Use JDK 17 and the Android SDK 37.1 platform. The Gradle wrapper builds the debug APK and unsigned release bundle. [Build instructions and verification](MODERNIZATION.md#build-the-modern-app)
Use JDK 17, Android SDK 37.1, Android NDK 28.2.13676358, and CMake 3.22.1 from the Android SDK. The Gradle wrapper builds the debug APK and unsigned release bundle. [Build instructions and verification](MODERNIZATION.md#build-the-modern-app)

```sh
./gradlew assembleDebug bundleRelease
Expand Down
8 changes: 8 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ plugins {

android {
namespace = 'com.njlabs.showjava'
ndkVersion = '28.2.13676358'
compileSdk {
version = release(37) {
minorApiLevel = 1
Expand All @@ -48,6 +49,13 @@ android {
compose = true
}

externalNativeBuild {
cmake {
path 'src/main/cpp/observation/CMakeLists.txt'
version '3.22.1'
}
}

buildTypes {
release {
minifyEnabled = true
Expand Down
18 changes: 17 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_SYSTEM_EXEMPTED" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />

<queries>
<intent>
Expand Down Expand Up @@ -59,6 +63,18 @@
android:name=".hybrid.hermes.HermesWorkerService"
android:exported="false"
android:isolatedProcess="true" />
<!-- Android VPN consent qualifies this service for systemExempted. -->
<service
android:name=".observation.ObservationService"
android:exported="true"
android:foregroundServiceType="systemExempted"
android:permission="android.permission.BIND_VPN_SERVICE"
tools:ignore="ForegroundServicePermission">
<intent-filter>
<action android:name="android.net.VpnService" />
</intent-filter>
<meta-data android:name="android.net.VpnService.SUPPORTS_ALWAYS_ON" android:value="false" />
</service>
</application>

</manifest>
2 changes: 2 additions & 0 deletions app/src/main/assets/licenses/NOTICE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@ AndroidX libraries, Gson, the Kotlin standard library, kotlinx.coroutines, and k
Smali dexlib2 3.0.9 is distributed under BSD 3-Clause and Apache 2.0 terms. See Smali-LICENSE.txt. Source is available at https://github.com/google/smali.

The Hermes disassembly opcode profiles are derived from Meta Platforms, Inc. and affiliates' Hermes bytecode definitions under the MIT License. See Hermes-MIT.txt. Source is available at https://github.com/facebook/hermes.

The network observation forwarder uses zdtun by Emanuele Faranda, distributed under the GNU Lesser General Public License version 3 or later. See Zdtun-LGPL-3.0.txt and Show-Java-GPL-3.0.txt. The corresponding source, including Show Java's changes and the bundled uthash notice, is in app/src/main/cpp/observation/zdtun. Upstream source is available at https://github.com/emanuele-f/zdtun/tree/4a53fbbbfc16ed012af676a871dd989f3583a5e6.
165 changes: 165 additions & 0 deletions app/src/main/assets/licenses/Zdtun-LGPL-3.0.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007

Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.


This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.

0. Additional Definitions.

As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.

"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.

An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.

A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".

The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.

The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.

1. Exception to Section 3 of the GNU GPL.

You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.

2. Conveying Modified Versions.

If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:

a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or

b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.

3. Object Code Incorporating Material from Library Header Files.

The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:

a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.

b) Accompany the object code with a copy of the GNU GPL and this license
document.

4. Combined Works.

You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:

a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.

b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.

c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.

d) Do one of the following:

0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.

1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.

e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)

5. Combined Libraries.

You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:

a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.

b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.

6. Revised Versions of the GNU Lesser General Public License.

The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.

Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.

If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.
2 changes: 2 additions & 0 deletions app/src/main/assets/privacy-policy.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ When you open a file, Show Java reads the file you select or share and saves a w

Legacy History uses a read-only grant for the folder you link. It keeps the grant across sessions so you can reopen that history. If you choose a location in Android's save picker, Show Java writes the ZIP or JSON report there. The document provider you choose handles any storage or syncing under its own privacy policy.

Network observation is optional and starts only when you choose an app, tap Start observation, and grant Android VPN permission. The VPN endpoint runs on your device and forwards the selected app's internet traffic to its original destinations over your current connection. The report contains destination IP addresses, ports, times, protocols, and byte counts. Traffic is forwarded in memory and TLS remains end-to-end. The latest report stays in memory on your device until you clear it, start another session, or Android closes Show Java.

You can delete saved results in History. Show Java also prunes older results to limit private storage use. Selecting another input replaces the previous selection. Android's Clear storage option removes the app's local data and saved access, and uninstalling removes its private files from the device. You manage original files and exports in their chosen locations.

For privacy questions, contact Niranjan Rajendran at me@niranjan.io.
6 changes: 6 additions & 0 deletions app/src/main/cpp/observation/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
cmake_minimum_required(VERSION 3.22.1)
project(showjava_observation LANGUAGES C)

add_library(showjava_observation SHARED observation.c zdtun/zdtun.c zdtun/utils.c)
target_compile_definitions(showjava_observation PRIVATE NO_DEBUG _LITTLE_ENDIAN)
target_compile_options(showjava_observation PRIVATE -fvisibility=hidden)
Loading