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 6659873
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:05:04+00:00 2026-05-26T02:05:04+00:00

In my Android application, the user can submit content to the database which can

  • 0

In my Android application, the user can submit content to the database which can then be seen by all the other users as well.

This new content is sent to the server via GET request:

http://www.example.org/API.php?newContent=helloWorld

The problem is: If a user finds out what this URL looks like, he could easily sent malicious requests in his browser and circumvent the Android application. Maybe one could decompile the app and find out about the URL.

How can I protect access to this URL and prevent users from accessing this API directly?

Is it a good solution to generate a hash in the application and compare it with a hash generated in the API.php file on the server?

Couldn’t one find out how the hash is generated when decompiling the application?

Thank you very much in advance!

  • 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-05-26T02:05:05+00:00Added an answer on May 26, 2026 at 2:05 am

    So the only way to truly protect that URL is by requiring all requests to it be authenticated.

    One way to do this is change your request to a POST request and send along some sort of auth token (a simple hash will do) with the request. If the auth token isn’t present, simply don’t respond to the request. The hash would be something you’d hardcode into both the client and server.

    Now the question is how to hide your auth token. As long as you’re not open sourcing your code, the only way for someone to get at it would be to decompile your program as you mentioned. To guard against this you might want to look into using proguard (http://developer.android.com/guide/developing/tools/proguard.html).

    Something to keep in mind is that this method contains a single point of failure. If your auth token is ever exposed, you’re done for (e.g. the HD DVD AACS cryptographic key debacle).

    One other way to authenticate is on a per-user basis. As long as a valid user is making a request, you shouldn’t really care whether or not the request is coming from the web browser or android app. I think this is a much better way of doing things. By doing this, you can throttle requests on a per-user basis. This however requires you to manage user profiles and the whole can of worm that comes along with it.

    All that said, at the end of the day though you shouldn’t really care if somebody knows the url to a portion of your API. I don’t know your particular use case, but there’s got to be a way to design your API so that you don’t care how you’re getting your requests. Also, if your doing a true GET, then you shouldn’t be changing anything on the server. This means that all the ‘malicious person’ can do is get data off of it. This severely limits the damage they can do. In fact, unless you have sensitive data that you don’t want certain people to look at, you don’t really have a problem at all. If you do, then you should really think about my per-user authentication solution.

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

Sidebar

Related Questions

I am creating an android application in which the user can view the channel
Can i get informed in my android application when a user adds a new
I would like to in my application user can download content on http, but
In my android application, how can I forward user to android market to install
I have an android application in which if user changes his/her system font through
In my android application there is a number of operations that the user can
Hi i have develop an android application in which i want to prevent user
I am writing an android application where the user can add and remove fields
I have an Android application that installs a database (~2000 rows across all tables)
I'm writing a graphic design application for Android where the user can add several

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.