Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hello Author: execute permissions issue app_process #902

Closed
chenyunbbs opened this issue Nov 3, 2019 · 12 comments
Closed

Hello Author: execute permissions issue app_process #902

chenyunbbs opened this issue Nov 3, 2019 · 12 comments

Comments

@chenyunbbs
Copy link

When I execute app_process without adb root or [Aborted] error, I can execute successfully with adb root permission. Code:
package shellService;
Public class testbbs {
Public void a(){
System.out.println("123ssd5e5dd22dd");
}
}
Does the adb shell have no permissions for System.out.println? consult

@rom1v
Copy link
Collaborator

rom1v commented Nov 3, 2019

Please share the exact code, the command to compile and the exact app_process command you executed.

@chenyunbbs
Copy link
Author

chenyunbbs commented Nov 3, 2019

请分享确切的代码,要编译的命令以及app_process您执行的确切命令。

Please share the exact code, the command to compile and the exact app_process command you executed.

I am apk file compiled by android studio, get the classes.dex inside by decompressing apk
file
Specific steps:
1.adb connect 192.168.1.5:5555
2.adb push classes.dex /data/local/tmp
3.adb shell app_process -Djava.class.path=/data/local/tmp/classes.dex /sdcard shellService.Main
4.com returned messages Aborted

If I have executed adb root, it will execute successfully.
1.adb shell app_process -Djava.class.path=/data/local/tmp/classes.dex /sdcard shellService.Main
.com returned messages ["hello"]

code:
package shellService;

public class testbbs {
public void a(){
System.out.println("hello");
}
}

package shellService;

public class Main {
public static void main(String[] args){
testbbs demo=new testbbs();
demo.a();
}
}

@chenyunbbs
Copy link
Author

请分享正确的代码,要编译的命令以及app_process您执行的初始化命令。

请分享确切的代码,要编译的命令以及app_process您执行的确切命令。

我是由android studio编译的apk文件,通过解压缩apk
文件进入classes.dex内部。
具体步骤:
1.adb连接192.168.1.5:5555
2.adb推送classes.dex / data / local / tmp
3.adb shell app_process- Djava.class.path = / data / local / tmp / classes.dex / sdcard shellService.Main
4.com返回的消息已中止

如果我执行了adb root,它将成功执行。
1.adb shell app_process -Djava.class.path = / data / local / tmp / classes.dex / sdcard shellService.Main
.com返回的消息[“ hello”]

代码:
package ShellService;

公共类testbbs {
public void a(){
System.out.println(“ hello”);
}
}

apply plugin: 'com.android.application'

apply plugin: 'kotlin-android'

apply plugin: 'kotlin-android-extensions'

android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
defaultConfig {
applicationId "com.example.shellserver"
minSdkVersion 15
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.core:core-ktx:1.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}

@chenyunbbs
Copy link
Author

Please share the exact code, the command to compile and the exact app_process command you executed.

I am apk file compiled by android studio, get the classes.dex inside by decompressing apk
file
Specific steps:
1.adb connect 192.168.1.5:5555
2.adb push classes.dex /data/local/tmp
3.adb shell app_process -Djava.class.path=/data/local/tmp/classes.dex /sdcard shellService.Main
4.com returned messages Aborted

If I have executed adb root, it will execute successfully.
1.adb shell app_process -Djava.class.path=/data/local/tmp/classes.dex /sdcard shellService.Main
.com returned messages ["hello"]

code:
package shellService;

public class testbbs {
public void a(){
System.out.println("hello");
}
}

package shellService;

public class Main {
public static void main(String[] args){
testbbs demo=new testbbs();
demo.a();
}
}

@rom1v
Copy link
Collaborator

rom1v commented Nov 4, 2019

Please use ``` for code blocks.

Check the right on your /data/local/tmp directory. Can you list its content:

adb shell ls /data/local/tmp

?

@chenyunbbs
Copy link
Author

Please use ``` for code blocks.

Check the right on your /data/local/tmp directory. Can you list its content:

adb shell ls /data/local/tmp

?

It can be read out. No problem. There are some DEX files in it
I checked the log file:

11-04 20:48:39.587 E/System ( 6765): Unable to load dex file: /data/local/tmp/classes.dex

11-04 20:48:39.587 E/System ( 6765): java.io.IOException: unable to open DEX file

11-04 20:48:39.587 E/System ( 6765): at dalvik.system.DexFile.openDexFileNative(Native Method)

11-04 20:48:39.587 E/System ( 6765): at dalvik.system.DexFile.openDexFile(DexFile.java:296)

11-04 20:48:39.587 E/System ( 6765): at dalvik.system.DexFile.(DexFile.java:80)

11-04 20:48:39.587 E/System ( 6765): at dalvik.system.DexFile.(DexFile.java:59)

11-04 20:48:39.587 E/System ( 6765): at dalvik.system.DexPathList.loadDexFile(DexPathList.java:263)

11-04 20:48:39.587 E/System ( 6765): at dalvik.system.DexPathList.makeDexElements(DexPathList.java:221)

11-04 20:48:39.587 E/System ( 6765): at dalvik.system.DexPathList.(DexPathList.java:112)

11-04 20:48:39.587 E/System ( 6765): at dalvik.system.BaseDexClassLoader.(BaseDexClassLoader.java:48)

11-04 20:48:39.587 E/System ( 6765): at dalvik.system.PathClassLoader.(PathClassLoader.java:38)

11-04 20:48:39.587 E/System ( 6765): at java.lang.ClassLoader.createSystemClassLoader(ClassLoader.java:116)

11-04 20:48:39.587 E/System ( 6765): at java.lang.ClassLoader.access$000(ClassLoader.java:65)

11-04 20:48:39.587 E/System ( 6765): at java.lang.ClassLoader$SystemClassLoader.(ClassLoader.java:81)

11-04 20:48:39.587 E/System ( 6765): at java.lang.ClassLoader.getSystemClassLoader(ClassLoader.java:125)

11-04 20:48:39.587 E/System ( 6765): at dalvik.system.NativeStart.main(Native Method)

11-04 20:48:39.597 E/appproc ( 6765): ERROR: could not find class 'shellService.Main'

11-04 20:48:39.597 E/dalvikvm( 6765): JNI posting fatal error: Native registration unable to find class 'android/debug/JNITest'; aborting...

11-04 20:48:39.597 E/dalvikvm( 6765): VM aborting

11-04 20:48:39.597 F/libc ( 6765): Fatal signal 6 (SIGABRT) at 0x00001a6d (code=-6), thread 6765 (app_process)

11-04 20:48:39.967 E/octvm_klo( 2388): get package info failed for app_process

@chenyunbbs
Copy link
Author

请对代码块使用```。
检查/data/local/tmp目录上的权限。您能否列出其内容:

adb shell ls /data/local/tmp

可以读出来。没问题。
我检查了日志文件,其中有一些DEX 文件:

11/04 20:48:39.587 E / System(6765):无法加载dex文件:/data/local/tmp/classes.dex

11-04 20:48:39.587 E / System(6765):java.io.IOException:无法打开DEX文件

11-04 20:48:39.587 E / System(6765):在dalvik.system.DexFile.openDexFileNative(本机方法)

11/04 20:48:39.587 E / System(6765):在dalvik.system.DexFile.openDexFile(DexFile.java:296)

11/04 20:48:39.587 E / System(6765):在dalvik.system.DexFile。(DexFile.java:80)

11/04 20:48:39.587 E / System(6765):在dalvik.system.DexFile。(DexFile.java:59)

11/04 20:48:39.587 E / System(6765):在dalvik.system.DexPathList.loadDexFile(DexPathList.java:263)

11/04 20:48:39.587 E / System(6765):在dalvik.system.DexPathList.makeDexElements(DexPathList.java:221)

11/04 20:48:39.587 E / System(6765):在dalvik.system.DexPathList。(DexPathList.java:112)

11/04 20:48:39.587 E / System(6765):在dalvik.system.BaseDexClassLoader。(BaseDexClassLoader.java:48)

11-04 20:48:39.587 E / System(6765):在dalvik.system.PathClassLoader。(PathClassLoader.java:38)

11-04 20:48:39.587 E / System(6765):在java.lang.ClassLoader.createSystemClassLoader(ClassLoader.java:116)

11-04 20:48:39.587 E / System(6765):at java.lang.ClassLoader.access $ 000(ClassLoader.java:65)

11-04 20:48:39.587 E / System(6765):位于java.lang.ClassLoader $ SystemClassLoader。(ClassLoader.java:81)

11-04 20:48:39.587 E / System(6765):位于java.lang.ClassLoader.getSystemClassLoader(ClassLoader.java:125)

11/04 20:48:39.587 E / System(6765):在dalvik.system.NativeStart.main(本机方法)

11-04 20:48:39.597 E / appproc(6765):错误:找不到类'shellService.Main'

11-04 20:48:39.597 E / dalvikvm(6765):JNI发布致命错误:本机注册无法找到类'android / debug / JNITest'; 流产...

11-04 20:48:39.597 E / dalvikvm(6765):VM中止

11-04 20:48:39.597 F / libc(6765):致命信号6(SIGABRT)位于0x00001a6d(代码= -6),线程6765(app_process)

11-04 20:48:39.967 E / octvm_klo(2388):获取app_process的软件包信息失败

Please use ``` for code blocks.

Check the right on your /data/local/tmp directory. Can you list its content:

adb shell ls /data/local/tmp

?

It can be read out. No problem. There are some DEX files in it
I checked the log file:

11-04 20:48:39.587 E/System ( 6765): Unable to load dex file: /data/local/tmp/classes.dex

11-04 20:48:39.587 E/System ( 6765): java.io.IOException: unable to open DEX file

11-04 20:48:39.587 E/System ( 6765): at dalvik.system.DexFile.openDexFileNative(Native Method)

11-04 20:48:39.587 E/System ( 6765): at dalvik.system.DexFile.openDexFile(DexFile.java:296)

11-04 20:48:39.587 E/System ( 6765): at dalvik.system.DexFile.(DexFile.java:80)

11-04 20:48:39.587 E/System ( 6765): at dalvik.system.DexFile.(DexFile.java:59)

11-04 20:48:39.587 E/System ( 6765): at dalvik.system.DexPathList.loadDexFile(DexPathList.java:263)

11-04 20:48:39.587 E/System ( 6765): at dalvik.system.DexPathList.makeDexElements(DexPathList.java:221)

11-04 20:48:39.587 E/System ( 6765): at dalvik.system.DexPathList.(DexPathList.java:112)

11-04 20:48:39.587 E/System ( 6765): at dalvik.system.BaseDexClassLoader.(BaseDexClassLoader.java:48)

11-04 20:48:39.587 E/System ( 6765): at dalvik.system.PathClassLoader.(PathClassLoader.java:38)

11-04 20:48:39.587 E/System ( 6765): at java.lang.ClassLoader.createSystemClassLoader(ClassLoader.java:116)

11-04 20:48:39.587 E/System ( 6765): at java.lang.ClassLoader.access$000(ClassLoader.java:65)

11-04 20:48:39.587 E/System ( 6765): at java.lang.ClassLoader$SystemClassLoader.(ClassLoader.java:81)

11-04 20:48:39.587 E/System ( 6765): at java.lang.ClassLoader.getSystemClassLoader(ClassLoader.java:125)

11-04 20:48:39.587 E/System ( 6765): at dalvik.system.NativeStart.main(Native Method)

11-04 20:48:39.597 E/appproc ( 6765): ERROR: could not find class 'shellService.Main'

11-04 20:48:39.597 E/dalvikvm( 6765): JNI posting fatal error: Native registration unable to find class 'android/debug/JNITest'; aborting...

11-04 20:48:39.597 E/dalvikvm( 6765): VM aborting

11-04 20:48:39.597 F/libc ( 6765): Fatal signal 6 (SIGABRT) at 0x00001a6d (code=-6), thread 6765 (app_process)

11-04 20:48:39.967 E/octvm_klo( 2388): get package info failed for app_process

@rom1v
Copy link
Collaborator

rom1v commented Nov 5, 2019

Btw, does scrcpy work on that device?

Please surround your code with ```

@chenyunbbs
Copy link
Author

Btw, does scrcpy work on that device?

Please surround your code with ```

scrcpy Execution unsuccessful
ERROR:
微信截图_20191105220145

Log:

11-05 21:55:25.413 E/dalvikvm( 6310): Dex cache directory isn't writable: /data/dalvik-cache

11-05 21:55:25.413 E/appproc ( 6310): ERROR: could not find class 'com.genymobile.scrcpy.Server'

11-05 21:55:25.413 E/dalvikvm( 6310): JNI posting fatal error: Native registration unable to find class 'android/debug/JNITest'; aborting...

11-05 21:55:25.423 E/dalvikvm( 6310): VM aborting

11-05 21:55:25.423 F/libc ( 6310): Fatal signal 6 (SIGABRT) at 0x000018a6 (code=-6), thread 6310 (app_process)

11-05 21:55:25.483 E/QCALOG ( 341): [MessageQ] ProcessNewMessage: [XTWiFi-PE] unknown deliver target [OS-Agent]

11-05 21:55:25.773 E/octvm_klo( 2509): get package info failed for app_process

@chenyunbbs
Copy link
Author

Btw, does scrcpy work on that device?

Please surround your code with ```

android version 4.4.4 version.sdk 19 This version is not allowed, right?

@rom1v
Copy link
Collaborator

rom1v commented Nov 5, 2019

android version 4.4.4

Ah, that's the problem!

You can workaround the Dex cache directory isn't writable: /data/dalvik-cache issue however, but scrcpy still won't work on Android 4. See #98 (comment)

@rom1v rom1v closed this as completed Nov 5, 2019
@chenyunbbs
Copy link
Author

android version 4.4.4

Ah, that's the problem!

You can workaround the Dex cache directory isn't writable: /data/dalvik-cache issue however, but scrcpy still won't work on Android 4. See #98 (comment)

Thank you very much for your reply. Can we be friends?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants