I am running Introspy android application for penetration testing of android app but i am unable to get introspy.db file from application's internal files.
I took reference from https://github.com/iSECPartners/Introspy-Android
I know this was asked a long time ago but in case anyone else who searches needs an answer:
I also had this problem when running Introspy on a Galaxy S4 running KitKat (4.4.2). I have ran Introspy with zero problems on a Nexus S running JellyBean (4.2.1). Because of this I believe it is an Android SDK problem with newer versions.
If you look at the AndroidManifest file for Introspy-Android Core, the targetSdkVersion is 18, which denotes Jellybean. I looked at logcat files and found that I was getting the error:
Permission Denial: get/set setting for user asks to run as user -2 but is calling from user 0; this requires android.permission.INTERACT_ACROSS_USERS_FULL
I simply added this permission to the Android Core AndroidManifest.xml file as well as the Android Config AndroidManifest.xml with the command:
<uses-permission android:name="android.permission.INTERACT_ACROSS_USERS_FULL"/>
I then just recompiled both binaries and it worked! Hope this helps.
Is Cydia Substrate for Android installed? (https://play.google.com/store/apps/details?id=com.saurik.substrate&hl=en). The SuperSU.apk (https://play.google.com/store/apps/details?id=eu.chainfire.supersu&hl=en) may also be needed to give root permissions to Cydia substrate. Upon installing Cydia Substrate and SuperSU, you can give root permissions to the Substrate application and click on "Link Substrate" button in the Cydia Substrate application. Then try to start Introspy Config and setup the appropriate methods to hook into. Hopefully, this should do it. Also, all of this assumes you have a rooted phone or emulator.
Related
I'm trying to run connected tests for my App using and Android ISO installed on VirtualBox. I got Android 7.1 ISO from http://www.android-x86.org/ . It is installed under VirtualBox and seems to be working correctly.
Our app uses PocketSphinx which creates some directories and stores some files in them. The app is working correctly on some Android 7.0 tablets and under the emulator that comes with Android Studio. Some of the time, it works correctly under VirtualBox, but it gets in some strange state where it cannot read or write to the directories it needs.
The AndroidManifest contains this permission (along with others):
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
The permissions show up as enabled in the Settings=>Apps=>[Our App]=>Permissions.
Here is the actual error message:
W/System.err: java.io.FileNotFoundException: /storage/emulated/0/Android/data/com.hcs.android.orconnect/files/sync/cmudict-en-us.dict (No such file or directory)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:221)
at java.io.FileOutputStream.<init>(FileOutputStream.java:169)
at edu.cmu.pocketsphinx.Assets.copy(Assets.java:224)
at edu.cmu.pocketsphinx.Assets.syncAssets(Assets.java:269)
If I set a breakpoint before this call, I can see that all of these return false:
new File("/storage/emulated/0/Android/data/").canRead()
new File("/storage/emulated/0/Android/data/").canWrite()
new File("/storage/emulated/0/Android/data/com.hcs.android.orconnect").canRead()
new File("/storage/emulated/0/Android/data/com.hcs.android.orconnect").canWrite()
However, something created the /storage/emulated/0/Android/data/com.hcs.android.orconnect/files folder. If I manually delete this folder from an adb shell prompt, it will be recreated on the next run of my App test, but the app still has the same problems.
I'm really at a loss as to why I'm having these permission problems. Any ideas on what is going on and how to fix the permissions?
(Note: I don't want to use the Android emulator, because we are running VirtualBox for other reasons and the two won't play with each other.)
(Note: Unsurprisingly, running the app from the debugger shows the same problems I'm seeing when I run the connected test.)
Steps to reproduce:
Set up and start VirtualBox image running the Android 7.1 ISO.
Run adb connect <ip address>
Run ./gradlew connectAndroidTest
Test will pass
Run ./gradlew connectAndroidTest
Test will fail and will fail for all future runs as well.
Work around:
Install the app (if not currently installed)
Twiddle the "Storage" permission in Settings => Apps => [My App]
Tracked the problem down to an inconsistency in Android's handling of permissions.
Our App's Manifest contained:
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
This results in /data/system/users/0/runtime-permissions.xml containing:
<item name="android.permission.READ_EXTERNAL_STORAGE" granted="true" flags="0" />^M
<item name="android.permission.WRITE_EXTERNAL_STORAGE" granted="true" flags="0" />^M
Read is granted implicitly. However, when writing a connected test, I used the grant permission rules:
#Rule public GrantPermissionRule permissionRule2 = GrantPermissionRule.grant(android.Manifest.permission.WRITE_EXTERNAL_STORAGE);
This, however, does not implicitly grant read permission. So, when the app was run for the first time on the VM, it was granted WRITE explicitly and READ implicitly. However, after gradlew ran the test for the first time, it would uninstall the app. Then the next test run would reinstall the app, but only grant it WRITE permission per the rules. Then the test fails as described above.
So, the solution is to ask for both read and write permission in the test:
#Rule public GrantPermissionRule permissionRule2 = GrantPermissionRule.grant(android.Manifest.permission.READ_EXTERNAL_STORAGE);
#Rule public GrantPermissionRule permissionRule25 = GrantPermissionRule.grant(android.Manifest.permission.WRITE_EXTERNAL_STORAGE);
Never mind that this doesn't match my AndroidManifest.xml file. Google's left and right hand never met, so the behavior is different.
Thanks, Google! /s
I'm trying to follow these steps to help figure out where my first Android app (using Android Studio, targeting a Nexus 9) is crashing:
http://developer.android.com/tools/debugging/debugging-tracing.html
I added Debug.startMethodTracing and Debug.stopMethodTracing to my main activity code in the recommended places. When I actually debug my code I get the following message in my "logcat" window.
02-17 11:40:34.418 15711-15711/com.mpr.myfirstapp E/artīš Unable to open trace file '/storage/emulated/legacy/seemore.trace': Permission denied
I'm not sure why this is, and I'm also not sure how in Android Studio to view the trace logs. Can anyone help?
NOTE:
It seems worth noting that (from the link)
Android 2.2 and later devices do not need an SD card. The trace log
files are streamed directly to your development machine.
So I'm not sure if the permission issue is on my dev machine or on the device.
Thanks for any help.
You can use the Android Device Monitor to trace from your dev machine.
Try adding these to your AndroidManifest.xml and let me know if the error is still there.
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
Then in terminal you want to run (if you're on PC the command would be different but similar)
adb pull /sdcard/seemore.trace ~/tmp
Then open up Android Device Monitor and open up the file, now located in
~/tmp/seemore.trace
you can start the Android Device Monitor using the command
./monitor
I added few songs using DDMS and in the emulator opened Dev tools->Media Provider and ran scan SD card but got the error msg : Dev tools has stopped. Any idea how to resolve this ? I tried creating new AVD also both in Eclipse and Android Studio , Genymotion . But same results. Can anyone help on how to resolve this?
On API 23 Emulator you can go to Setting => App => Dev Tools => Permissions , and check the permissions
Answering just in case it helps someone.
Giving permissions to Dev tools solves the issues sometimes but if it does not, one option is to download the files (songs or images) using browser on your emulator, if number of files is not much.
Worked well for me.
It seems that in the Nexus 5 image that comes with the latest version of Android Studio, the "Dev Tool" app does not declare the required <uses-premission> element in its manifest. If you filter the logcat by com.android.developer you will see this exception:
Caused by: java.lang.SecurityException: Permission Denial: not allowed to send broadcast android.intent.action.MEDIA_MOUNTED from pid=2331, uid=10023
Unfortunately there's not a lot you can do if you're not willing (or don't know how, as I admit I don't) to pull out the apk, unpack it, edit the AndroidManifest.xml, and pack it all back in. Use another image, or refresh the MediaStore using adb shell:
Refresh Android mediastore using adb
I installed Sl4A via this link : https://electrum.org/android.html
I wanted to run electrum on my Nexus 10.
installation went fine, electrum was working (send & receiving btc).
Then, I upgraded to Android 5 (last version, lolipop I think).
After that, I can't run any Python script via SL4A.
I checked logcat file, I saw some lines about permission & chmod, but not sure if it's related.
I just rolled to 4.4.4 and am having the same issue.
I dug into the error a bit more: seems the new "Sandbox of Safety" functionality on Android that is supposed to keep rogue apps from writing to directories they're not supposed to write to is preventing SL4A from writing to directories it probably should be able to write to - ie, SD card and such
I moved the files I was writing to to the SL4A directory on internal storage and my script worked again.
I would really like to see a better solution though
I generated an apk package for my android application. and I tried to install the package (apk) on android platform 4.1 (level 16) using the adb command but it genrates error:
Failure [INSTALL_FAILED_CONTAINER_ERROR]
when trying to run with eclipse (run button) for the same platform (4.1 level 16) it works without a problems
this behaviour is not reproduced for platform 2.1 and platform 3.2
You need to make changes in AndroidManifest.xml. The change which you need to do is. Change :
android:installLocation="preferExternal"
to
android:installLocation="auto"
this worked for me.
This will happen if android:installLocation is set to "preferExternal" and you have an AVD with a too small SD card. Increase the size of the SD card or change installLocation to auto in AndroidManifest.xml.
I got this error when I deleted my app after changing the MainActivity's name. idk if the app didn't install due to space issues or the phone thought the package is corrupt but deleting the dalvik cache and rebooting solved it for me.
INSTALL_FAILED_CONTAINER_ERROR is also returned when trying to install an apk that contains native libraries compiled for a different architecture.
Try running "logcat" from the "adb shell" after you get the error. If it reports a java IOException "Failed to extract native code" then you need to install the apk on an avd created for the native library architecture, or include native libraries in your apk for the architecture on your avd/device.
I wasnt able to change manifest of the build, so for me was the solution unmount SD card, install app and then mount it back.
i change installLocation="auto" in manifest but not work. I found problem in something wrong with my sdcard.
So, i change android:installLocation="preferExternal to internalOnly.
It work for me!
My issue got solved by wiping the emulator data