Copy file from removable SD card - ASD (Taifun File Extension)

Hi,
I need to copy files from ASD on removable SD (/storage/4694-4D13/android/data/appfolder/..).
My scenario is the following :

  • Android 13 OS
    -full permission in manifest (READ, WRITE, MANAGE on EXTERNAL_STORAGE). I know WRITE permission do not exist on Android 11+
  • android:compileSdkVersion="23" in manifest and targetSdkVersion: '19' in apktool.yml

Using Taiufun File Extension I can copy a file to anywhere in the internal storage.
I can copy to internal root (/storage/emulated/0/) or to internal storage ASD (/storage/emulated/0/android/data....) or to shared folders (/storage/emulated/0/download) or to a new folder ( /storage/emulated/0/myFolder).

What I can't do is to read files from ASD on removable SD card.
So I can read files from /storage/4694-4D13/ or /storage/4694-4D13/android
But I can't read files from /storage/4694-4D13/android/data/appfolder/.. and subfolders : error "file to copy does not exist"

I also tried to use file component from AI2 :

  • with default scope to Legacy, I can copy file to anywhere in the internal storage , but I don't know to address to external removable SD files. . If I try to copy files from /storage/4694-4D13 or file:///storage/4694-4D13 , the file component tries to open file in internal_storage_ASD/storage/4694-4D13 or internal_storage_ASD/file:///storage/4694-4D13

So, how can I read files (copy from) from ASD on removable SD card ?
Is it possible on Android 11+ ?

Thank you
Claudio

1 Like

Perhaps SAF: App Inventor implementation of Storage Access Framework

Hi,
with SAF I have to choose files through "file picker", but I need to choose files automatically.
I'm I wrong regarding SAF ?

did you try the file component together with file scope App?
Taifun

Show your blocks.

What type of files (media or non-media files)?

To almost anywhere (exept to the ASD of other apps).

I need to read non media files.
Yes, with Taifun File Extension I can copy a file in the internal storage everywhere on Android 13 (Samsung Galaxy A23)

Yes, I tried file component, but without scope Legacy I can't copy file to internal storage, except into ASD

As I said, show your blocks.

Like this:

(I hard-coded the path to Companion only for demonstration purpose.)



First screenshot : copy a file from removable EXT-SD to root of internal storage
Second screenshot : copy a file from root of internal storage to a subfolder on internal storage

From blocks image I hide other not important blocks : my app does other things, like download a remote sqlite dB, backup apps files , etc.

here you can download the APK WeTransfer - Send Large Files & Share Photos Online - Up to 2GB Free

  1. use long press on COPY button
  2. upper text box is for source file
  3. lower test box is for destination file
  4. default is source on external sd card
  5. obviously you can change source and destination path
  6. during installation choose "install in any case"

aia please

DBcopy(MOD).aia (145.0 KB)

  1. create APK with AI2
  2. decompile APK with APK multuitool or similar
  3. replace or modify manifest and apktool.yml
  4. compile ad sign

MANIFEST

<?xml version="1.0" encoding="utf-8" standalone="no"?>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"/>
<application android:debuggable="false" android:icon="@mipmap/ic_launcher" android:label="DBcopy" android:name="com.google.appinventor.components.runtime.multidex.MultiDexApplication" android:networkSecurityConfig="@xml/network_security_config" android:preserveLegacyExternalStorage="true" android:requestLegacyExternalStorage="true" android:roundIcon="@mipmap/ic_launcher" android:theme="@style/AppTheme">
    <uses-library android:name="org.apache.http.legacy" android:required="false"/>
    <activity android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize" android:exported="true" android:name=".Screen1" android:windowSoftInputMode="stateHidden">
        <intent-filter>
            <action android:name="android.intent.action.MAIN"/>
            <category android:name="android.intent.category.LAUNCHER"/>
        </intent-filter>
    </activity>
    <provider android:authorities="appinventor.ai_MEngeneeringSoft.DBcopy.provider" android:exported="false" android:grantUriPermissions="true" android:name="androidx.core.content.FileProvider">
        <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/provider_paths"/>
    </provider>
</application>

apktool.yml

!!brut.androlib.meta.MetaInfo
apkFileName: DBcopy3.apk
compressionType: false
doNotCompress:

  • resources.arsc
  • png
  • jpg
    isFrameworkApk: false
    packageInfo:
    forcedPackageId: '127'
    renameManifestPackage: null
    sdkInfo:
    minSdkVersion: '7'
    targetSdkVersion: '19'
    sharedLibrary: false
    sparseResources: false
    unknownFiles: {}
    usesFramework:
    ids:
    • 1
      tag: null
      version: 2.6.1
      versionInfo:
      versionCode: '1'
      versionName: '1.0'

So what is your question now?
Btw, there is an extension to get the MANAGE_EXTERNL_STORAGE permission (so no need to de/recomplie APK and customize the Manifest.

My questions are :

  • how can I read files (copy from) from ASD on removable SD card ?
  • Is it possible on Android 11+ ?

Anyway I need to customize manifest in order to change other parameters.
Do you tried APK and verified copy files to internal storage anywhere ?

thank you

Copied from ASD on the removable SDcard to what?
The removable SDcard is read-only since API 19 (Android 4.4 / KitKat)

copy files from ASD on removable Sd-card to internal storage
Issue is I can't read file from ASD on removable Sd-card ( /storage/4694-4D13/android/data/appfolder/.. and subfolders)

Ok, as I've shown, this should be possible.
Post the relevant blocks.

I already post blocks.

As I've also shown, you must use a full path.