[Free] Extension. Terminal. Using LINUX commands. Copy files from assets

Hola amigos,

I have updated my com.KIO4_Terminal.aix extension.

With this extension you can execute many LINUX commands.
Comments on the use of these commands were posted on the App Inventor forums.

Using LINUX commands in App Inventor. Extension - App Showcase - MIT App Inventor Community
awk ::: base64 ::: basename ::: bunzip2 ::: bzcat ::: bzip2 ::: cal ::: cat ::: cksum ::: cp ::: curl ::: cut :::: date ::: dd ::: df ::: diff ::: dirname ::: du ::: echo ::: egrep ::: env ::: fgrep ::: file ::: find ::: ::: getprop ::: grep ::: gunzip ::: gzip ::: head ::: hostname ::: ifconfig ::: ip ::: ls ::: md5sum ::: mkdir ::: mount ::: mv ::: netstat ::: ping ::: printf ::: ps ::: rm ::: rmdir ::: sed ::: service ::: tail ::: tar ::: top ::: touch ::: toybox ::: tr ::: truncate ::: uptime ::: uudecode ::: uuencode ::: wc ::: zcat ::: zip_utils.

In this update I have added two blocks to be able to copy files from the assets.
Using the ā€œCopyFromAssetsā€ block we can copy an asset file to /mnt/sdcard/
Using the ā€œAssetsToCacheDirā€ block we can copy an asset file to the CacheDir directory of the same application, it is affordable.

Here an example:

Terminal_sell.aia (517.4 KB)

You can download the extension of:
http://kio4.com/appinventor/278_extension_shell.htm

Regards,
Juan A. Villalpando.

18 Likes

@juananton1991

I tryed Get userā€™s data using CURL from FireBase Auth.

Link documentation

curl ā€˜https://identitytoolkit.googleapis.com/v1/accounts:lookup?key=[API_KEY]ā€™
-H ā€˜Content-Type: application/jsonā€™ --data-binary ā€˜{ā€œidTokenā€:"[FIREBASE_ID_TOKEN]"}ā€™

image

I didnā€™t get a response from KIO4_Terminal.
Could you help me find out what Iā€™m missing? Thanks.

I have not tried curl with firebase, try:
https://cloud.google.com/identity-platform/docs/use-rest-api

With Airtable it would be like this:

1 Like

I have updated my com.KIO4_Terminal.aix extension with more functions with the assets.
For these blocks to work, the app must be installed.

ListAllAssets, get a list from files in assets.
CopyAllAssets, copy all user files from assets to dir in SdCard.
CopyAllAssetsX, copy all files from assets to dir in SdCard.
CopyFromAssets, copy a file from assets to dir in SdCard.
PathFileAssets, get path file in assets when app is installed.

You can download extension from:
http://kio4.com/appinventor/278_extension_shell.htm

I use the Instagram API, and run CURL with this extension but it doesnā€™t show anything.

By the new update of Kodular 1.4D i have this error in compiler:

java.lang.RuntimeException: no such class: com.KIO4_Terminal.KIO4_Terminal

but maybe issue is in Kodular :


Will see after fix updates.

@juananton1991

can this extention work in Andeoid 11?

1 Like

yes
however the new file access restrictions in SDK30 are also valid for this extensionā€¦

a file extension might be easier for you to useā€¦

however you will have to try something to get something runningā€¦

Taifun

3 Likes

No, he will definitely not use any extension where he is asked to show what he has tried. He need ready made blocks. :joy:

Sorry . . .
didnā€™t work !

sorryā€¦
nobody knows what you are talking aboutā€¦
btw. your contribution also can be considered as spam, as it does not help anyoneā€¦

Taifun

Iā€™m So sorry, My mistake!
I meant , I couldnā€™t successfully copy image file from app assets to my phone storage,
By using this extension !
Iā€™m new in kodular , and Iā€™m Trying to know how to let the user of my apps sharing my assets app images !

use the file component to copy files from the assets to shared storage

It would really help if you provided a screenshot of your relevant blocks, so we can see what you are trying to do, and where the problem may be.

To get an image of your blocks, right click in the Blocks Editor and select ā€œDownload Blocks as Imageā€. You might want to use an image editor to crop etc. if required. Then post it here in the community.

Taifun

Using curl

It either returns random characters in compainion or just nothing in the apk.

Any help is appreciated.

i used this extension to run su command like

echo 1 > /sys/class/power_supply/battery/input_suspend

and

cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq

but the performance is very bad refreshing the cpu frequency every 2 seconds the app is already very laggy
not sure whats the issue