wagic icon indicating copy to clipboard operation
wagic copied to clipboard

samsung galaxy prime core and sdcard issues

Open zethfoxster opened this issue 8 years ago • 14 comments

there is no way to install resource to external, and no way to specify on wagic setting that we are running wagic in extsdcard.

is there any way we can please specify in setting.txt that we are in extsd. if you move the files manuelly it reinstalls the resources and completely ignore ext.

when you click the options button that hover on screen all the time (why?) even during games, it states "storage settings" where you are present with nothing as an option.

very very frustrating. every setting in wagic can be declared in setting.text...why is storage option an exception?

zethfoxster avatar May 26 '16 23:05 zethfoxster

I think the StorageOptions.java must be updated, in Android Gingerbread it looks for /system/etc/vold.fstab on the phone, but on Android 4+ (Mine is Android 5.0.2 Lollipop), that file doesn't exists so it doesn't populate the condition in this function:

private static void readVoldFile() { /* * Scan the /system/etc/vold.fstab file and look for lines like this: dev_mount sdcard /mnt/sdcard 1 /devices/platform/s3c-sdhci.0/mmc_host/mmc0 * * When one is found, split it into its elements and then pull out the path to the that mount point and add it to the arraylist */

    try
    {
        Scanner scanner = new Scanner(new File("/system/etc/vold.fstab"));
        while (scanner.hasNext())
        {
            String line = scanner.nextLine();
            if (line.startsWith("dev_mount"))
            {
                String[] lineElements = line.split(" ");
                lineElements[2] = lineElements[2].replaceAll(":.*$", "");
                mVold.add(lineElements[2]);
            }
        }
    } catch (FileNotFoundException fnfex)
    {
        // if vold.fstab doesn't exist we use the value gathered from the Environment
        Log.i(StorageOptions.class.getCanonicalName(), fnfex.getMessage() + ": assuming " + defaultMountPoint + " is the only mount point");
        mMounts.add(defaultMountPoint);
    } catch (Exception e)
    {
        Log.e(StorageOptions.class.getCanonicalName(), e.getMessage() + ": unknown exception while reading mounts file");
        mMounts.add(defaultMountPoint);
    }
}

kevlahnota avatar May 27 '16 02:05 kevlahnota

Been a while since I wrote that bit of code. But newer os for android will need a new way of finding the path for sdcards. It's not supported officially on android so each manfacturer may have a different way to find it

Sent from my iPhone

On May 26, 2016, at 7:12 PM, Anthony Calosa [email protected] wrote:

I think the StorageOptions.java must be updated, in Android Gingerbread it looks for /system/etc/vold.fstab on the phone, but on Android 4+ (Mine is Android 5.0.2 Lollipop), that file doesn't exists so it doesn't populate the condition in this function:

private static void readVoldFile() { /*

  • Scan the /system/etc/vold.fstab file and look for lines like this: dev_mount sdcard /mnt/sdcard 1 /devices/platform/s3c-sdhci.0/mmc_host/mmc0

  • When one is found, split it into its elements and then pull out the path to the that mount point and add it to the arraylist */

    try { Scanner scanner = new Scanner(new File("/system/etc/vold.fstab")); while (scanner.hasNext()) { String line = scanner.nextLine(); if (line.startsWith("dev_mount")) { String[] lineElements = line.split(" "); lineElements[2] = lineElements[2].replaceAll(":.*$", ""); mVold.add(lineElements[2]); } } } catch (FileNotFoundException fnfex) { // if vold.fstab doesn't exist we use the value gathered from the Environment Log.i(StorageOptions.class.getCanonicalName(), fnfex.getMessage() + ": assuming " + defaultMountPoint + " is the only mount point"); mMounts.add(defaultMountPoint); } catch (Exception e) { Log.e(StorageOptions.class.getCanonicalName(), e.getMessage() + ": unknown exception while reading mounts file"); mMounts.add(defaultMountPoint); } } ― You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

mjnguyen avatar May 27 '16 03:05 mjnguyen

Well would it be possible to have this code look in folder for a "wagiclocationoverride.txt" or something, before just autostarting download. Where it can act like a override, if the user has this text, save wagic to the directory inside the text. "Wagicoverride=/sdcard/extsd/whatever" That way for people that dont have a way for wagic to find sd, we can specify the location manually in txt.

zethfoxster avatar May 27 '16 12:05 zethfoxster

Btw i have 0 java coding skills, this would be something i cant just do myself, so any help you can give me in the code goes a long way for me.

zethfoxster avatar May 27 '16 12:05 zethfoxster

The method is just different...all versions still support it. Ill be looking at this myself, as i cant play with hd cards on any of my tablets dude to small internals, Forgive me is i screw up ios trying to fix this myself, i dont have a iso product to ensure that it still works when im done and my java coding ability is null. This should be an interesting learning experience.

If any of the iso devs want to jump on this before i try doing it, now would be a good time to tell me, even the psp images taking up 1 gig of internal is just too much for me when i have a 64gig external.

zethfoxster avatar Jun 06 '16 13:06 zethfoxster

<manifest ...> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="18" /> ...

/* Checks if external storage is available for read and write */ public boolean isExternalStorageWritable() { String state = Environment.getExternalStorageState(); if (Environment.MEDIA_MOUNTED.equals(state)) { return true; } return false; }

/* Checks if external storage is available to at least read */ public boolean isExternalStorageReadable() { String state = Environment.getExternalStorageState(); if (Environment.MEDIA_MOUNTED.equals(state) || Environment.MEDIA_MOUNTED_READ_ONLY.equals(state)) { return true; } return false; }

Beginning with Android 4.4, however, you can access both locations by calling getExternalFilesDirs(), which returns a File array with entries each location. The first entry in the array is considered the primary external storage and you should use that location unless it's full or unavailable. If you'd like to access both possible locations while also supporting Android 4.3 and lower, use the support library's static method, ContextCompat.getExternalFilesDirs(). This also returns a File array, but always includes only one entry on Android 4.3 and lower.

So its still possible without device specific code.

zethfoxster avatar Jun 06 '16 13:06 zethfoxster

I noticed looking at the code that this is not the function we call getExternalFilesDirs(), maybe this is all that needa to update, getExternalFilesDirectory () to the one they list as the function call for it.

zethfoxster avatar Jun 06 '16 18:06 zethfoxster

Also it returns an array with slot 0 being the true external sd card. So we need to change it from fetching a string, to getting the array and setting our directory string to string ourDirectory = someArray [0].append (/wagic)

zethfoxster avatar Jun 06 '16 18:06 zethfoxster

@zethfoxster Can you try this if this works: https://mega.nz/#!9kRiWYpB!fHMdsLeOhCplmxdPzvq7vweUaaRLJrjY0SOmp51_T6I

On my device (Android 5.0.2) it doesn't work but on my cousins phone with Android 4.2 it works...

kevlahnota avatar Jun 11 '16 00:06 kevlahnota

It doesnt work. But i will mention, the storage option thing is NOT device specific. They really did just change a single function. Im super busy otherwise i would be working on fixing this cause personally im wasting my time if all i see are default quads on all devices i own.

zethfoxster avatar Jun 11 '16 11:06 zethfoxster

Here's my last attempt, please try: https://mega.nz/#!htAn0KYa!MZxncZjrcBMVYgpSOc2EIyGFFvzWvujy2A626bawFlI

kevlahnota avatar Jun 11 '16 11:06 kevlahnota

Anyway what version of android do you use?

kevlahnota avatar Jun 11 '16 11:06 kevlahnota

5.1.1

zethfoxster avatar Jun 11 '16 16:06 zethfoxster

This is half fixed, i might close this and reopen as "make android install more user friendly less super user"

zethfoxster avatar Jul 21 '16 15:07 zethfoxster