Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8513267
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T04:30:59+00:00 2026-06-11T04:30:59+00:00

I’m doing a secure application, where an user can browse some file and open

  • 0

I’m doing a secure application, where an user can browse some file and open them with application presents on the phone. So for now, my application is really secure, files are well encrypted, but I have one MAJOR break. Indeed, I’m using my application to open the user secure files which are of different types (pdf, doc, txt, jpg, …) so I’m using the external application presents on the user phone to open them. But my issue is here, because to let another application to open these files, I need to provide an Android storage location to the application that I want to use.

Here is the code that I’m using right now:

Intent intent = new Intent();
intent.setAction(android.content.Intent.ACTION_VIEW);
File fileToOpen = new File(activity.getExternalCacheDir().getAbsolutePath() + 
    "/" + fileName);

MimeTypeMap mime = MimeTypeMap.getSingleton();
String extension = fileToOpen.getName().substring(
        fileToOpen.getName().lastIndexOf(".") + 1);
String type = mime.getMimeTypeFromExtension(extension);
intent.setAction(Intent.ACTION_VIEW);

intent.setDataAndType(Uri.fromFile(fileToOpen), type);

Manager.getActivity().startActivityForResult(intent,
        ExplorerActivity.FILE_CLOSED_SUCCESSFULLY);

So, as you can see in my code, I need to store my real file into the cache directory to open it, so if a thief has an access to the user phone, it can open real files presents into this directory so my application is not secure anymore.
Of course I’m deleting this plain file right after the user has closed it and I have encrypted it, but the deletion doesn’t mean that the file is totally deleted from the phone. Before deletion, I’m rewriting with some null byte but it’s not enough for a secure deltion of this file.

So now, what I want from you it’s an idea to achieve what I want to do: open a file without storing it into the Android hard storage.

Here are some leads that I had:

  • Open the file with my own app (but it’s a lot to implement because there are too many types of files, and I really don’t like to develop something which exists already)
  • Find a solution to open the file without storing it externally of my application (What I mean is to open the file directly with the byte array of this file)
  • Store the file into the phone RAM (I don’t know if it is possible)

So this is a non-exhaustive list and any other suggestion will be appreciated. And if you can provide any help about one of the solution that I have proposed, please don’t hesitate. Don’t hesitate also to tell me if one of my ideas are completely impossible or wrong.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T04:31:01+00:00Added an answer on June 11, 2026 at 4:31 am

    Have you tried your own contentProvider which overrides openFile , so files that are private to your app are opened by you and you return filedescriptor which is accessible to other apps

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have just tried to save a simple *.rtf file with some websites and
I have a jquery bug and I've been looking for hours now, I can't
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I am doing a simple coin flipping experiment for class that involves flipping a
I want use html5's new tag to play a wav file (currently only supported
In my XML file chapters tag has more chapter tag.i need to display chapters

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.