How to find a file inside device ?

Discussion in 'Android Hacks and Help' started by asteroidg, Jan 8, 2011.

  1. asteroidg

    asteroidg New Member

    Joined:
    Jan 8, 2011
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    Ratings:
    +0
    Hi to everyone.

    I need some help. I need to find a file inside device, but i have just a part of the file name . How can I find that inside the device programmaticaly ? Also my file will have the following mask file* , where * will replace the other character file name ?

    What methods should I used for that ? or even some linux commands to retrieve the path of the file ?

    Any help will be appreciated.

    Thank you.
     
  2. jeffv2

    jeffv2 Developer Developer

    Joined:
    Dec 23, 2010
    Messages:
    1,240
    Likes Received:
    0
    Trophy Points:
    36
    Location:
    south jersey
    Ratings:
    +0
    Tell us the file or part of the name

    Sent from my Droid using DroidForums App
     
  3. asteroidg

    asteroidg New Member

    Joined:
    Jan 8, 2011
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    Ratings:
    +0
    Ok. The file name will be AndLib_AC0123456789.apk, I want to look trough all device to find the that file using just AndLib*.apk . Any suggestions or even methods will be appreciated!
     
  4. CJM

    CJM Developer Relations Staff Member Rescue Squad Premium Member

    Joined:
    Sep 12, 2010
    Messages:
    9,766
    Likes Received:
    835
    Trophy Points:
    258
    Location:
    Mississippi Gulf Coast
    Ratings:
    +872
    Current Phone Model:
    Nexus 6
    If the .apk has been installed, with a file explorer on your phone (astro, root explorer, etc.) look in data\app or system\app.
    If it hasnt been installed, and downloaded from the stock browser, look in the download or my downloads folders on your sd. Again with a file explorer from the phone.
    If it was downloaded from another browser, like xscope, it may be in that folder on you sd. Hope this helps.
     
  5. asteroidg

    asteroidg New Member

    Joined:
    Jan 8, 2011
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    Ratings:
    +0
    Thank you CJM.
    On my both phones(HTC-1.5, XPERIA-1.6) I just figure out that all the time when I am downloading a file it will be stored in /sdcard/download . Getting the file from a specific folder will be :

    File dir = new File("/data/app");
    File[] fileList = dir.listFiles();

    if (fileList != null)
    {
    for ( int i = 0;i<fileList.length;i++)
    {
    filename = fileList.getName();
    Log.d("FN-log","file name="+filename);

    if (-1 != filename.indexOf(appName.toString()))
    {
    break;
    }

    }
    }

    Any way I am still looking to have a search engine , method which will look inside the whole device for a file name or masked file name .
     
  6. CJM

    CJM Developer Relations Staff Member Rescue Squad Premium Member

    Joined:
    Sep 12, 2010
    Messages:
    9,766
    Likes Received:
    835
    Trophy Points:
    258
    Location:
    Mississippi Gulf Coast
    Ratings:
    +872
    Current Phone Model:
    Nexus 6
    Glad you figured it out.
     
  7. brando56894

    brando56894 Active Member

    Joined:
    Mar 9, 2010
    Messages:
    1,217
    Likes Received:
    0
    Trophy Points:
    36
    Location:
    New Jersey
    Ratings:
    +0
    you could also try the find shell command or port/copy over locate and updatedb.
     
  8. asteroidg

    asteroidg New Member

    Joined:
    Jan 8, 2011
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    Ratings:
    +0
    I have tried this too but every time i am getting the issue access is denied.I uses the following code but no luck:

    try{
    Process process;
    process = Runtime.getRuntime().exec("su -c find / -name *.apk");
    BufferedReader in = new BufferedReader(new InputStreamReader(process.getInputStream()));
    }
    catch (InterruptedException e)
    {
    // TODO Auto-generated catch block
    e.printStackTrace();
    }
     
Search tags for this page

how to find files on droid dna

,

how to find out android hacking files

,

how to location miscellaneous files on droid dna

,

htc dna .apk file location

,

search htc dna files

,

where to find the root.bat file on device