Giter Site home page Giter Site logo

Comments (10)

badabing2005 avatar badabing2005 commented on June 12, 2024

That file gets created by PF to launch Terminal and then it gets deleted.
See

PixelFlasher/phone.py

Lines 3306 to 3312 in 808fca5

elif sys.platform.startswith("darwin"):
script_file = tempfile.NamedTemporaryFile(delete=False, suffix='.sh')
script_file.write(f'#!/bin/bash\n{theCmd}'.encode('utf-8'))
script_file.close()
os.chmod(script_file.name, 0o755)
subprocess.Popen(['osascript', '-e', f'tell application "Terminal" to do script "{script_file.name}"'], start_new_session=True, env=get_env_variables())
os.remove(script_file.name)

I can't tell you more without seeing support file.

from pixelflasher.

knutlegrand avatar knutlegrand commented on June 12, 2024

Here is the support file
support_2024-04-05_11-06-28.zip

And here is the terminal output:

Last login: Fri Apr 5 11:06:06 on ttys000
/var/folders/zt/0pbp62dn5w16cr6j2p6d2kvc0000gp/T/tmpkn3j57sz.sh
REDACTED ~ % /var/folders/zt/0pbp62dn5w16cr6j2p6d2kvc0000gp/T/tmpkn3j57sz.sh
zsh: no such file or directory: /var/folders/zt/0pbp62dn5w16cr6j2p6d2kvc0000gp/T/tmpkn3j57sz.sh

Please note that directory /var/folders/zt/0pbp62dn5w16cr6j2p6d2kvc0000gp/T exists

from pixelflasher.

badabing2005 avatar badabing2005 commented on June 12, 2024

Sorry for not mentioning earlier, enabling debug output would help greatly.
image

Please note that directory /var/folders/zt/0pbp62dn5w16cr6j2p6d2kvc0000gp/T exists

That's because by the time you try to get to it, PixelFlasher would have already deleted it.
See line 3312 from the previous post.

Here's how that's working.
The program first creates a file in the temp folder, with some random name.
let's call it test.sh for illustration
and if we would use the same path as yours it would be:
/var/folders/zt/0pbp62dn5w16cr6j2p6d2kvc0000gp/T/test.sh
the contents of that file is:

#!/bin/bash
/Users/REDACTED/Library/Android/sdk/platform-tools/adb shell

Need to replace REDACTED with your actual user.

Then it calls that script with the following process

osascript -e 'tell application "Terminal" to do script "/var/folders/zt/0pbp62dn5w16cr6j2p6d2kvc0000gp/T/test.sh"

You can try this manually and capture the output and provide that.

Another one of interest would be the output of this command.

/Users/REDACTED/Library/Android/sdk/platform-tools/adb shell "su -c 'magisk --denylist ls'"

I'm suspecting that there is something in your environment variables that's causing an issue.
Could it be that you have another SDK in the path?

from pixelflasher.

knutlegrand avatar knutlegrand commented on June 12, 2024

Here is the support file (debug enabled).

support_2024-04-05_17-51-35.zip

I've checked the osascript command (by entering it manually in the terminal, after having created a test.sh file) -> it works :

REDACTED ~ % osascript -e 'tell application "Terminal" to do script "/var/folders/zt/0pbp62dn5w16cr6j2p6d2kvc0000gp/T/test.sh"'
tab 1 of window id 6268

Have also checked Magisk : no "denylist" option exists

Here is the result of printenv command:

REDACTED T % printenv
__CFBundleIdentifier=com.apple.Terminal
TMPDIR=/var/folders/zt/0pbp62dn5w16cr6j2p6d2kvc0000gp/T/
XPC_FLAGS=0x0
TERM=xterm-256color
DISPLAY=/private/tmp/com.apple.launchd.IKnPmtm1Ek/org.xquartz:0
SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.vuW5LWJzqr/Listeners
XPC_SERVICE_NAME=0
TERM_PROGRAM=Apple_Terminal
TERM_PROGRAM_VERSION=445.1
TERM_SESSION_ID=87116460-335A-4C20-8CCF-6232D5B84945
SHELL=/bin/zsh
HOME=/Users/REDACTED
LOGNAME=REDACTED
USER=REDACTED
PATH=/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/VMware Fusion.app/Contents/Public:/opt/X11/bin:/Library/Apple/usr/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Applications/Wireshark.app/Contents/MacOS
SHLVL=1
PWD=/var/folders/zt/0pbp62dn5w16cr6j2p6d2kvc0000gp/T
OLDPWD=/Users/REDACTED
LANG=fr_BE.UTF-8
_=/usr/bin/printenv

from pixelflasher.

badabing2005 avatar badabing2005 commented on June 12, 2024

Please give this build a try.
https://github.com/badabing2005/PixelFlasher/actions/runs/8582033073

from pixelflasher.

knutlegrand avatar knutlegrand commented on June 12, 2024

Have downloaded proposed build, but just got "Contents" directory
Have checked v 6.9.1.2 --> still not working

from pixelflasher.

badabing2005 avatar badabing2005 commented on June 12, 2024

I can't reproduce this, so I'm going to create a build with extra logging to see if we can get more details on what's going on, I'll also add extra debug message for your other ticket at the same time.
Stay tuned, I'll let you know when it's ready.

from pixelflasher.

badabing2005 avatar badabing2005 commented on June 12, 2024

Just to be certain, you did get a prompt like this and selected OK, right?
image

from pixelflasher.

knutlegrand avatar knutlegrand commented on June 12, 2024

I don't remember, but probably yes. But your question gave me the idea to reset Accessibility pref (by deleting some system database files) to see what happens next. It works !
Were the pref files corrupted or did I click on "Don't allow" by mistake ? Nobody knows but it fixed the problem related to ADB Shell. Thx

from pixelflasher.

badabing2005 avatar badabing2005 commented on June 12, 2024

Thanks, glad it worked.
To be honest, It's hard to tell if it was a corruption or accidental "Don't allow"
I wonder if there was a possible way to change the "Don't allow" to "Allow" after the fact instead of resetting Accessibility.

from pixelflasher.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.