is it possible to disable the ADB debugging authorizations system? - android

I have rooted pixel device with android pie, I am trying to automate few things with ADB and I am struggling with an authorization issue.
manually it works, I connect to the device through ADB then I approve the auth key manually in the device.
when I am trying to automate this scenario I don't have any option to approve manually this. is there some way to disable this authorization? or maybe do some programmatically/adb manipulation?

Related

Is there only one way to run my Flutter app on a real Android phone?

I want to run my Flutter app on a real Android phone. I googled my problem and referred to this question.
This answer says I can do it using USB. But, I have a question, can I upload .apk file (build/app/outputs/flutter-apk/app-debug.apk) to Google Drive and download .apk file in real Android phone and run it?
I didn't share the code because I don't think the code has anything to do with this.
Is there only one way to run my Flutter app on a real Android phone? Or, is there another way? I would appreciate any help. Thank you in advance!
There are basically two ways before the app is released.
USB Debugging
Wireless Debugging
Connect via USB: adb tcpip 5555
Disconnect USB, Get Phone Ip Address Settings > About Phone > Status.
Now adb connect <Your IP Address>
#Credit : Harpreet Singh
Refer:
How to connect a device with ADB over WiFi when making app with Flutter?
https://appmaking.com/run-flutter-apps-on-android-device

enable adb via adb sideload

Following scenario:
I have a unrooted (stock) android phone (Samsung) and I need to enable adb, but I don't have access to the device (forgot the lock code).
Is it possible to enable adb debugging via adb sideload from recovery?
For example creating a update.zip, that enables adb or installs an app, that enables adb on boot?
Thanks
Is it possible to enable adb debugging via adb sideload from recovery?
No. Your app would need special permissions to do such a thing. Obviously if an arbitrary app was able to turn on adb debugging without asking the user that'd be a bad thing.
As a side note, this sounds like what someone would ask if they had acquired a phone that didn't belong to them. Not that this would change the validity of my answer.

ADB shell not detecting device if not logged on host (SSH'ing into host before logging in)

Not sure if I'm using the right terminology but I'll be happy to fix it!
Anyways, I'm attempting to use a linux box as my testing host which has all my android devices connected to it and devices can be seen using, 'adb devices'. However, if there is a power failure or auto update which resets the host, the computer boots up but is not logged in. At this state, I am able to ssh into the host but when I execute, 'adb devices', I cannot see any devices. Only after I login can I see the devices again.
Would anyone know a workaround to this by any chance?
I have rules setup as room under /etc/udev/rules.d/51-android.rules
The questionable item is that I have /Users/kev/.android/adb_usb.ini which may be causing the problem. but if I ssh in using that account, wouldn't it be the same as logging in the gnome login?
thanks!

I need to debug my Android app while not plugged into my computer

So, let me start off by saying that I am 'relatively' familiar and comfortable with making Android apps and using both LogCat and DDMS to debug.
That being said, I'm encountering more of a logistical issue than anything else right now - I am making a locative app, where the GPS is fuelling and controlling other methods in my Activity, and after a while, it is crashing.
Now, because it is locative, I am walking around to test it, in order to receive different GPS locations. Because of this, I am not connected to my computer at the time that it crashes, so have no way (that I know of) to read the stack trace, etc.
In my particular instance, I am navigating through a series of activities, and finally reach the penultimate screen in my app, and while I am running the application in my studio, it runs indefinitely without issue. It is only when I take the device outside that it crashes...
I am wondering if anyone has any tips or tricks with this issue - I'm sure give the prevalence of locative apps, it must have come up, but I cant seem to find the right search terms. It could be as simple as saving the LogCat to file, and/or the stackTrace, but I'm not sure that's the answer...
Thanks in advance.
If I got you right, this is what you are looking for:
https://play.google.com/store/apps/details?id=org.jtb.alogcat&hl=de
Edit: Also there are many more apps like this. You can just browse around in Google Play Store
You can debug the app without rooting your android, unlike the other responses. start off by plugging the android into your computer, then run adb devices to make sure the device is there. Then, run tcpip 5555 to change the android to tcp mode, which will allow debugging over wifi. Disconnect the android from the computer, and connect to it by typing adb 192.168.x.xxx, replacing the x's with your android's IP address. It should connect with no issues, as long as port 5555 is open, and both the android and your computer is on the same wifi.
Simple: Wireless ADB
One of the reason that I choose to run CyanogenMod on my testing devices is that it is a stripped down version of Android that has some additional developer tools, one of those being the ability to access the wireless portion of the ADB system.
As you are probably unaware, you are able to establish an ADB connection to your device over WiFi, however, if running a stock ROM, this requires root access, as it can be potentially harmful to your device, as Wireless ADB will work even over your cellular network, meaning that you could potentially receive apps from other insert carrier here's devices.
If you wish to run WirelessADB, here is a Play Store app that will help you to enable the feature on your device. Requires ROOT
It is as simple as connecting your device to your local WiFi network, (same one the development computer is connected to), enable Wireless ADB, and then running the following command on your computer:
adb connect 192.168.1.101
Replacing 192.168.1.101 with the IP address of your android device.
By establishing this connection, you can run everything just as you would if the device was plugged in via USB Cable.
I recommend ACRA (Application Crash Reports for Android ). It allows you to send crash reports to a number of different destinations. See https://github.com/ACRA/acra/wiki/BasicSetup

Android USB reverse tethering: How to fool the apps

USB reverse tethering = Cellphone gets network connection from PC via USB.
I know how to do USB reverse tethering except for one problem: Many Android apps will check network connection using the code below before doing any useful work:
ConnectivityManager connectivityManager = (ConnectivityManager)context.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo info = connectivityManager.getActiveNetworkInfo();
The problem is that, when using USB reverse tethering, the above code will report no network connection. However, there IS a network connection (which is the USB reverse tethering itself), and ping, wget and all programs not doing this stupid check work well.
So the question is: How can I hack the system to let this network connection check return success (so that I can fool these apps)?
BTW. I use Cyanogenmod 7. And any solution specific to this MOD is also welcome.
If you are doing this much hacking I am assuming that you will probably have your device rooted. If so program a shell interface to send commands to the device shell with JNI and receive STDOUT. Use this interface to run a netcfg command that can be parsed into an array - this will give you all the details the API hides. It also allows you to override Androids device settings using the ipconfig command.
As far as using this to send and receive from your device - in my experience - you will have to probably compile a device specif module that can be loaded into the kernel at run time. Or just download the kernel from the manufacturer and compile the module into the kernel and then flash the phone with the new custom kernel.
Hope this helps.
To do this , you have to download ReverseTethering_3.19.zip file (Google it to find the link.)
Extract to your desired location.
Prerequisite: -
only rooted phones work.
USB debugging should be enabled.
Now connect your rooted android mobile to PC through USB cable.Wait for PC to recognize your mobile. Now open the extracted zip file and open AndroidTool.exe with admin rights.
Now click connect in the android tool.
Now it tries to connect and installs USB tunneling apk on your device.It also asks for super user rights . Grant it.
Finally after successfully establishing the connection, you will see.
https://drive.google.com/file/d/0B11p07T8VxhNNUdIM3gtTFR4N3M/view?usp=sharing
(Sorry, I cant upload image.)
Now you get the internet on your mobile and usb tunneling app is installed.But you can access only HTTP connections(i.e;) works only in chrome. Play store apps may not work.
So you have to fool apps and make it believe that either is mobile is connected to WiFi or mobile data . Only then apps work.
So you have to go to Tools menu in Android tool.
https://drive.google.com/file/d/0B11p07T8VxhNRXR3aTVUZUl1dVk/view?usp=sharing
Now install hack(optional).It installs Xposed framework and installs hack connectivity apk. Just follow the instructions , it is easy.
Hack connectivity makes the apps believe that mobile is connected to WiFi or mobile data depending on which type of hack u did after installing Hack connectivity. Finally after hacking ,it asks for reboot. After reboot , you can enjoy internet using USB reverse tethering on all apps.

Categories

Resources