How to make a system app in Android code - java

I'm trying to make a app that works like a parental control, but doing so, I got stuck in system app permissions, looking about it, I am not able to find anything that tells me that it is possible to do without using a specific ROM for my app. But in the Play Store, has a lot of apps that makes that. In my app, every time that I try to block connectivity, using ConnectivityManager, he gives me:
java.lang.SecurityException: Neither user 10228 nor current process has android.permission.MODIFY_PHONE_STATE.
And the permission is in the manifest. In the manifest, he gives me the error:
Permission is only granted to system apps.
So, I'm asking, how to make a system App in Android code without root the device?

how to make a app that it is a system app in Android code without root the device?
The closest thing to what you describe is for you to create your own custom Android ROM, where your app is pre-packaged as a system app, and convince people to install your ROM on their device, replacing their existing Android installation.
Otherwise, this is not possible. This should be obvious: if everyone could write an app that made themselves be a system app, there would be no value in having a distinction between regular apps and system apps.

Related

Uninstall app from android device without permission

I developped launcher for an android MDM system. I control this mdm system with Api, so I need help to know how can uninstall/install app into device that use this mdm system in background and without the installer permission.
I also need to delete the apk file from android device storage after the install.
How can I do this programmatically in java?
Any one have solution?
For security purpose without the installer permission we cant install/unistall application in android.
It may require device rooted & make your app system. Read this for reference.
Note: this is not recomended if you want publish your app to playstore

Android App that listens if other apps crash on device

Is it possible to have an App that works in the background and listens to when another app crashes on my device?
I want my app to notify my computer when it detects that the app I'm using on my device crashed or stopped. If so would what it need to listen too?
A very hacky way would be to write a native binary which monitored Logcat, upload the executable to your device using ADB and launch it using the shell account. Note that this is not an App though.
The Android shell user has enough privileges to view Logcat for all processes and perform network operations, so you could just scan Logcat for the tell-tale messages that indicate that an app has crashed, siphon out the stacktrace from Logcat and then send it over the local network to your PC.
This actually sounds like quite a cool idea. Might have a go at it building it myself :-)
I think you want to create Samsung's Smart App Manager . That track the crashes of all application and show notification to uninstall app or remove.
From Android doc : By default, the system assigns each app a unique
Linux user ID (the ID is used only by the system and is unknown to the
app). The system sets permissions for all the files in an app so that
only the user ID assigned to that app can access them.
Each process has its own virtual machine (VM), so an app's code runs
in isolation from other apps.
By default, every app runs in its own Linux process. Android starts
the process when any of the app's components need to be executed, then
shuts down the process when it's no longer needed or when the system
must recover memory for other apps.
Each and every android application runs in isolation from other apps. So any app can't track the crash log of other app.
The question is : How Samsung's Smart App Manager is doing.
I think samsung smart app only works with Samsungs devices. Root Permission is required to perform such type of action. Samsung's Smart App only have root permission in Samsung's devices.
If you are developing app for custom ROM or Rooted android device then you can otherwise you can't do.
When you upload your apk in the android developer console you have any options including errors options, then when the app crashed in some device they can send a report and you will can see it in de console...

Installing Teamviewer silently on android device from a remote location using java

I want to install the TeamViewer software automatically on client's android device remotely using java. I have researched about a number of third party tools for automatic installation of software but the problem is that each one of them needs user interaction/permission in one or the other way.
In my app I will disable the touch of the device after the user logs in and an animation will be displayed based on the real time data from the server. I want to install the software assuming that no user is present at the other end and no response should be needed to install teamviewer.(My app will not there be on Google play.)
I am very new to android development, but through my research I found that .exe file can not be installed on Android as its a Linux based OS.I was planning to keep the Application(.exe) file at server and then try to install it issuing some adb command from my code.
Can someone please tell me how is it possible? How should I proceed? Please help.
Thanks in advance for any help.
There are two way for installing an App on an Android device:
Via ADB. This requires Debugging to be enabled on the device, and the computer the Java program is executed on requires an USB connection to the device (and proper USB drivers) and the device must be "ADB-paired" with the computer if the device has at least Android 4.2. Furthermore you need ADB which is part of the Android SDK and therefore not present on a regular PC. You could ship a version of ADB with your program but ADB is platform specific (Windows, OSX, Linux, ..) therefore you would have to include multiple versions and select on.
Vis Google Play. Once the user is logged-in any app from the play store can be installed to the users's device via web interface. As the Google log-in credentials are required a user must be present to enter them.
Conclusion: What you want is nearly impossible, especially the "without user interaction" part.
You can't install a app from other app without user interactions, that would a big security problem.
The one app that can it is Google Play for obvious reasons.

How to run Java app in Android

Is it possible to run java app (jar) in my android application? Because I need to create PDF, the problem is if I generate PDF in android, only can show with small image, if it contains large image in many pages, it will be error. So I think, I can generate PDF in java and then included to android app.
Concernig the mentiones app JBED:
Well honestly, I could not find any credible source for this tools JBED, so I would really be very cautious (e.g. who is the developer?)
In the manifestfile (in Androidmanifest.xml, where every app has to state what rights it needs to run, see How to view AndroidManifest.xml from APK file?) there are many rights mentioned (what could be necessary, as the app wants to run as an emulator), so a java application might want to send an SMS, record audio, take pictures and place calls -- so the emulator would need those rights as well.
But then the app also registers the "android.intent.action.BOOT_COMPLETED" event (i.e. autostart after boot) and this would go against every description of the tool.
Ah yeah and giveaway: The apk has a folder "certs" that has some (root-)certificates. But those are not the real certificates of the authorities, e.g. Versign. If one installs the app and by that those certificates the trust you might have in https-connections is lost because those who made the fake certificates can create own, false certificates that your phone would trust.
I assume (or am pretty sure) this is a spy tool, but I could be wrong. The (rare) testimonials that claim the tool ran perfectly will probably be the same person that posted the tool under a different name.
Andreas
You can import java Third-party libraries into Android app, follow the steps here.
I am not sure whether it will work,but just try.
If your program is a console program, the answer is yes.
Install Jvdroid from Google play. Click terminal and then write this command: java -jar YourJarFileName.jar
The simplest way would be to some install terminal emulator and then install java and then you can run java apps on standard java. You can even install full Linux distro with x server without rooting the phone, then connect to it from x client and you have Linux desktop on android. Once I've even installed eclipse for java development on it and everything worked. I tested this setup last time in 2014, but I'm pretty sure you can do this nowadays as well. The app with Linux I get from play store as well app for the x client. The app I used back then was "Debian no ROOT" or smthg like this. You need to check what's currently available to make this setup in Google Play store according to your android version and your preferences. Last time I've checked there was a lot of different tools for this kind of task. Lastly I've even successfully installed TF and keras on my android phone using terminal emulator.
You can use JBED. JBED is an .apk Android application which run java games and app on your android Device. JBED is a java android emulator, by using
this application we can install .JAR/.JAD/Java/J2ME/MIDP app on android phones.
You can do it quite easily as there are many ways to run java apps on android. Specific application called Java Emulators can do it quite easily.
These are four most popular java emulators for android viz, JBED, PhoneME, Jblend and NetMite. These are arranged in order of their preference. You can use phoneme for non rooted device, however if your device is rooted try any of the remaining three applications.

Getting facebook deeplinks to work on emulator facebook android

The problem I'm trying to solve- I'm trying to get deep linking working, and testing it with Emulator. When clicking on posts, the links direct to the mobile web site. This is in the case of the user having permissions for the app, and the app is installed (on the emulator). In the Facebook app, it even acknowledges its out of date, but an upgrade (in app) crashes.
I also noticed that the Facebook app installed on the emulator is out of date (I installed it via adb install facebook.apk from github sdk).
SSO is working fine, and I have setup deeplinking effectively with iOS before (So I know how ti's supposed to work/test it, etc.). But the port to Android is being held back by this out of date 3rd party Facebook app. I'm assuming testing on device will solve it, because there the Facebook app will be the latest (which brings to mind- what if people haven't updated their android facebook app?).
My app settings:
I'd post code, but this seems to be pure integration and configuration issues.
Note: my app isn't published on Google Play, could that be the issue?
Also: maybe this is only testable on the device? My device is "in the mail" so trying to get this done with emulator as much as i can.
Update: Facebook told me that this requires the Facebook app 1.9.* which is not in the SDK. So, I got my hands on a device, and while I haven't solved it, at least the app bookmark functionality is working. Will update if/when I find the answer.
Update 11am: I finally got it to work!
I had to publish my app in the Play/Market.
Each time I tested, log out of FB-Android app, clear cache, and force stop. Acc.
to the documentation the bookmarks are cached. I also think the
facebook app-syncing occurs on launch, and never again. So if you
change anything in FB's app settings, you need to log out/clear
cache/stop for it to take in the fb android app.
Only one key worked, even though it says "hash" in the fb app settings, I think
my dev key was screwing things up. Double-confirm that your release
key is the same as the one listed in app settings.
The final secret sauce for me, was to turn off SSO and deeplinking, re-test
without anything set. Also, remove dev package from phone and
download from Play. (see: key mixups). then, I stepped back through
the configurations by first turning on SSO, testing, then turning on
the native deep linking.
Only works on real device, not emulator (unless you can get 1.9 installed on emulator, may work, did not go down that route to test)
Not sure if this matters, but it may: install app from Store/Play, not from Eclipse. Could be the key syncing thing.
I figured it out- involved doing the following:
I had to publish my app in the Play/Market.
Each time I tested, log out of FB-Android app, clear cache, and force stop. Acc. to the documentation the bookmarks are cached. I also think the facebook app-syncing occurs on launch, and never again. So if you change anything in FB's app settings, you need to log out/clear cache/stop for it to take in the fb android app.
Only one key worked, even though it says "hash" in the fb app settings, I think my dev key was screwing things up. Double-confirm that your release key is the same as the one listed in app settings.
The final secret sauce for me, was to turn off SSO and deeplinking, re-test without anything set. Also, remove dev package from phone and download from Play. (see: key mixups). then, I stepped back through the configurations by first turning on SSO, testing, then turning on the native deep linking.
Only works on real device, not emulator (unless you can get 1.9 installed on emulator, may work, did not go down that route to test)
Not sure if this matters, but it may: install app from Store/Play, not from Eclipse. Could be the key syncing thing.
Have you had a look at the troubleshooting tips for deep linking? (Sorry, have to ask.)
I'm wondering if perhaps the FB app on your device was not properly quit after the relevant setting changes.

Categories

Resources