jhonathanc / ps3netsrv-android

Android ps3netsrv
Other
25 stars 4 forks source link

SD Card/USB permission browser missing. #12

Closed VinnyRadev closed 1 year ago

VinnyRadev commented 1 year ago

on newer Android version storage permission to SD card was changed. Is it possible for the app to support that ?

what I manage to find on the topic. https://www.digitalocean.com/community/tutorials/android-external-storage-read-write-save-file

VinnyRadev commented 1 year ago

currently the path can be typed ,but scan do not find any iso,bin etc. while in internal storage it does. Thank you for your amazing work and outstanding effort.

jhonathanc commented 1 year ago

Sure. I'll check how to fix it.

jhonathanc commented 1 year ago

Probably it is the same problem of this issue: https://github.com/jhonathanc/ps3netsrv-android/issues/2

VinnyRadev commented 1 year ago

All isos are tested and verified in Ps3netsrv, app works When same files are moved to internal storage , but not with sd card as the external storage browser do not open to grant read write permissions

VinnyRadev commented 1 year ago

https://www.programmersought.com/article/5552552850/ more information related to the android change in Android ver 9

Also from web gui when isos on sd/usb is select the error that show up on PS3 is "Connect storage media at the save destination"

jhonathanc commented 1 year ago

Could you please try this build? https://github.com/jhonathanc/ps3netsrv-android/suites/12353597099/artifacts/655821337

VinnyRadev commented 1 year ago

Pop up to choose sd/usb is there now. Thank you! But from web gui when iso on sd/usb is select the error that show up on PS3 is "Connect storage media at the save destination". It may be another problem and not only permissions.

jhonathanc commented 1 year ago

I will investigate what's happening. I'll buy a sd card tomorrow to investigate and fix this.

VinnyRadev commented 1 year ago

If I can test or gather any logs for you let me know.

jhonathanc commented 1 year ago

Does this message shows even with an usb storage device plugged on PS3?

VinnyRadev commented 1 year ago

When the usb is directly plugged to the PS3, its not detected by sman or multiman. As I know PS3 support FAT32 only for USB, while Android use ext4 (probably), but for sure its not FAT32 (I have larger files than 4gb)

jhonathanc commented 1 year ago

Can you please send a print screen or photo of the error?

VinnyRadev commented 1 year ago

IMG_20230420_025518

jhonathanc commented 1 year ago

Can you please try to mount the iso using webman mod? (scanning games, refreshing xmb and selecting a game on webman mod games menu). Probably will happen some other error on Android side...

VinnyRadev commented 1 year ago

Wman mod 1.47.44 no option to enter net hosts in setup.ps3... When the usb is plugged in it's still not visible.

VinnyRadev commented 1 year ago

Current partition is exFAT.

Ill format this 128 sd card as ntfs and ill see how it behave and update here. Probably on Friday.

jhonathanc commented 1 year ago

Don't format, it's not a sd card problem. I will check it tomorrow, as soon as the sd card arrive. The format (ext4, fat32, ntfs...) used by Android doesn't matter to ps3, as it reads the files on Android device.

jhonathanc commented 1 year ago

I did a video using webman mod: https://youtu.be/AoolAlw5PMw

jhonathanc commented 1 year ago

Wait, I found the problem. It's not a permission problem only, it's how the Android SAF works. I'll have to rewrite the way the files are read, because I'll not be able to use a RandomAccessFile to get file sectors since the SAF only delivers "relative paths" from the selected location and also, it delivers only a InputStream, without the "seek feature" that exists on RandomAccessFile.

jhonathanc commented 1 year ago

I'm working on a fix for it, but I had to separate the java version from this project because I'll have to put Android classes inside the server, a thing I was trying to avoid because it would lead to more maintenance, but without doing this, the Android project cannot evolve. So, I split the code in two and prepared a new repository, only for the Java version:

https://github.com/jhonathanc/ps3netsrv-java

Edit: Sorry, I closed the issue unconsciously. I already reopened it.

VinnyRadev commented 1 year ago

You are amazing! Thank you

jhonathanc commented 1 year ago

Hi, could you please try this build: https://github.com/jhonathanc/ps3netsrv-android/suites/12663387096/artifacts/678821361

?

It's just reading ISOs, so you will not be able to use CreateDirCommand, CreateFileCommand and WriteFileCommand yet. I also have to improve the code quality, because I wrote my own "RandomAccessFile" and it has a lot of room for improvements.

jhonathanc commented 1 year ago

@aldostools, to make the changes to be able to read an external storage, I had to drop support for Android < 5, so all devices running Kitkat and older versions, will not work. There is a way to make this work on older devices, but I don't know if the work will worth it. If I create a poll on twitter to ask people on what version of Android they are running it, would you boost and engage it? (I don't have a lot of followers there).

aldostools commented 1 year ago

@aldostools, to make the changes to be able to read an external storage, I had to drop support for Android < 5, so all devices running Kitkat and older versions, will not work. There is a way to make this work on older devices, but I don't know if the work will worth it. If I create a poll on twitter to ask people on what version of Android they are running it, would you boost and engage it? (I don't have a lot of followers there).

Yes I can retweet your poll. IMHO it doesn't worth to waste time supporting Kitkat and older versions. The market share of Android 4 is 0.5%. Even if you exclude Android 5 and 6, you would be supporting approximately 96.5% of the phones & tablets.

image Source: https://www.appbrain.com/stats/top-android-sdk-versions

jhonathanc commented 1 year ago

@aldostools, to make the changes to be able to read an external storage, I had to drop support for Android < 5, so all devices running Kitkat and older versions, will not work. There is a way to make this work on older devices, but I don't know if the work will worth it. If I create a poll on twitter to ask people on what version of Android they are running it, would you boost and engage it? (I don't have a lot of followers there).

Yes I can retweet your poll. IMHO it doesn't worth to waste time supporting Kitkat and older versions. The market share of Android 4 is 0.5%. Even if you exclude Android 5 and 6, you would be supporting approximately 96.5% of the phones & tablets.

image Source: https://www.appbrain.com/stats/top-android-sdk-versions

It's because I think most people could use that old "TV box" with Android 4.x that is getting dust on the shelf. I created the poll, I'll \@ you there

aldostools commented 1 year ago

There is always the option of use an Amazon Fire TV Stick. The 1st Gen (2014) has Fire OS 5 based on Android Level 22 (Android 5.1 Lollipop).

It's your decision if you want to dedicate time to support these old TVs.

bucanero commented 1 year ago

I think that supporting 5+ (like the first Fire tv stick) is good for almost everyone

Perhaps you can later build a "LITE" version just for 4.x devices if you want, with only the bare minimum

VinnyRadev commented 1 year ago

Hi, could you please try this build: https://github.com/jhonathanc/ps3netsrv-android/suites/12663387096/artifacts/678821361

?

It's just reading ISOs, so you will not be able to use CreateDirCommand, CreateFileCommand and WriteFileCommand yet. I also have to improve the code quality, because I wrote my own "RandomAccessFile" and it has a lot of room for improvements.

Tested and toast error showed up repeating itself very fast. This happen during game scan in webmam as you showed me in the video.

Another change is that the folder path cannot be entered any more. Its pre-defined with the selection promp entry from permission grant.

VinnyRadev commented 1 year ago

Screenshot_20230505_024600_com huawei photos

jhonathanc commented 1 year ago

Weird. I fixed some errors on this today. Are you able to check it?

https://github.com/jhonathanc/ps3netsrv-android/suites/12680010065/artifacts/680070261

VinnyRadev commented 1 year ago

Console stuck after starting a game. Games do mount.

Games where displayed in S Launcher inside webman. Webman itself didn't displayed them.

Toast error gone.

jhonathanc commented 1 year ago

I'll have to fix the implementation of the "custom RandomAccessFile". The performance is horrible yet and probably this is the cause of the freeze you are facing :(

VinnyRadev commented 1 year ago

After reboot webman do show the games in the menu. Ill also test with the smallest game I have.

VinnyRadev commented 1 year ago

Its strange that the path is different after selection.

You can see in the SS above %3A instead of / or :

jhonathanc commented 1 year ago

Its strange that the path is different after selection.

You can see in the SS above %3A instead of / or :

It's because the path is encoded. I already fixed how it's displayed, but I'm trying to handle the performance problem before ask to you to test again.

This version shows the path correctly, but it's doesn't fix the performance problem yet: https://github.com/jhonathanc/ps3netsrv-android/suites/12688422440/artifacts/680689763

Screenshot_2023-05-04-21-40-51-563_com jhonju ps3netsrv

VinnyRadev commented 1 year ago

PSX mount and start.

VinnyRadev commented 1 year ago

PS3 still fail to start, but do mount.

The smallest I have is GTA San Andreaa 2.4GB I think it was.

VinnyRadev commented 1 year ago

PSX CTR playable.

16832488008951834564866393337142

VinnyRadev commented 1 year ago

When phone screen turned off and lock itself it did kill the server app, and so the game stuck on the next loading.

But this is a issue on its own.

jhonathanc commented 1 year ago

I think I finally got it:

https://github.com/jhonathanc/ps3netsrv-android/suites/12690383835/artifacts/680831344

I tested it with Dark Sector (PS3) and Crash 2 (PSX). The main problem was the fileDescriptor, that became invalid (I suspect it occurs because garbage collector was turning that invalid). So I create a new fileDescriptor every time I have to read the file (not an elegant solution, but it worked).

VinnyRadev commented 1 year ago

PS3 games do mount and start. Tested NFS Most Wanted flawless playback.

VinnyRadev commented 1 year ago

The issue with the screen lock no longer happen.

jhonathanc commented 1 year ago

@VinnyRadev, I added support for old Android devices (versions >= 4.0.1). Could you please test it?

https://github.com/jhonathanc/ps3netsrv-android/suites/12714199880/artifacts/682643602

If everything is fine I will close this issue, merge the branch I created to fix it, and release a new version with the improvements.

VinnyRadev commented 1 year ago

will test and provide feedback tomorrow.

aldostools commented 1 year ago

@jhonathanc the approach about a read-only edition of ps3netsrv is a good idea. Only multiMAN's file manager uses the write/delete commands. webMAN MOD or sMAN access ps3netsrv in read-only mode.

Maybe you could offer the full read-write edition as a download inside the APK as an option.

VinnyRadev commented 1 year ago

@jhonathanc no issues with the last release.

jhonathanc commented 1 year ago

Nice. Thank you very much. Merged into main branch:

https://github.com/jhonathanc/ps3netsrv-android/commit/90e489486099a952709ddb89682a0cabfe109c3f