Android remote webview list of active sites is empty - android

I do some automated tasks an android over adb commands, at one part i need to access a webview inside the app and control it. Until now i did these things:
I get the running webview processes with this command adb shell cat /proc/net/unix
For each process i do a protforwarding with this command adb forward tcp:9222 localabstract:webview_devtools_remote_25866
I do a get request to http://localhost:9222/json and get an array with webvies accessible over this proccess (so i clould check the title and the attaced state to find the right one)
My problem is now that since a few days I always get an empty array. I still able to see the webvies at chrome://inspect/#devices and can connect.
Does anyone have an idea why i only get an empty array or know an alternative solution?

In the meantime I have found the problem. The app I control no longer uses a webview but a browser popup, so it can't be found via the search with webview.

Related

Unable to Inspect Object com.android.incallui.service.SecCallPopupService on Samsung J5

I have a problem that I think is related with Android permissions, however I need some of your expertise to confirm it.
I have testing the old Samgung J5(Not rooted) with Android 8.1.0, Appium 1.10.0 with UiAutomator2 and ADB 10.0.40 (In administration mode) on some Call Handling scenarios where I need to check if determined display elements (identity, call duration, hold activated, on transfer information, etc) are displayed to user. I have seen multiple solutions to do this task, inclusively using adb to do it, but lets focus only on this problem, using only the display elements (GUI).
Scenario, user receives call.
The com.android.incallui.service.SecCallPopupService comes into action:
User receives call
When I try to inspect the com.android.incallui.service.SecCallPopupService window the Appium cannot found it:
Appium Inpector
Neither on UiAutomatorViewer:
UitAutomatorViewer
On Comment link (xml dump) you can seen the display elements that Appium, and UiAutomatorViewer can "see". Same result was obtained by using the command adb shell uiautomator dump /data/local/tmp/uidump.xml
After that, I installed the Appium Studio and try out the Appium official "Inspector" and the result was:
Appium Studio Object Spy with full access to all display elements. Very intriguim... after some research I found the following package com.experitest.uiautomator.test (running in background) was immediatelly installed on the device when I clicked on Object Spy feature and I think that is responsible to retrieve all the interface elements.
On comment link (logcat) Some logcat logs after doind object spy on Appium Studio:
Analysing the logcat we can see that Appium studios was requesting
{"response":"true","params":[],"command":"richDump"} and the package uses
some kind of node:android.view.accessibility.AccessibilityNode. Maybe using something like the Acessibility Tree node to get the elements ? I don't know...
I have read some similar questions on Stackoverflow but some solutions involves to root the device or using de ADB (its not an option),
Tryng to su root the device and chmod 777 /data/local/tmp, but if it's really necessary, how then Appium Studio can read all display elements?
Do you know any other solution that allows me to get all interface elements without root the device? How can I call the "richDump"?
Thank You for you help.

Android how to set --unsafely-treat-insecure-origin-as-secure="http://example.com" flag

Please someone tell me how to get this flag working because I have tried a lot of things but none of those things worked. Firstly, I tried using the about:flags in google chrome but that seems to not work, because everytime I type the website inside it, it doesn't show when I restart.Secondly, I tried using adb shell but I dont know how that thing works, so I tried using this command :
echo "chrome --unsafely-treat-insecure-origin-as-secure="http://example.com" " > /data/local/tmp/chrome-command-line and it said that the folder is not existing Lastly, I tried to turn in about:flags the console command flag and than, when I typed the adress inside the unsafe flag it showed, but when I tried to access the website it still shows as insecure.
According to https://www.chromium.org/Home/chromium-security/deprecating-powerful-features-on-insecure-origins this flag requires root access on the device; it recommends setting up Chrome port forwarding instead.

Android gingerbread DHCP 119 setprop not working

I am try to set custom DNS suffix (yahoo.com in my case) using adb command
setprop net.dns.search yahoo.com
I verified it using
getprop net.dns.search
and it returns yahoo.com
However, when I type music in my browser and run tcpdump in the adb, here is what I get.
So, the query is actually "music.yahoo.com", but somehow, the android default browser says page not found
Why is it not going to music.yahoo.com when the actual query is that?
When I set the suffix to google.com and enter finance in my browser. It just opens google.com and not finance.google.com
Do anyone have any idea of what could be wrong? Any help is much appreciated!!
You are confusing something maybe. net.dns.search adds suffix to searched host names. You pass music, it will append yahoo.com. Ok, you got music.yahoo.com in DNS, but programs thinks it is music.
In HTTP, you specify which host you connect to. And there will be Host: music. Not music.yahoo.com. Server receives music and don't know for which virtual server it should be. Thus it uses default site as fallback.
Is there reason you want it to behave this way? It is intended to save your own time by setting your local domain. But it will not work well on public internet.

How to kill a not running process in Android

Does anybody meet this situation before? I force stop an app in the setting dialog in a Android device.
But when I use ps command via adb it is still displayed on the screen. But this process can't be get by the activityManager.getRunningAppProcesses(). This process even exists after I uninstall this app, It happened randomly.
Because I opened a port in my app using ServerSocket, the port can't be released after I stop my app.
The next time I tried to open my app, it failed to using this port again.
I am using a ASUS EeePad and this problem seems only happened on that device.
By the way, the process can't be get by any 3rd party tools such as process manager.
But it really exists with a pid when I use ps via adb shell to list all processes.
Since there is no code .. here are some hints :
1-do you close your connection ??? that will be the main reason to hold the port busy.
2- deal with socket more safely when your app going to pause , stop, or being destroyed .. you can override onpause,onstop, or ondesotry ..and free the port before closing the app.
3- make connection in a separated thread and implement a timer to check if you really need the port or not ( I mean if your app is alive or not ) and based on that kill/leave the thread (connection)
4- in worst cases .. if you have control over the other side of connection ( server, device .. ) try to make your solution more flexible like making range of ports to firstly check then use if they are available.
good luck

how can i use 'adb shell' command to know application response or current activity

I have created a batch file that fires adb shell command to start activity, send events to enter text into username and password text fields & click login buttons to navigate to other activity(screen).
how can i know that application navigate to other activity or want to know the response that tell me if login successful or not using shell commands.
Thanks,
Bhushan
Dollop, where I work, provides a record-and-play-back tool for Android that will do the things you suggest and save you the hassle of interacting with low-level shell commands. (It is currently limited to running on Windows in communication with Android devices). It's easy to configure and use, requires no programming, runs against real devices (which do NOT have to be rooted) and automatically saves screenshots as it plays tests. I'd love to hear your feedback.
try to get process (ps aux | grep xxxxx ) information to know the activity running or not

Categories

Resources