pystardust / ani-cli

A cli tool to browse and play anime
GNU General Public License v3.0
7.86k stars 540 forks source link

Player checking in Android via `pm list packages` #1416

Open Rem01Gaming opened 3 weeks ago

Rem01Gaming commented 3 weeks ago

Is your feature request related to a problem? Please describe. There is a way to check players in Android, we can retrieve package list from command pm list packages and then check if MPV or VLC is installed.

Describe the solution you'd like Example of checking installed player in Android:

if pm list packages | grep is.xyz.mpv >/dev/null; then
    echo "MPV Android installed"
fi

if pm list packages | grep org.videolan.vlc >/dev/null; then
    echo "VLC Android installed"
fi

Additional context Instead of completely disabling the player checking on Android, this is much more better solution.

CoolnsX commented 3 weeks ago

You think I haven't tried that? I know that it won't work. Screenshot_20240908-190403

Rem01Gaming commented 3 weeks ago

Hmm try /system/bin/pm list packages

CoolnsX commented 3 weeks ago

Interesting, it works now, earlier it used to not work. The same binary path u mentioned.

CoolnsX commented 3 weeks ago

I have Android 14 btw

Rem01Gaming commented 3 weeks ago

I have Android 14 btw

Android 14 is a bit weird on some case like this In case it still failing, we can disables the player checking only if the pm command returns an error.

CoolnsX commented 3 weeks ago

Ye, the first pm is from termux. And this one is from system.

Rem01Gaming commented 3 weeks ago

Ye, the first pm is from termux. And this one is from system.

Screenshot_20240908-204926_Termux_Monet~2 It's actually the same pm from system, just how to call it that diff

CoolnsX commented 3 weeks ago

That calling via termux's pm is not working properly.

Rem01Gaming commented 3 weeks ago

Ye