I need to block access to my android application on rooted devices. So when the app is launching I check if there is a file named "Superuser.apk" on the device (see the post of this solution here). If the file exist the application quit.
But here is my real problem, I want to test this feature and I don't want to root my own device. So I was wondering if there is a way to root an emulator on Android Studio to try it ?
I checked a lot of topic on internet, but every post I saw was about how to root a real device.
Is someone there know if it's possible ? And if yes, how?
Thanks in advance !
Related
I created a mobile application using kivy, but after having it installed on android device, it does not launch. Below is the buildozer.spec file.
title=Translator
package.domain=org.test
source.dir=.
source.include_exts = py,png,jpg,kv,atlas
version=0.1
requirements=python3,kivy,requests,bs4 #I used requests and bs4 libraries for webscraping purposes, I'm not completely sure that I do not need any other requirements for internet connection.
orientation=all
osx.python_version=3
osx.kivy_version=2.0.0
fullscreen=0
android.arch=arm64-v8a
android.allow_backup=True
#then some ios speceific settings which I think are not important as my device is android.
[buildozer]
log_level=2
warn_on_root = 1
I created the apk file, installed it on my android device, but when I click on it, it just does not launch. I dont really understand why, I was thinking that I didn't pass requirements that enable the app to use internet connection, or that it does not launch because of my phone settings. How can I solve this issue? Any help is appreciated a lot.
UPDATE
I actually tried to install another python/kivy program on android phone not involved with web scraping, and it worked. So I guess I put wrong wrong requirements in the buildozer.spec. But I wonder if there are some requirements that MUST be included besides the module names that are used to build the app. Any help?
UPDATE ON UPDATE
I found this line in the buildozer.spec file:
#android.permissions = INTERNET
and I put that line out of comment. But still that did not help any way. After installing the app on my phone, it just won't launch. Now I have no idea what I can do to solve this issue. Any ideas or advices?
I am developing a custom Antivirus app, which will need Storage Permission, Root Access and having a custom Recovery like TWRP installed.
For granting Storage Permission, I can easily use ContextCompat or EasyPermissions. I would rather use EasyPermissions, since it is way easier for me.
Well, I searched almost the whole internet to find any library to check for Root Access. I literally found two libraries by Stericson. Now I have the RootTools and RootShell on my Android Studio Project. I can handle for Root Access. For those two permissions (Storage, Root): I can handle it.
Now, I know that somewhere in /dev/block can have the recovery image. But how can I determine, which one is installed? I mean, if my Antivirus App fails to scan and deletes critical files without even noticing it, then Android can say "goodbye". That's why I want to check if a custom Recovery (for example: TWRP) is installed or not, so it can recover deleted files.
Is there any dependency for it to check custom recovery or other way? I would really need it because I can't have all these reports on me saying that I made an app telling about it, that I damaged someone's device and need to pay for example, $200 away. Look, if I get a report saying that my app damaged that preloader / bootloader file on someone's device, then I would need to send any motherboard / phone replacement to that one, that got damaged. I would need to ask that person the address to send the replacement. Really, if I get a report coming from telling me that any kind of system or other image got broken, I'm outta here!
I am looking for the solution in Appcelerator, to check that the android device is rooted or not through coding or programming.
I am not able to find the way in Appcelerator to achieve this.
if anybody has done this please help to find out how achieve this.
i have found few solution for android native but how to make it possible in android Appcelerator
Determining if an Android device is rooted programatically?
how to find the rooted device programmatically?
Have a look at these two modules:
https://github.com/collinprice/com.collinprice.rooted
https://github.com/appersonlabs/RootFinder
you can use http://gitt.io to search for modules (e.g. you'll find those two when searching for "root" on gitTio)
You need to understand that the process of rooting the device is changing with time and is getting more and more smarter. Nonetheless we still can try to perform some basic checks to filter out a portion of it.
Instead of doing it from Appcelerator, create an Android module and do the following:
Try to execute the su command, Runtime.getRuntime().exec("/system/xbin/which su"); Also check for the same su command in bin too (/system/bin/which su).
If it returns a success, you know for sure that the device is rooted. But you need to be aware that these are not the foolproof way, but only one of the ways to test and filter out.
install root checker on android device
https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=4&cad=rja&uact=8&ved=0ahUKEwj1zsWc2vvKAhWB1BoKHXpQBA8QFggqMAM&url=https%3A%2F%2Fplay.google.com%2Fstore%2Fapps%2Fdetails%3Fid%3Dcom.joeykrim.rootcheck%26hl%3Den&usg=AFQjCNF5xeTKc4cWmWLWFs1WM19ABwlwhA&sig2=acMCp9r58lUvQHNqGQDk9A&bvm=bv.114195076,d.d2s
We are trying to weight the choice to either root or not the devices to run a very specific App.
What we want to know if permissions like WRITE_SECURE_SETTINGS, WRITE_APN_SETTINGS and the like that were usable on past versions of Android are available if we root our devices.
Thanks in advance!
To get straight to the point and answer your question, yes, it is.
Is there any neat way of accessing screenshot of android device
programatically. I am looking for some 15-20fps.
I found one code
android\generic\frameworks\base\services\surfaceflinger\tests\screencap\scr eencap.cpp,
i built the executable and put it in /data and changed the mode 777
but when i tried to execute it using adb shell it gives the below error.
# chmod 777 test-screencap
chmod 777 test-screencap
# ./test-screencap test
./test-screencap test
screen capture failed: Function not implemented
I also know that we can access fb0 but its not a right method as suggested
by android team. Is it possible to access the screen shot at the frameworks
layer. I beleive surface flinger composes individual layers and gives it to
framebuffer.Where exactly this is done ? Can a application be able to access
such codes.
There are some java apps also which use ddms to actually capture this
framebuffer data without root access. But the fps is really poor.
I beleive there should be some or the other way of doing the above job.
Please suggest me some neat way of doing it. Suggestions are welcome.
What you are trying to do is not possible if you don't have a rooted phone, there is an app out there that does what you are trying, Screenshot ER. The latest OEM's are putting it into their /system/apps now... so you may be able to use their apps, check out this article for devices that have enabled this feature. Other than that your really stuck but there are implications with screen captures enabled as this could lead apps saving screen captures and sending that info out, enabling virus type apps...
Information for others .....Through Eclipse you can get a screen capture usig the DDMS perspective. If you take a look at the Eclipse DDMS code base its actually a stand-alone app too. You might be able to use this Java code then.
AdbHelper.getFrameBuffer(AndroidDebugBridge.getSocketAddress(), this);
Take a look at droid VNC Server
This is an open source project which you can clone the source code to your private PC. (http://github.com/oNaiPs/droid-VNC-server). I am investigating how VNC can do but It's really hard to do the same.
Read framebuffer content is an good solution also. But it just work with android <3.x only. I don't know how to fix it to work on android 4.x. If you know how (after see my suggestion) please share it here. Through my researching, I see that there are a lot of people looking for this.
Hope this helps.
nguyenminhbinh1602#gmail.com.
Android Freelancer.