Java REPL on Android with BeanShell

Related tags

Kotlin BeeShell
Overview

BeeShell

Android CI status GitHub release License

BeeShell

Java REPL on Android with BeanShell.

Useful for quickly checking some framework API behavior, or calling Java APIs with the permissions of ADB shell.

This is not an officially supported Google product.

Preview

Google Play

Download APK

Built-ins

The application Context is available via the context variable in the global namespace.

An Activity instance is also available as activity when running with UI, and references to it in the global namespace will be cleared upon rotation to avoid memory leaks.

Other BeanShell built-ins are also available, though not guaranteed to work, e.g. Swing-based UI built-ins won't work on Android.

Running in ADB shell

Execute the following command in adb shell:

pm_path=`pm path me.zhanghai.android.beeshell` && apk_path=${pm_path#package:} && `dirname $apk_path`/lib/*/libbsh.so

Limitation

BeanShell was written for running on a desktop JVM instead of Android, and as a result class-related Java syntax may be unsupported in this app. Specifically, you cannot define new classes except for anonymous inner classes implementing an existing interface.

License

Copyright 2020 Google LLC

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

    https://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.
You might also like...
Greatly simplifies the complexities of Kotlin's reflection of Java

CatReflect 这是一个可以极大简化 Java 反射的复杂操作的工具,适用于 Kotlin & Java This is a tool that grea

Unofficial Actions on Google SDK for Kotlin and Java
Unofficial Actions on Google SDK for Kotlin and Java

Actions On Google Client Library This is a port of the official Node.js SDK to Kotlin. This can also be used from Java and any JVM language. Quick Fac

Theia - A Kotlin program used to analyze and discover backdoors in Minecraft Java 1.12.2 forge mods

Theia A Kotlin program used to analyse and discover backdoors in Minecraft Java

Write a Ghidra Extension without using Java or Eclipse!

Ghidra Extension in Kotlin using IntelliJ IDEA Write a Ghidra Extension without using Java or Eclipse! Setup Hit Use this template at the top of the r

A library for building Java only Zygisk/Riru modules.

A library for building Java only Zygisk/Riru modules.

A tool that can mock out an existing Appium session, supports both Java and Kotlin.

appium-mocker A tool that can mock out an existing Appium session, supports both Java and Kotlin. How to install latest appium-mocker Beta/Snapshots

A Java Virtual Machine written in Kotlin
A Java Virtual Machine written in Kotlin

jvm.kotlin A Java Virtual Machine written in Kotlin. Introduction jvm.kotlin is a toy JVM programmed in Kotlin. The main purpose of this project is le

⚙️ Extended gameplay mechanics and brand-new code foundations for Minecraft: Java Edition platforms

⚙️ foundation Extended gameplay mechanics and brand-new code foundations for Minecraft: Java Edition platforms. 🎏 Getting Started You can find inform

Android MVVM framework write in kotlin, develop Android has never been so fun.

KBinding 中文版 Android MVVM framework write in kotlin, base on anko, simple but powerful. It depends on my another project AutoAdapter(A library for sim

Comments
  • adb shell /lib/arm64/libbsh.so[2]: ../../bsh: not found

    adb shell /lib/arm64/libbsh.so[2]: ../../bsh: not found

    adb shell
    angler:/ $ pm_path=`pm path me.zhanghai.android.beeshell` && apk_path=${pm_path#package:} && `dirname $apk_path`/lib/*/libbsh.so
    /data/app/me.zhanghai.android.beeshell-nu3dAV-F-pmQgVe8CFzbfg==/lib/arm64/libbsh.so[2]: ../../bsh: not found
    
    
    question 
    opened by QGB 5
  • Package android does not belong to 2000

    Package android does not belong to 2000

    Target exception: java.lang.SecurityException: Package android does not belong to 2000
    
            at bsh.BSHMethodInvocation.eval(Unknown Source:117)
            at bsh.BSHPrimaryExpression.eval(Unknown Source:51)
            at bsh.BSHPrimaryExpression.eval(Unknown Source:1)
            at bsh.Interpreter.eval(Unknown Source:145)
            at bsh.Interpreter.eval(Unknown Source:34)
            at bsh.Interpreter.eval(Unknown Source:26)
            at b.a.a.a.y.a(Unknown Source:13)
            at me.zhanghai.android.beeshell.ShellMain.main(:6)
            at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
            at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:399)
    

    I think context.createPackageContext("com.android.shell", 0) can fix it

    opened by vvb2060 0
Releases(v1.0.1)
Owner
Hai Zhang
Hai Zhang
Cross-platform framework for building truly native mobile apps with Java or Kotlin. Write Once Run Anywhere support for iOS, Android, Desktop & Web.

Codename One - Cross Platform Native Apps with Java or Kotlin Codename One is a mobile first cross platform environment for Java and Kotlin developers

Codename One 1.4k Jan 9, 2023
StaticLog - super lightweight static logging for Kotlin, Java and Android

StaticLog StaticLog is a super lightweight logging library implemented in pure Kotlin (https://kotlinlang.org). It is designed to be used in Kotlin, J

Julian Pfeifer 28 Oct 3, 2022
Auto-generate the fastest possible Parcelable implementations for Java and Kotlin

This project is deprecated It will still be maintained, but no new features will be added. Please use Parcelize, as it is the official way of generati

Bradley Campbell 492 Nov 17, 2022
From Java to Kotlin Cheat Sheet

From Java to Kotlin Cheat Sheet Page: http://fabiomsr.github.io/from-java-to-kotlin/ Programmatically inspired from swift-is-like-go and visually insp

Fabio Santana 552 Dec 23, 2022
Transform java callback to kotlin suspend method.

Callback2Coroutines Transform Java callback to coroutines suspend method. 将传统Java callback 方法转换为kotlin中的suspend方法。 接入指南 根目录下加入jatpack的repository: allp

RainFool 14 May 25, 2021
A Kotlin compiler plugin that allows Java callers to pass in null for default parameters

kotlin-null-defaults (Compiler plugin) (Gradle Plugin) ( Currently pending approval) A Kotlin compiler plugin that allows Java callers to pass in null

Youssef Shoaib 7 Oct 14, 2022
This repository is part of a Uni-Project to write a complete Compiler for a subset of Java.

Compiler This repository is part of a Uni-Project to write a complete Compiler for a subset of Java. Features error recovery using context sensitive a

null 3 Jan 10, 2022
🔨 Template for easy hosting of your Java/Kotlin libraries on GitHub

?? kotlin-jvm-library-template Another template for easy hosting your Java/Kotlin libraries on GitHub. Features boilerplate for Kotlin/Java projects w

Viktor 0 Jan 7, 2022
Kotlin and Java API for generating .swift source files.

SwiftPoet SwiftPoet is a Kotlin and Java API for generating .swift source files. Source file generation can be useful when doing things such as annota

Outfox 232 Jan 2, 2023
Sample Code for fake Kotlin library written in Java

Jatlin このリポジトリは ブログ記事 のためのサンプルコードです。詳細は記事をご覧ください。 プロジェクト構成 :java-lib にKotlinに偽装したJavaファイルが含まれます。 :kotlin-lib は :java-lib をビルドしたJARファイルをKotlinから読み込んで実行

Takaki Hoshikawa 3 Dec 10, 2021