Comments (10)
I add a log into the com.topjohnwu.superuser.internal.StreamGobbler.OUT#call
method to dump read lines and here is the result:
Device API:
Device ABI: arm
I seem the com.topjohnwu.libsuexample.MainActivity.ExampleInitializer
load a script and it fails to load/parse.
You can see it runs some calls from the test_sync
shell method.
So the shell outputs error and seems to fail SuFile operations.
I also add a log into the com.topjohnwu.superuser.internal.StreamGobbler.ERR#call
and I got a lot of errors:
sh:
: not found
sh: shift
: not found
head: invalid number '1
'
sh: }
: not found
sh:
: not found
sh: {
: not found
sh: {
: not found
sh: {
: not found
sh: {
: not found
sh:
: not found
sh:
: not found
sh:
: not found
sh:
: not found
sh:
: not found
sh: }
: not found
sh:
: not found
sh: api_level_arch_detect
: not found
sh: }
: not found
sh:
: not found
sh: syntax error: unexpected word (expecting "do")
Is it working on your side?
EDIT: I just discover the whole example app is not working if I keep the bash.rc ExampleInitializer.
I never had test / output from in the main screen when pressing test buttons.
Removing it make the test feature work.
For the record, here is my configuration:
- Device: Pixel 2 / QQ3A.200705.002
- Magisk: 20.4 (patched boot from manager the fastboot flashed)
- Magisk Manager: 7.5.1
from libsu.
There is indeed a bug in ShellIO
that causes it to read incorrect data for readline (never tested that code so it got ignored from me), however I do not see the issue you experienced (cannot reproduce).
From StreamGobbler
's code, it is literally impossible to have it return null unless the shell itself is dead.
It might be a good idea to check null so at least it won't crash, but to be honest this should really never happen.
May you elaborate on more details?
from libsu.
@PerfectSlayer, I pushed multiple fixes to SuRandomAccessFile
so it behaves correctly, but as your problem does not lie in the I/O layer, do you have more details?
Basically, your shell is running into a state that should never happen.
from libsu.
I just push a branch issue-sufile https://github.com/PerfectSlayer/libsu/commits/issue-sufile into my fork with a modified sample app.
I update the two first buttons to start two tests:
- The first using java.io File: working
- The second using SuFile: failing
You should be able to reproduce with it. Let me know if you still can't trigger the NPE.
from libsu.
I keep narrowing down my issue but even simple tests give me strange results:
SuFile file = new SuFile("/init.rc");
Log.e("TEST", "File exists: "+file.exists());
It reply false, the file does not exit. I tried with some other (present) files without success.
Do you have the same behavior?
In the mean time, I try some StreamGlobber improvements #60
from libsu.
Your root shell is completely broken for some reason
from libsu.
I seem the
com.topjohnwu.libsuexample.MainActivity.ExampleInitializer
load a script and it fails to load/parse.
Shell.Initializer
seems to throw a InterruptedIOException
if it contains a script that has outputs.
from libsu.
@PerfectSlayer I am 99.999% sure this is not something that libsu
can fix, rather there are some incompatibilities with the shell script and your shell (for some weird reason).
I have a very plausible theory: are you using a Windows machine that checks out the shell file in CRLF rather than LF?
The exact same setup is used in the Magisk app, and if that app is working fine, then there is no issue in the code itself.
from libsu.
@PerfectSlayer this shall prevent it from happening again... 1097e35
from libsu.
Thanks for the fix, it should do the trick!
There is another issue with you build script when building on Windows, I will make an issue to address it.
from libsu.
Related Issues (20)
- Question - File copy support in io/nio module HOT 5
- Permission denial on Android 7.1- HOT 4
- Unable to get background running information HOT 1
- ANR when opening a file whose name contains single quotes
- Request: have a fork that calls the commands via Shizuku HOT 13
- The jni layer cannot get su correctly HOT 3
- [FR] add ROOT_MOUNT_MASTER feature check to the `example` HOT 1
- Service connect from\to RootService HOT 2
- SuFile.isDirectory() can throw NoShellException (and shouldn't) HOT 4
- Missing Proguard / R8 Config causes crashes HOT 4
- Hey
- RootService seems not working with debug mode ? HOT 1
- Provide settings without debugging RootService
- RootService failed with low version magisk HOT 1
- Add custom logger
- InvocationTargetException HOT 1
- "No such file or directory" when opening file through shell HOT 3
- Version 5.0.4 not work for Virtual Machine like VMOS and VPhoneGaga, please check and fix it HOT 3
- RootService: SQLiteDatabase.openDatabase makes it crash HOT 3
- How do I transfer to Android tablet
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libsu.