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)
- How do I transfer to Android tablet
- Crashing in onInit() HOT 4
- Remove ROOT_MOUNT_MASTER status HOT 1
- How do I simulate Control + C for a process HOT 3
- 使用360加固后无法绑定RootService HOT 7
- Doesn't support targetSdk>31? HOT 6
- LIBSU: java.io.InterruptedIOException HOT 2
- Access MainActivity HOT 5
- Refuses to work even though it has root. HOT 1
- LIBRARY REFUSES to access files. HOT 2
- 建议 HOT 2
- !
- [Security] Repository is vulnerable to MavenGate
- StrictMode violation: reading files from the disk in the main thread
- 希望能动态设置超时 HOT 1
- Apps using libsu do not work on root solutions like APatch. HOT 5
- NoSuchMethodException on Android 5.1.1 HOT 2
- . HOT 1
- Worst Documentation HOT 1
- System resources broken on Samsung too HOT 1
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.