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

  • SEARCH
  • Home
  • 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 7439333
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:41:28+00:00 2026-05-29T10:41:28+00:00

I am currently developing an app that reads out SMS/Emails while driving. Many users

  • 0

I am currently developing an app that reads out SMS/Emails while driving. Many users wished support for WhatsApp / KakaoTalk.

However, as there is no “official” way to receive their messages, there would be only three options, all requiring root:

The easier way of scanning their database in a given intervall.

  • Easy to implement.
  • However not battery efficient
  • Also the messages are not read out immediately.

An other way would be to run a service with root rights and register a receiver that listens for their push notifications. This has to be done with root, as both packages require a signature based permission for receiving their push notifications.

  • Harder to implement
  • Better user experience

Also another thing came to my mind: Would it be possible to manually add permissions to an APK after installing? In that case I could add the c2dm permissions to my package.

  • This would make things very easy
  • However, I am a little bit scared of changing my app’s permissions, as this is completely against the Android Sandbox principle.
  • Still, if it would be possible, let me know!

The problem is, how exactly do I run a service with root rights (is it actually possible)? I know how to run shell commands or binaries with root, but I have no idea how to start a part of an APK as root.

Also, would it be possible to integrate a BroadcastReceiver into a binary? I have actually no experience with C/C++, especially in an android environment.

Can you help me with that?
Thanks.

edit: Like I said in the comment, I do not want to use an AccesibilityService, as it does not fit my needs (eg it will give me “2 unread messages” if more then one is unread, also it does not include the full body).

edit2: Just to clarify things: I know how to run commands with root. What I need to know is how to register a Broadcastreceiver, that receives a specific broadcast “normal” receivers don’t get, as the Broadcast itself requires a signature based permission I don’t have.

  • 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-29T10:41:29+00:00Added an answer on May 29, 2026 at 10:41 am

    This is far from trivial but should work when the apps you want to monitor use sqlite databases or, more generically, write messages to a file when they arrive.

    You will indeed need to have root access to the device as this violates the android security system:

    Write a native process which runs as a daemon using the NDK and spawn it once after boot as root. You have now 3 major problems to solve:

    How to find out if something changed?

    This is the easy part. You would need to utilize the Linux inotify interface which should be accessible on every Android phone as the SDK has a FileObserver since API 1, so you are on the safe side here.

    Another interesting approach may be to catch the C2DM messages. I have found a NDK class called BroadcastReceiver, so the NDK may be able to catch them. But I personally wouldn’t do that as it feels wrong to steal intents. Also you would have to redistribute them or let them travel to real recipient, so I will not describe this in detail here. It may work, but it may be harder and should only be a fallback.

    So, when you have solved this, the next problem arises:

    How to read the changes in a safe way?

    You have a problem, a big one, here. The file doesn’t belong to the client, and the client doesn’t even have the permission to know where it is (normally). So the monitored app is not aware of the client and will act like the file is exclusively owned only by itself. If they use some plain old textfile to write messages to you have to find out a way to read from it safely as it may be overwritten or extended at any time. But you may be lucky when they use sqlite, according to this it’s totally valid to have more than one simultaneous reader, just only one writer. We are in the specs, everything fine again. When you have now read out the new data, more problems to solve:

    How to get the new data back into the main app?

    You should do only the bare minimum in this C/C++ program because it runs as root. You should also protect your app users from security breaches, so please write the program with this in mind. I have no real idea for this could work really good, but here are some thoughts:

    • Write the collected data into your own sqlite database (easy in C/C++ and Java),
    • Write the collected data into a plain file (not recommended at all, pain in the rear),
    • Send an Intent which contains the new data (maybe not that easy in C/C++, but easy in Java)
    • Use sockets/pipes/…, just every RPC mechanism you could imagine which is brought to you by Linux (same as the file, don’t do it)

    As stated in the text above, please be careful when you write this daemon as it is a potential security hazard. It may be hard to do this when you have no knowledge about C/C++ at all, even if you have written simple programs this should be a non trivial task.

    On my search through the web I have found the NDK C++ classes I mentioned above. It can be found at Google code. I have neither experience with the NDK nor the C++ wrapper but it may be worth a look when you plan to write this.

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

Sidebar

Related Questions

In the iPhone app that I am currently developing, I present several alert views
Good evening, In my app that I'm currently developing, I have a class that
I'm currently developing a Window app that uses CheckedListBoxes for certain aspects of the
A new question about android and services. Currently I'm developing a App that should
I'm currently developing an app that uses Core Data. I'm using two stores/configurations, one
I am currently developing an app that has a TabBarController and each of the
I am currently developing a web app that uses Google's Static Map API, in
I am developing an app that has many view. Into my app sometimes the
Okay, so I'm currently developing an iphone app that I plan to take into
I am currently developing an app that's going to show a Facebook page's events

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.