Convert Figma logo to code with AI

google logoandroid-classyshark

Android and Java bytecode viewer

7,510
871
7,510
41

Top Related Projects

40,878

Dex to Java decompiler

12,202

Tools to work with android .dex and java .class files

6,287

smali/baksmali

19,798

A tool for reverse engineering Android apk files

6,019

A bytecode optimizer for Android apps

A utility for doing compile or runtime code generation targeting Android's Dalvik VM

Quick Overview

ClassyShark is an Android executable browser developed by Google. It's a standalone tool for analyzing Android APK files, DEX files, and other binary formats used in Android development. ClassyShark provides developers with insights into the structure and content of Android applications, helping with reverse engineering, optimization, and security analysis.

Pros

  • User-friendly GUI for easy navigation and analysis of APK contents
  • Supports multiple file formats including APK, DEX, AAR, SO, and class files
  • Provides detailed information about methods, fields, and dependencies
  • Offers both GUI and command-line interfaces for flexibility

Cons

  • Limited active development in recent years
  • May not support the latest Android features or file formats
  • Lacks some advanced features found in more specialized reverse engineering tools
  • Can be resource-intensive when analyzing large APK files

Getting Started

To use ClassyShark:

  1. Download the latest release from the GitHub repository.
  2. Ensure you have Java installed on your system.
  3. Run ClassyShark using the following command:
java -jar ClassyShark.jar
  1. Use the GUI to open and analyze APK files, or use the command-line interface for batch processing:
java -jar ClassyShark.jar -export APKFile.apk

This will generate a text report of the APK contents.

For more detailed usage instructions and examples, refer to the project's README and documentation on the GitHub repository.

Competitor Comparisons

40,878

Dex to Java decompiler

Pros of jadx

  • More comprehensive decompilation capabilities, including full Java source code reconstruction
  • Active development with frequent updates and bug fixes
  • Supports both GUI and command-line interfaces for flexibility

Cons of jadx

  • May be more complex to use for beginners compared to ClassyShark's simpler interface
  • Potentially slower performance when decompiling large APKs or complex applications

Code comparison

ClassyShark (viewing APK contents):

ClassySharkAndroid.launch(context, apkPath);

jadx (decompiling APK):

JadxArgs args = new JadxArgs();
args.setInputFile(new File(apkPath));
args.setOutDir(new File(outputDir));
JadxDecompiler jadx = new JadxDecompiler(args);
jadx.load();
jadx.save();

ClassyShark focuses on quick analysis and viewing of APK contents, while jadx provides more in-depth decompilation capabilities. ClassyShark is easier to use for basic APK inspection, but jadx offers more advanced features for thorough code analysis and reconstruction.

12,202

Tools to work with android .dex and java .class files

Pros of dex2jar

  • Specialized tool for converting DEX to JAR files
  • Lightweight and focused on a specific task
  • Supports command-line usage for easy integration into scripts

Cons of dex2jar

  • Limited functionality compared to ClassyShark's broader feature set
  • Less actively maintained, with fewer recent updates
  • Lacks a graphical user interface for easier analysis

Code comparison

dex2jar:

d2j-dex2jar.sh classes.dex

ClassyShark:

java -jar ClassyShark.jar -open classes.dex

Summary

dex2jar is a specialized tool for converting DEX files to JAR format, making it useful for specific reverse engineering tasks. It's lightweight and can be easily integrated into command-line workflows. However, it lacks the broader feature set and analysis capabilities of ClassyShark.

ClassyShark, on the other hand, offers a more comprehensive suite of tools for analyzing Android APKs, including a graphical user interface and support for various file formats. It provides a more user-friendly experience for developers and security researchers who need to inspect and analyze Android applications.

While dex2jar excels at its specific task, ClassyShark offers a more versatile and feature-rich solution for Android app analysis. The choice between the two depends on the specific needs of the user and the complexity of the analysis required.

6,287

smali/baksmali

Pros of smali

  • More focused on low-level bytecode manipulation and analysis
  • Provides a complete assembler/disassembler for Android's dex format
  • Better suited for advanced reverse engineering and malware analysis

Cons of smali

  • Steeper learning curve due to its low-level nature
  • Less user-friendly interface compared to ClassyShark's GUI
  • Limited to dex/smali format, while ClassyShark supports multiple file types

Code Comparison

smali:

.method public onCreate(Landroid/os/Bundle;)V
    .locals 1
    invoke-super {p0, p1}, Landroid/app/Activity;->onCreate(Landroid/os/Bundle;)V
    const v0, 0x7f030001
    invoke-virtual {p0, v0}, Lcom/example/MyActivity;->setContentView(I)V
    return-void
.end method

ClassyShark (output format):

Class: com.example.MyActivity
Superclass: android.app.Activity
Methods:
  public void onCreate(android.os.Bundle)
    0: invoke-super {p0, p1}, Landroid/app/Activity;->onCreate(Landroid/os/Bundle;)V
    3: const v0, 0x7f030001
    6: invoke-virtual {p0, v0}, Lcom/example/MyActivity;->setContentView(I)V
    9: return-void

This comparison highlights the different approaches of smali and ClassyShark. While smali provides a more detailed, low-level view of the bytecode, ClassyShark offers a higher-level, more readable output that's easier for less experienced users to understand.

19,798

A tool for reverse engineering Android apk files

Pros of Apktool

  • More comprehensive APK manipulation capabilities, including disassembling and rebuilding
  • Better support for resource decoding and modification
  • Wider community support and regular updates

Cons of Apktool

  • Steeper learning curve for beginners
  • Slower processing speed for large APKs
  • Limited GUI options, primarily command-line based

Code Comparison

Apktool (decompiling an APK):

apktool d path/to/app.apk -o output_folder

ClassyShark (analyzing an APK):

java -jar ClassyShark.jar -open path/to/app.apk

While both tools work with APK files, their primary functions differ. Apktool focuses on decompiling and rebuilding APKs, making it suitable for in-depth modifications. ClassyShark, on the other hand, is primarily an APK analyzer and viewer, offering a more user-friendly interface for quick inspections.

Apktool is more powerful for developers who need to modify APK contents, while ClassyShark excels at providing a quick overview of an APK's structure and contents. The choice between the two depends on the specific requirements of the task at hand.

6,019

A bytecode optimizer for Android apps

Pros of Redex

  • Focuses on bytecode optimization and app size reduction
  • Provides more advanced optimization techniques like method inlining and class merging
  • Actively maintained with regular updates and improvements

Cons of Redex

  • Steeper learning curve and more complex setup process
  • May require more fine-tuning and configuration for optimal results
  • Primarily designed for Android apps, limiting its use cases

Code Comparison

ClassyShark (analyzing an APK):

ClassySharkAndroid shark = new ClassySharkAndroid();
shark.analyzeAPK("path/to/app.apk", true);

Redex (optimizing an APK):

redex input.apk -o output.apk --sign -s keystore.jks -a alias -p password

While ClassyShark focuses on APK analysis and reverse engineering, Redex is primarily an optimization tool. ClassyShark provides a user-friendly interface for inspecting APK contents, while Redex operates as a command-line tool for bytecode optimization. ClassyShark is more suitable for developers and security researchers looking to analyze APKs, whereas Redex is better suited for optimizing Android app performance and reducing app size.

A utility for doing compile or runtime code generation targeting Android's Dalvik VM

Pros of dexmaker

  • Focused on runtime code generation for Android
  • Useful for mocking and testing Android applications
  • Actively maintained with recent updates

Cons of dexmaker

  • Limited scope compared to ClassyShark's broader analysis capabilities
  • Requires more setup and integration for specific use cases
  • May have a steeper learning curve for beginners

Code Comparison

ClassyShark (analyzing APK contents):

ClassySharkAndroid.analyze(apkFile);

dexmaker (generating a mock class):

Class<?> mockClass = new DexMaker()
    .declare(TypeId.get("LMockClass;"), "MockClass.generated", Modifier.PUBLIC, TypeId.OBJECT)
    .generate();

Key Differences

  • Purpose: ClassyShark is an APK analysis tool, while dexmaker is a runtime code generation library
  • Use cases: ClassyShark is used for reverse engineering and security analysis, dexmaker for testing and mocking
  • User base: ClassyShark caters to a wider audience including developers and security researchers, dexmaker is primarily for Android developers working on unit tests

Conclusion

While both projects are related to Android development, they serve different purposes. ClassyShark provides a comprehensive APK analysis tool, whereas dexmaker offers runtime code generation capabilities for testing and mocking. The choice between them depends on the specific needs of the developer or researcher.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

ClassyShark

Introduction

alt text

ClassyShark is a standalone binary inspection tool for Android developers. It can reliably browse any Android executable and show important info such as class interfaces and members, dex counts and dependencies. ClassyShark supports multiple formats including libraries (.dex, .aar, .so), executables (.apk, .jar, .class) and all Android binary XMLs: AndroidManifest, resources, layouts etc.

Useful links

Download

To run, grab the latest JAR and run java -jar ClassyShark.jar.

Export data in text format

  • Exporter
  • API finder :construction: work in progress

Develop

  1. Clone the repo
  2. Open in your favorite IDE/editor
  3. Build options:

Arch Linux

If you're running Arch Linux you can install the latest prebuilt jar from the AUR.

Dependencies

Support

If you've found an error, please file an issue:

https://github.com/google/android-classyshark/issues

Patches are encouraged, and may be submitted by forking this project and submitting a pull request through GitHub.

License

Copyright 2020 Google, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.