Reproducing all content from a folder from command line - Android Q&A, Help & Troubleshooting

Hello I am working i a idea of mounting a windows share and reproducing all the contents with a specific program, for example all images files to open in full screen with gallery or a slideshow program, if a movie with video program etc etc...
i already mount the windows share and i am able to print all the files names but i am struggling a lot on this does anyone knows an app that do this or any thoughts about how to do it from command line?
any idea is really appreaciate
Regards,

"ls"? Or do I misunderstand the question?

thewadegeek said:
"ls"? Or do I misunderstand the question?
Click to expand...
Click to collapse
sorry maybe i didnt make myself clear.
what i need is moreless complex.
I need to make a slideshow of all the content i have in a folder. The problem is that some files are not just images, some are videos.....
So i was thinking that maybe i can do a script in the command line but i need some commands to:
how to open an app
how to pass parameter to it,
i have read that all of it i can find it in manifest file but i also dont know where it is in each application installed.
Another way is if you know any apk that can work.

PLeaseeeee any ideaS?

Google "java find all images in folder".
Sent from my SCH-R760 using Tapatalk 2

thewadegeek said:
Google "java find all images in folder".
Sent from my SCH-R760 using Tapatalk 2
Click to expand...
Click to collapse
i am not doing a apk i am trying to do a script to do what i want, actually i have made some progress, what i now need is how can i now the command an apk accept and his package name, i read this comes in a manifest but where it is in my android system?

eagoweb said:
i am not doing a apk i am trying to do a script to do what i want, actually i have made some progress, what i now need is how can i now the command an apk accept and his package name, i read this comes in a manifest but where it is in my android system?
Click to expand...
Click to collapse
I'm trying dude, but your grammar is killing me. What do you need from a APK and why?

alrededoresfoterp
thewadegeek said:
I'm trying dude, but your grammar is killing me. What do you need from a APK and why?
Click to expand...
Click to collapse
Sorry so true, i was writing really fast...
ok
i need to play all the content in a folder my problem is that i don't know how to determine the name of package and commands of the applications i want to call, here is the code i am using in line command:
This display all the names of all files in the folder
PHP:
for file in 'dir -d *'; do
echo $file\n
done
Then i did another test to try to open an application form line command
PHP:
am start -a android.intent.action.VIEW [weblink]
All this worked
What i want to determine is how can i obtain those package names and commands,for the different applications i install in the android tv box.:
"android.intent.action.VIEW"
But at the same time, the goal of all this is to open all files from a folder like a slideshow of photos and videos.

OK now i am opening astro player from command line, but if i add a new item to the folder how can i send a command to astro player to exit and open again so that he can detect the new file?
is there a 'am stop' command?

Related

[Q/Help] How do I mod sms handling?

I got a problem with the way sms's are handled by HTC Sense(Its the HTC Desire).
I receive a sms from work on a daily basis, and thy contain a "/" (Slash as in "WorkPlaceName A/S") in the "from/sender" field instead of a phone number.
The problem is that the phone receives it, but discards it again because of the slash.
All sense based ROM's I've tried have all had this problem, but the non-sense froyo(2.2) ROM's are fine.
Now I want to change the behavior my self, but I don't know where to look.
I was thinking the kernel or somewhere in the ROM?
But I'm not sure.
I'll appreciate any help.
Anyone can help on this?
Does anyone know how would know?
Have you tried using Handcent instead of the HTC app? Since HTC's apps are not open source, it might not be easy to modify them although you could try 'APK Manager'.
Also, I recommend reading this if you want to understand how apps interact with the OS in Android - http://developer.android.com/guide/topics/fundamentals.html
gnarlyc said:
Have you tried using Handcent instead of the HTC app? Since HTC's apps are not open source, it might not be easy to modify them although you could try 'APK Manager'.
Also, I recommend reading this if you want to understand how apps interact with the OS in Android - http://developer.android.com/guide/topics/fundamentals.html
Click to expand...
Click to collapse
Yes i did try Handcent, but as far as I can see the problem runs deeper then that.
I tried almost all sms apps on the marked, and the sms's keeps getting deleted.
if there is any way to change it, you could most probably find it by decompiling the apks associated with the sms system.. Unfortunately I have no idea what file it would be, however you can convert the Android compiled XMLs with AXMLPrinter2.jar file, and edit the settings to get it to do what you want (though there is a better and more efficient way to do this.. I cant remember what the program is called to do it..)
You can get AXMLPrinter2.jar from here: Download
You have to have the java jre (java runtime environment), and here is the syntax:
1. rename the apk to a .zip file
2. extract the files to a folder
3. 1 by 1 go to the files you want and type (for example)
java -jar AXMLPrinter2.jar Rosie.xml > Rosie.txt
Like I said there is a better way. There is a program out there that will do the hard work on multiple files for you, however I can't remember the program name.
hexskrew said:
if there is any way to change it, you could most probably find it by decompiling the apks associated with the sms system.. Unfortunately I have no idea what file it would be, however you can convert the Android compiled XMLs with AXMLPrinter2.jar file, and edit the settings to get it to do what you want (though there is a better and more efficient way to do this.. I cant remember what the program is called to do it..)
You can get AXMLPrinter2.jar from here: Download
You have to have the java jre (java runtime environment), and here is the syntax:
1. rename the apk to a .zip file
2. extract the files to a folder
3. 1 by 1 go to the files you want and type (for example)
java -jar AXMLPrinter2.jar Rosie.xml > Rosie.txt
Like I said there is a better way. There is a program out there that will do the hard work on multiple files for you, however I can't remember the program name.
Click to expand...
Click to collapse
APK Manager?
hexskrew said:
if there is any way to change it, you could most probably find it by decompiling the apks associated with the sms system.. Unfortunately I have no idea what file it would be, however you can convert the Android compiled XMLs with AXMLPrinter2.jar file, and edit the settings to get it to do what you want (though there is a better and more efficient way to do this.. I cant remember what the program is called to do it..)
You can get AXMLPrinter2.jar from here: Download
You have to have the java jre (java runtime environment), and here is the syntax:
1. rename the apk to a .zip file
2. extract the files to a folder
3. 1 by 1 go to the files you want and type (for example)
java -jar AXMLPrinter2.jar Rosie.xml > Rosie.txt
Like I said there is a better way. There is a program out there that will do the hard work on multiple files for you, however I can't remember the program name.
Click to expand...
Click to collapse
Thanks I'll try that.
But do you know the name of the HTC SMS apk?
I can only find MMS and mail.
Anyway I'll have a look at the MMS apk.

[discussion] where does snapchat store photos/videos?

So I've went into the /data/data/com.snapchat.android/ folder, and it is only about 200KB, so the image/video files can't be stored there.
I also noticed if you have a new message, and you close and open the app, it will have to redownload it. So it seems that snapchat is storing the images in the RAM.
So I dumped the ram of my snapchat PID, using this method. I had to download a compiled gdb binary.
I then used photoRec to scan all the *.dump files [I concatenated them all first, the file was about 100MB]. For filesystem I said "Other."
All I got was one txt file. It seemed to be xml, and contained a lot of usernames of my friends, but that's all.
If anyone has any input on the subject, here is the thread for it!
Bump for interest
mvmacd said:
So I've went into the /data/data/com.snapchat.android/ folder, and it is only about 200KB, so the image/video files can't be stored there.
Click to expand...
Click to collapse
Snapchat save picture under /data/data/com.snapchat.android/cache/received_image_snaps. You then have to copy and paste the file out of the folder, and rename the file extension from .jpgnomedia to .jpg
I can not find where the videos are stored. That's how I found this thread.
Like the previous poster said images are stored in /data/data/com.snapchat.android/cache/received_image_snaps. They are deleted when they are viewed though so you must copy them to your sdcard or wherever and change the file extension before viewing them. Videos are stored in /data/media/0/Android/data/com.snapchat.android/cache/tcs_pahn
Samsung Infuse
Where can I find these files on my Samsung Infuse? I go into /data/data/com.snapchat.android/cache but the folder is empty.
JCBucks said:
Where can I find these files on my Samsung Infuse? I go into /data/data/com.snapchat.android/cache but the folder is empty.
Click to expand...
Click to collapse
I have not had time to check this location, however I have sort of discovered a workaround. [HTC Rezound CM10.1]
Ideally you should have a wifi toggle in the statusbar.
Open snapchat and then click on your snaps, after it loads the images [It will say "Loading image..", then "Tap to view"], turn off WiFi. Then you can view the snapchats [pic or video], and before enabling wifi, wipe Snapchat's data.
This way you can screenshot while offline and they will not know.
Alternatively you can use TitaniumBackup. Backup app while logged in, after viewing snapchat offline, restore data from backup so you do not constantly have to login.
JCBucks said:
Where can I find these files on my Samsung Infuse? I go into /data/data/com.snapchat.android/cache but the folder is empty.
Click to expand...
Click to collapse
same here....
Galaxy Nexus CM 10.1
If you can't find the video folder, it's because it deletes it and the videos when they are not loaded. They are stored under /data/media/Android/data/com.snapchat.android/cache/received_video_snaps/ in mp4 format with a .nomedia file extension. As soon as you navigate away from the app, they are deleted, so I set up a tasker gesture to allow me to copy them while they are loaded.
As people said before, the images are stored in /data/data/com.snapchat.android/cache/received_image_snaps/ with the jpg.nomedia extension. If that folder doesn't exist, try making sure you've received and loaded a snapchat first. The images seem to stay until they're viewed.
shenkenstein said:
If you can't find the video folder, it's because it deletes it and the videos when they are not loaded. They are stored under /data/media/Android/data/com.snapchat.android/cache/received_video_snaps/ in mp4 format with a .nomedia file extension. As soon as you navigate away from the app, they are deleted, so I set up a tasker gesture to allow me to copy them while they are loaded.
As people said before, the images are stored in /data/data/com.snapchat.android/cache/received_image_snaps/ with the jpg.nomedia extension. If that folder doesn't exist, try making sure you've received and loaded a snapchat first. The images seem to stay until they're viewed.
Click to expand...
Click to collapse
That location you name for videos doesn't exist on my phone.
- I have /data/media/ "0" and "obb" are the only 2 folders within there
- I have also read that the videos are stored in /Storage (SD CARD)/Android/data/com.snapchat.android/cache/... but there isn't anything further from here, my 'cache' folder is empty, there's never been a "received_video_snaps" folder, let alone any content within here.
- I am able to get the photos from /data/data/com.snapchat.android/cache/received_image_snaps/ but never been able to intercept videos
Note: this is all done BEFORE "viewing" the material and allowing it to "load" and show "tap to view" from within SC
I'm using the EVO 3D CDMA version
incarceration said:
That location you name for videos doesn't exist on my phone.
- I have /data/media/ "0" and "obb" are the only 2 folders within there
- I have also read that the videos are stored in /Storage (SD CARD)/Android/data/com.snapchat.android/cache/... but there isn't anything further from here, my 'cache' folder is empty, there's never been a "received_video_snaps" folder, let alone any content within here.
- I am able to get the photos from /data/data/com.snapchat.android/cache/received_image_snaps/ but never been able to intercept videos
Note: this is all done BEFORE "viewing" the material and allowing it to "load" and show "tap to view" from within SC
I'm using the EVO 3D CDMA version
Click to expand...
Click to collapse
I'm running TouchWiz. I wonder if you are on a 4.2.2 ROM or something, cause I've experienced the sdcard being moved around before...
Does your "0" folder have any subdirectories? such as Android/data/com.snapchat.android/cache/
In any case, videos are special: You need to actually click "load" (but don't hold, or else you'll actually view it before saving) if it doesn't do that automatically. Unless I misinterpreted, you didn't do that step. I think they might load automatically on Wi-Fi or something, though. For a general rule: As soon as it says "Load", the video is no longer (or never was) on your device. Furthermore, the sneaky little application deletes the folder at the same time, which is why you're never seeing "received_video_snaps" within the cache folder you found (assuming that one actually stores the videos in your version) because in my experience, almost everytime you navigate away from Snapchat, it unloads the video.
If you want to test for whether a file exists in a particular directory using Tasker, mess around with different directories in a File Modified profile (and have the associated task flash something). It'll flash as soon as something is added to that folder (including another folder, it seems).
Otherwise, check out my thread for this here.
I'm not familiar with Tasker. is it possible to have it automagically copy and rename the files that show up in the picture cache folder upon receiving a snap?
-edit-
From reddit:
I've got one method working on doing this, albeit I dislike it because this is questionable practice as is.
you''ll need Tasker and the Secure Settings plugin (tasker's run shell didn't like playing nice most of the time, but the secure setting run command does).
so i have tasker wait for snapchat to be opened, then the opening tasks are to wait 7 seconds (gives you time to load any pictures, honestly, i tried doing this with a file closed but tasker doesn't seem to like using wildcards in that command. if you really want, you can make this an exit command and open snapchat then back out before viewing)
then run shell as root cp -r /data/data/com.snapchat.android/cache/received_image_snaps/ /storage/emulated/0/snaps/ (you'll need to change the second directory, mine is for a gnex on 4.2.2 so that's why it's emulated/0)
next, you'll need to make a script in atext editor, and for sake of sanity, push it to /system/bin with chmod 755 (rwxr-xr-x)
the script then reads as CODE
!/system/bin/sh #there should be a hashtag in front of this but reddit's formatting is being wonky
cd /storage/emulated/0/snaps/ #wherever you copied them to
for file in *.nomedia
do
mv "$file" "${file/.nomedia}"
done
exit
then in tasker, as an exit action, run a secure settings run command with the command of whatever your script name is (include location if you do no push to bin).
it should work
You can play with the triggers and such, but i was having no luck including the scripted portion with the copy actions, it never seemed to run the script (secure settings has options to notify that it's running/completed).
Again, this is mean to be instructional on how to automate this with tasker, since I wanted to solve a puzzle. Not for anyone to be a creepy ass person saving snapchats that you shouldn't.
Click to expand...
Click to collapse
Couldn't post link =/
nannus said:
I'm not familiar with Tasker. is it possible to have it automagically copy and rename the files that show up in the picture cache folder upon receiving a snap?
Couldn't post link =/
Click to expand...
Click to collapse
Is it possible, yes. Will it work flawlessly, not really.
Once I move the file and remove the no media extension. I can open the image but it is blank. Any ideas? Anyone know how to retrieve deleted Images
kprz24 said:
Once I move the file and remove the no media extension. I can open the image but it is blank. Any ideas? Anyone know how to retrieve deleted Images
Click to expand...
Click to collapse
Deleted images are deleted. That's the point of Snapchat. As for the file you moved (I'd recommend you copy it instead, cause Snapchat'll show a blank screen when you view it if you moved the file), make sure it ends in .jpg (for images) or .mp4 (for videos).
kprz24 said:
Once I move the file and remove the no media extension. I can open the image but it is blank. Any ideas? Anyone know how to retrieve deleted Images
Click to expand...
Click to collapse
Actually there is a program called PhotoRec that scans a disk for files using the headers. So as long as the file is unfragmented and not been written over, you can retrieve it with the software. Of course you'll have to either plug in your phone to your PC with usb mass storage mode [if your phone supports it], or else put it in a card reader.
mvmacd said:
Actually there is a program called PhotoRec that scans a disk for files using the headers. So as long as the file is unfragmented and not been written over, you can retrieve it with the software. Of course you'll have to either plug in your phone to your PC with usb mass storage mode [if your phone supports it], or else put it in a card reader.
Click to expand...
Click to collapse
Nice! I didn't think that technology was available on phones at this point.
quantemplation said:
Nice! I didn't think that technology was available on phones at this point.
Click to expand...
Click to collapse
Well actually it's not run from the phone [as I mentioned in my previous post], you must plug your card into your PC with usb mode in order for it to work.
I have used PhotoRec in the past and it has worked pretty well. The only thing, and it's not PhotoRec's fault, your files will have a random number. There's no way to know what the old filename/path used to be, so you have to figure that part out on your own.
In short, always backup your sdcard unless you don't mind losing everything, and depending on the damage, might be able to recover the files, but only the ones not fragmented and they will be randomly named.
I developed an easy way to sync the received pictures and videos with your Dropbox account.
If it is interesting you can check my thread here
Using the Droid DNA and looking in com.snapchat.android and the cache folder is there, but that is empty. There is no received images folder. Anyone know why this is the case? I know I've gotten plenty of images from snapchat.
jaredkent said:
Using the Droid DNA and looking in com.snapchat.android and the cache folder is there, but that is empty. There is no received images folder. Anyone know why this is the case? I know I've gotten plenty of images from snapchat.
Click to expand...
Click to collapse
The same thing is happening with my Galaxy S3

[Q] Questions regarding permissions in APK files

Hi, I have recently tried to create a program which outputs the permissions required by a apk using the command "aapt d permissions apkfilename.apk". I tried it on a list of apk files and most of it worked. However there appears to be 1 apk which provides an error stating: dump failed because no AndroidManifest.xml found. There is also another second apk file which provides no error message when the aapt command is used, however no permissions are listed. Based on that observation I have a couple of questions regarding permissions.
1.) I was wondering, is it possible for a apk file to work on a phone despite not having a androidmanifest.xml file (after the apk is installed into the phone)?
2.) In addition to that, is it possible for a apk file (after the apk is installed into the phone) to use permissions without asking the user for permission?
3.)Is there any another file/command which could definitely list the permissions required by the apk, assuming if the person who created the apk tried to hide the permissions required?
4.)The aapt program output two types of permission, uses-permission and permission. What are the differences between the two?
dk3498 said:
Hi, I have recently tried to create a program which outputs the permissions required by a apk using the command "aapt d permissions apkfilename.apk". I tried it on a list of apk files and most of it worked. However there appears to be 1 apk which provides an error stating: dump failed because no AndroidManifest.xml found. There is also another second apk file which provides no error message when the aapt command is used, however no permissions are listed. Based on that observation I have a couple of questions regarding permissions.
1.) I was wondering, is it possible for a apk file to work on a phone despite not having a androidmanifest.xml file (after the apk is installed into the phone)?
Click to expand...
Click to collapse
To my knowledge, no, it wouldn't work.
dk3498 said:
2.) In addition to that, is it possible for a apk file (after the apk is installed into the phone) to use permissions without asking the user for permission?
Click to expand...
Click to collapse
Yes, this is possible. This is usually done by malicious applications.
dk3498 said:
3.)Is there any another file/command which could definitely list the permissions required by the apk, assuming if the person who created the apk tried to hide the permissions required?
Click to expand...
Click to collapse
XPrivacy, an android app, could be of use here.
dk3498 said:
4.)The aapt program output two types of permission, uses-permission and permission. What are the differences between the two?
Click to expand...
Click to collapse
See here.
Hi Theonew, thanks for the help :good:. So am i right to assume that malicious apk files could avoid stating the permission used/required in the androidmanifest.xml but still be able to use it behind the scenes?
dk3498 said:
Hi Theonew, thanks for the help :good:. So am i right to assume that malicious apk files could avoid stating the permission used/required in the androidmanifest.xml but still be able to use it behind the scenes?
Click to expand...
Click to collapse
Yes, this is possible. XPrivacy comes in handy here since it shows you the permissions which the app requested upon installation (hence you granted), and also shows the permissions the app actually used. Sometimes these include ones which were not requested/granted.
This and this may be in your interest. If not, they're still interesting reads .

Android Multitool problems. :(

I've installed the android sdk, java, and all the other fancy things I was supposed to, but cannot get Android Multitool to decompile any apk's.
This is the error log it throws out:
The system cannot find the path specified.
'apktool' is not recognized as an internal or external command,
operable program or batch file.
The system cannot find the file specified.
Any help is greatly appreciated, I'm lost as to what I'm doing wrong here.
Thanks,
I do not have Android Multitool, but I do have the apktool. Did you install that aswel?
Jooztk said:
I do not have Android Multitool, but I do have the apktool. Did you install that aswel?
Click to expand...
Click to collapse
I did. It's included with Android Multitool and I have it downloaded by itself. I would just use apktool, but I've never used it and have no idea what the commands to decompile/re-compile an apk are.
Thanks for the response,
Ayahuascaa said:
I did. It's included with Android Multitool and I have it downloaded by itself. I would just use apktool, but I've never used it and have no idea what the commands to decompile/re-compile an apk are.
Thanks for the response,
Click to expand...
Click to collapse
If you open a cmd window in the apktool folder, type "apktool.bat decode <file.apk> <outputdirectory>". I have not tried recompiling anything with it though.
guys you dont install apktool. It is just a jar file with a few supporting files. You have to make sure you are in the directory that has apktool in it if you are using the stand alone. As for apkmultitool it could be a bad download. Check the other folder to make sure the jar files are there. I would use the latest apktool from the thread as it is the most up to date. Also keep in mind that there are a few different versions that maybe needed depending on the apks your working on.

Directory Tree List Maker Help

Hi!
I want to create a list of all of my files and folders names in
A txt.file
In pc there are a few softwares which can do so.
But how can i do it on Android
Any help might be great! Plz Answer.
Or if there is no way then plz suggest me a command for
Terminal Emulator to view all the names of files in a folder
Which is located like this in my device
/storage/sdcard0/AM/
Or
/Storage/sdcard0/VM/
AM=Audio Music
VM=Video Music
I have not found an android app to perform a task plz make one, also iam a begginer to c++
Started creating a few programs with these two header files
"stdio.h,conio.h"
I have a little bit concept about iostream
But it would be great if you create a program else plz
Give the whole script for c++ to perform that.
Thanks!!!
List files by ADB
You can use adb:
adb shell ls -R /
Click to expand...
Click to collapse

Categories

Resources