Does anyone know of a Netstat App with a Kill process feature? - Android Q&A, Help & Troubleshooting

Hi,
I've been trying to find a decent terminal with many netstat options, but havn't had much luck. So im wondering if someone knows of an app that has netstat ability with the ability to select and kill established processes linked to certain connections.
If not, do you know of a terminal that includes all the netstat options?
Thank you for your time.

Shouldn't netstat functionality be determined by your binaries (busybox) rather than the terminal app you're using?

Yeah, I believe that is right, but it seems that the PID option is not working, and am wondering if you know of a binary, app, etc. that allows this option.
I use SManager and installed BusyBox.

segomyeggo said:
Yeah, I believe that is right, but it seems that the PID option is not working, and am wondering if you know of a binary, app, etc. that allows this option.
I use SManager and installed BusyBox.
Click to expand...
Click to collapse
Try Busybox installer by stericson, netstat -p works fine for me with it. However make a backup first.. It killed my GS2 T989 the first time I installed it.

which terminal are you using? that is the busybox i have installed.

do i understand correctly?
you want to see devices connected to your wifi...
and have the option to block them individually?
theres an app i have that does just that and it works! i use it at work to stop customers from downloading movies on our free wifi
its called wifikill heres a link http://forum.xda-developers.com/showthread.php?t=1282900

Related

[Q] Hide root / su from another application?

My company has a policy for our company email application (Good) that doesn't allow the application to run if a phone is rooted. Brilliant, the application is password protected and has remote wipe capabilities, but that still isn't enough for them! Which means I'm stuck carrying two phones around. I would like to either hide superuser/su/root from the phone when I'm not needing the escalated rights, or just block it from seeing it completely. Therefore I need your help. Any thoughts/suggestions work arounds would be much appreciated.
I'm currently running (about to upgrade to a new ROM, but not sure which):
Samsung Galaxy S Captivate
MODEL #: SAMSUNG-SGH-I897
FIRMWARE: 2.2
BASEBAND VERSION: I897UCJI6
KERNEL VER: 2.6.32.9
BUILD #: COGNITION.V2.3B8
One last thought if I can get this accomplished. I might be that I might be looking to get the new Samsung Infuse 4g (AT&T), since I'd finally be consolidating to 1 phone.
bump this thread!
I'm really hoping someone has some kind of answer for me here.
Okay maybe I'm being over simplistic, but why can't you use a different mail app? Or if you can't do that go into outlook rules and redirect your email to another account, use K9 as your mail app change your identity in K9 so it looks like any emails are coming from your work account, and set the reply to email address in K9 to your work address.
That's what I do to access my work email.
Sent from my SAMSUNG-SGH-I897 using XDA App
Yeah I hate to say this, but if it were that easy I would have done it already. We don't allow auto forwarding of all mail externally. We also don't expose any email externally without 2 factor authentication via OWA. Therefore automating an app (like touchdown) to pull down the mail is practically impossible. The company is being so gracious by "allowing" us to give up our corporate blackberries and use our personal phones with the "Good" application. This gives them the control and sense of security (albeit false) by enabling the password, password changes, and remote wipe capabilities. Therefore they don't allow rooted phones. SUCK!
You know, this would be a good feature to get around the movie rental block on rooted phones as well...
Find out how it's checking for root. Is it searching EVERYWHERE for su? (If it were, i'd hate your developers, because that's just stupid. Waste of phone power.)
I'd imagine they're either asking for permissions (you'd know if they were) or they're searching to find the su binary.
I'd suggest you find a way to move SU from where it is right now, and make sure all apps that need it know where to look for it.
I think it's just looking in the paths, because I am able to rename/move the su binary from within the terminal emulator, and suddenly the root-checking apps work again. However, other apps which require su will break.
I think the solution would be to create an app which does nothing but this:
1) Rename/hide the su binary
2) Launch the requested 3rd-party app (in this case, the enterprise e-mail app)
3) Once the app activities have been destroyed, restore the su binary
That might work, as long as the 3rd-party app doesn't require root.. ^_^
--W5i2
weasel5i2 said:
I think it's just looking in the paths, because I am able to rename/move the su binary from within the terminal emulator, and suddenly the root-checking apps work again. However, other apps which require su will break.
I think the solution would be to create an app which does nothing but this:
1) Rename/hide the su binary
2) Launch the requested 3rd-party app (in this case, the enterprise e-mail app)
3) Once the app activities have been destroyed, restore the su binary
That might work, as long as the 3rd-party app doesn't require root.. ^_^
--W5i2
Click to expand...
Click to collapse
I wonder if it would be possible to create an app to do this automatically whenever a certain app is loaded (e.g. when the email app is launched, a background process automatically renames su, and then when it's closed, the background process kicks in again to rename it back to su).
Actually, now that I think about it, Tasker might be able to do that...I'll look into it...
EDIT: Yup, managed it with Tasker. Install Tasker if you haven't already (there's a week trial available here: http://tasker.dinglisch.net/), and load up the app.
In the "Profiles" tab, hit the + button at the bottom to add a new profile and give it a descriptive title (e.g. "hide root"). It'll then ask you to select a context, select "Application", and then choose the app you want to hide root from and click the tick. It'll then ask you to choose a "Task". Select "New task". Give it a name (e.g. "hide root") then click the "+" in the window that appears. Choose "Misc", and then "Run shell". The first command to run is something like this:
Code:
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
This will remount /system as RW (i.e. allow you to write files on the system partition). The command may vary slightly for your phone, the parts that are likely to change are "mtdblock3" and possibly "yaffs2". The correct parameters can be found by running the command "mount" in either terminal emulator on the phone or over an adb shell, and look for the /system entry. You should probably make sure you get the right command here, it's probably a bad idea to mess with remounting without the right command.
Enter that command and tick the "use root" box, then press the tick at the bottom.
Do the same again, only this time the command is:
Code:
mv /system/bin/su /system/bin/mu
(again, tick "use root").
Now click the tick at the bottom of the "Task Edit" window. You should now be back at the profiles list, with the name of the app you want to hide root from on the left and the task you just made on the right with a green arrow. Press and hold down on the task and you'll be given the option to "Add Exit Task". Select this. Choose "New Task" and call it something like "show root". As before, add an action to the task, go to "Misc" and then "Run shell". This time, the command is:
Code:
mu -c 'mv /system/bin/mu /system/bin/su'
Don't tick "use root" this time. Click all the ticks to get back to the profile list. You should now see your profile with the app name on the left and two tasks on the right, one with a green triangle, one with a red. Make sure the box at the top right of the profile is showing a green tick (if it's a red circle with a line through it, tap it once), then tap the green tick at the bottom left of tasker. the su binary will now be automatically renamed when you launch that app, and renamed back when you leave it. (you can add more than one app, and you can add more apps later). I tested this with terminal emulator, typing "su" gave "command not found". I then left terminal emulator and loaded Titanium Backup, which worked perfectly, indicating su had been restored correctly. (I think if you use a task switcher and leave the app running in the background, you may have issues). The first time you exit the app, you will get a superuser (or SuperSU, if you use that) prompt for permission. After that you won't.
If you need to disable the root hiding, just tap the green tick beside the profile name in tasker, it'll turn into a red circle with a line through it and it will no longer be active.
Hi,
There is an app called hide my root. The problem is you would have to ensure you run it when needed. And it does work. At least I was not able to launch apps needing root.
Hope that assists a bit.
Sent from my Xoom using XDA Premium HD app
use TouchDown
nposix said:
use TouchDown
Click to expand...
Click to collapse
OP can't use TouchDown because it doesn't support 2-step OWA authentication.
Seems like the proper solution here is to hide the su/superuser.apk/etc files from specific apps, not rename them/etc (which breaks root access for everything on the device, even if only temporarily).
I don't think that this is straightforward to accomplish via namespaces, unless you want to go cloning the whole bin/data directories (if you did that then you could bind-mount them in a namespace only visible to particular apps. Most of the namespace functionality applies at the directory level only.
Another approach would be to just put some code in the kernel that checks uids against some kind of blacklist and just hides the file, just as any rootkit would.

Tool/App to hide that my 3D is rooted from other Applications?

I have a application (Good Enterprise mail client) that will not run on my phone since it is rooted. I have heard that a few other application like this out there. Is there a way to hide the fact my phone is rooted from these types of applications?
Thanks in advance
OrionNE
OrionNE said:
I have a application (Good Enterprise mail client) that will not run on my phone since it is rooted. I have heard that a few other application like this out there. Is there a way to hide the fact my phone is rooted from these types of applications?
Thanks in advance
OrionNE
Click to expand...
Click to collapse
i thought about creating an application to do this. the concept is very simple.
the only way they check to see if your device is rooted, usually, is whether or not a file is present at /system/bin/su.
they usually dont even test to see if the /system/bin/su file has root permissions or properly functions. only if the file exists with that name, su, in that directory, /system/bin.
simply rename your su file to any other name, example: jk.
next time you need su access, simply type jk in the shell instead of su, and you'll get root access.
also, if you are curious, grab my root checker application from the market, advanced mode will tell you all the details which can be gathered about the root configuration on your system.
you think it would be helpful to have an application which would make it convenient to hide root?
Super user has an option called ghost mode. It hides the icon. To get it back, you type in a specific number pattern in the dialer.
Via My HTC Evo 3D On The Now Network From Sprint.
Theres no way to hide it from goog though, right? So as to be able to rent movies from market legally?
Sent from my PG86100 using xda premium

[Q]Stop Greenify when Wifi is on

Hello.First of all,I am sorry if this question has been asked before,but I was not able to find it.
Is there any way turn Greenify on only when Wifi is turned off,and then if I turn Wifi on,Greenify to stop?
Thank you very much!
chris_b0ss said:
Hello.First of all,I am sorry if this question has been asked before,but I was not able to find it.
Is there any way turn Greenify on only when Wifi is turned off,and then if I turn Wifi on,Greenify to stop?
Thank you very much!
Click to expand...
Click to collapse
Use Tasker or similar app.
Thank you for answering !
is Tasker compatible with Greenify ? I ask,because I've never used Tasked,and I don't know a lot about it
chris_b0ss said:
Thank you for answering !
is Tasker compatible with Greenify ? I ask,because I've never used Tasked,and I don't know a lot about it
Click to expand...
Click to collapse
Yes, Greenify has a plugin for Tasker.
This is misleading wrong information.
The plugin for tasker only lets you wake up an app or hibernate one app or all greenified apps. It does not let you 'pause', 'stop', 'resume' or 'start' greenify.
Edit:
Tasker could be used to kill it and restart it later, but in my quick testing it looks like greenify doesn't like being killed.
Tasker *could* be used alongside Secure Settings (yet another app) or using command line code to disable greenify's package (the whole app will disappear) when Wi-Fi is connected, and then re-enable it when Wi-Fi is disconnected. This would need you to have a rooted device. This method would be quite complicated, but do-able. It works in my quick testing, but explaining how to achieve it would need a full tutorial. It would remove your home screen shortcuts whenever the app is disabled. Disabling is easy. Enabling is complicated. You'd have to set tasker to unlock your screen using whichever lock screen method you have, and then open greenify, click on the message at the bottom that says the service is not running, then close greenify and lock your screen again. There could be unexpected side-effects of doing this. I cannot get into a deeper explanation than this because it would be a time sink.
Sukarn said:
This is misleading information........
Click to expand...
Click to collapse
The proper word would have been "wrong" not "misleading".
" Misleading" has a bad connotation implying that the info was supplied with the knowledge that it was not true. The fact is that I don't use Tasker and presumed (may be wrongly) that since Greenify has a plugin, it should be possible to hibernate and unhibernate apps enmasse.
Please be careful in usage in future.
The correct way to disable auto-hibernation is to disable the "CleanerService" of Greenify.
As shell command (requires root):
Code:
su -c pm disable com.oasisfeng.greenify/.CleanerService
To restore:
Code:
su -c pm enable com.oasisfeng.greenify/.CleanerService
su -c am broadcast -a android.intent.action.BOOT_COMPLETED com.oasisfeng.greenify
oasisfeng said:
The correct way to disable auto-hibernation is to disable the "CleanerService" of Greenify.
As shell command (requires root):
Code:
su -c pm disable com.oasisfeng.greenify/.CleanerService
To restore:
Code:
su -c pm enable com.oasisfeng.greenify/.CleanerService
su -c am broadcast -a android.intent.action.BOOT_COMPLETED com.oasisfeng.greenify
Click to expand...
Click to collapse
Thank you. I couldn't find an obvious way to disable a service without disabling the whole package. I knew how to disable a package using command line but not a service.

Amazfit Pace - Stop running APPs on Watch - safe power?

I think there is no way stop Running Apps, spec. 3-Party Apps like 'All In One Offline Map' or 'calculator', directly on the watch.
Of course I can do it remotely via adb shell -> am force-stop ... but of course this does not help in daily life. Therefore this Apps are running forever unless Power Shutdown of the watch.
Or does someone know a different solution? It would safe quite some power and CPU load.
E.g. an App for mobile hhone to controll ADB via bluetooth?
I would appreciate it much more if the stop-running app function would become part of the watch launcher.
gswolf said:
I think there is no way stop Running Apps, spec. 3-Party Apps like 'All In One Offline Map' or 'calculator', directly on the watch.
Of course I can do it remotely via adb shell -> am force-stop ... but of course this does not help in daily life. Therefore this Apps are running forever unless Power Shutdown of the watch.
Or does someone know a different solution? It would safe quite some power and CPU load.
E.g. an App for mobile hhone to controll ADB via bluetooth?
I would appreciate it much more if the stop-running app function would become part of the watch launcher.
Click to expand...
Click to collapse
Install one of these on the watch. It can kill running 3rd party apps.
https://play.google.com/store/apps/details?id=wear.taskman
https://play.google.com/store/apps/details?id=rocketstartups.weartaskmanager
Working Taskmanager
anox said:
Install one of these on the watch. It can kill running 3rd party apps.
Click to expand...
Click to collapse
The above referenced task managers do not run on the watch.
But I have found a working alternative which works for 3rd party apk too.
amazfitcentral.com/wp-content/uploads/2017/08/amazfitcentral-taskmanager.apk
gswolf said:
The above referenced task managers do not run on the watch.
But I have found a working alternative which works for 3rd party apk too.
amazfitcentral.com/wp-content/uploads/2017/08/amazfitcentral-taskmanager.apk
Click to expand...
Click to collapse
Sorry, mate. I must have been in a hurry to assume you knew how to make Android Wear apps run on the watch.
The one you found is the same one as the 2nd app I referenced. It's a modified watch part apk of the app.
If you're curious how, here is the link (registration required).
http://roundandroidwatches.proboards.com/thread/1369/android-wear-apps-work-tygryst
I am aware of the tutorial - how to convert the android wear apps that they run on Android. Unfortunately I do not have the APK Editor Pro version (paid) and the free version does not allow the modification of the APK manifest. Could you recommend a free version of a APK editor Android or PC (Windows) which is working too?
gswolf said:
I am aware of the tutorial - how to convert the android wear apps that they run on Android. Unfortunately I do not have the APK Editor Pro version (paid) and the free version does not allow the modification of the APK manifest. Could you recommend a free version of a APK editor Android or PC (Windows) which is working too?
Click to expand...
Click to collapse
On Windows, you can use both of these.
https://ibotpeaches.github.io/Apktool to modify.
and https://github.com/patrickfav/uber-apk-signer to sign.
Personally, I don't use any of apk editor for this purpose. Simply take the inside apk and install it on the watch. Works perfectly.

General [WORKAROUND] Delayed/missing notifications on some GSI images

Hey everyone, today i want to share a not so pretty but working workaround about an issue that seems to be happening on some GSI images on this device (and its predecessor as well, the Note 10S which i used to own!), and i also want to collect some data from some more knowledgeable people about this so we could get a proper solution.
The issue is that when the device is left locked and idle for around 5 minutes, apps lose network connectivity so not only you get issues like Spotify not playing anything anymore after the last played song before the phone lost connectivity, but most importantly app notifications can be delayed by a few minutes, sometimes even an hour or more, or just never get to you until you unlock the phone and either wait a bit or open that app yourself. After the device enters Doze, and after it is unlocked to exit it, it takes a bit but not too long before your notifications all come in again. This does NOT happen when the device is connected to a power source.
If you have this issue, a not-so-pretty solution i found at least for now is running the following ADB command from a computer:
adb shell dumpsys deviceidle disable
Click to expand...
Click to collapse
This disables Doze entirely until the next reboot (after every reboot you need to run this again or Doze will kick back in).
Now your device will never enter Doze for your current Android session, battery life doesn't seem to be impacted much if at all, but it's better to have less battery life than not getting important messages.
EDIT: At first i was blaming Doze being broken directly, but this seems to be related to a BPF bug in the MediaTek kernel, and it depends on the device manufacturer if they have merged the fix or not. I tested the same GSI on A12 MIUI, and it still has the bug (along with many other bugs which is why everyone tells you to flash A11 before you flash any GSI), so Xiaomi did not fix it yet.
This bug causes mostly networking issues, some ROMs like LineageOS 20 not having network due to Restricted Network Mode causing no network like that post says (workaround for that too there), Battery Saver completely killing the network and probably this issue. After some thinking, Doze actually is working fine (Spotify only stops playing when it tries to get a new song from the network, the song it already got keeps playing even on Doze), it's just the network in apps while on Doze that dies. I tried the same exact GSI on a SD device, and there are zero issues there. There also were no issues on A11 and A12 GSIs on my old Redmi Note 10s, which is also affected by the same sleep bug on A13!
For this particular issue, you can use that adb command, but be aware that other networking issues like the above might exist.
There are some other workarounds like unlocking the phone ever so often before it exceeds 5 minutes staying locked, which is just painful, or leaving it always connected to a power source which isn't always viable, so those are out of the question.
If anyone with more knowledge knows the cause of this and/or a less "bandaid" fix, feel free to reply here, it would be much appreciated both for me and other users with the same issue!
U are my man. i thought its a problem like that, but i dont figured out how to prevent.
i will test this and report if its working.
isnt it possible to run it as bootscript?
lurchiii said:
U are my man. i thought its a problem like that, but i dont figured out how to prevent.
i will test this and report if its working.
isnt it possible to run it as bootscript?
Click to expand...
Click to collapse
I think it's possible to run it as bootscript but i think it requires root and i don't know how to do either of these yet, sorry. Hopefully someone more experienced can help us
I tried this using termux(with su) and It works for now, I'll write in a few days if it still works
i tried to make a magisk-bootscript and it will be executed (according on magisk log) but when i checked with "adb shell dumpsys deviceidle enabled" it shows "1" but when i executed it manually with termux it shows "0". Idk why it dont worked on boot.
lurchiii said:
i tried to make a magisk-bootscript and it will be executed (according on magisk log) but when i checked with "adb shell dumpsys deviceidle enabled" it shows "1" but when i executed it manually with termux it shows "0". Idk why it dont worked on boot.
Click to expand...
Click to collapse
Hm that is weird, i have no idea. I never tried running the command from the phone itself, i usually just used adb on a computer. The output i got from the command was something along the lines of
"Light idle mode disabled
Deep idle mode disabled"
(may not be exact message but you get the point)
Try running the command from a computer and see if it works, should work fine there.
from pc or from termux its np but from a bootscript it wont work. i think dumsys command can only be executed after boot or something?
it seems im not alone on the whole wide world:
Execute a script at boot
Hello, I'd like to execute a easy script at every boot of the phone so basically I've placed the script in the folder /sbin/.magisk/img/.core/service.d/doze.disable.sh I've tried also putting it in...
forum.xda-developers.com
but i found these interesting commands + module:
Universal GMS Doze - Magisk
Systemlessly prevent unnecessary GMS running in the background, optimized and adjusted with additional modified services.
themagisk.com
lurchiii said:
it seems im not alone on the whole wide world:
Execute a script at boot
Hello, I'd like to execute a easy script at every boot of the phone so basically I've placed the script in the folder /sbin/.magisk/img/.core/service.d/doze.disable.sh I've tried also putting it in...
forum.xda-developers.com
but i found these interesting commands + module:
Universal GMS Doze - Magisk
Systemlessly prevent unnecessary GMS running in the background, optimized and adjusted with additional modified services.
themagisk.com
Click to expand...
Click to collapse
Hm, that module actually looks like it limits some apps in the background, which is what exactly triggers this issue. Basically whenever the OS tries to limit network for some apps, it's bugged due to the kernel and instead of limiting it only for some apps it limits it on all apps and it happens on Doze, battery saver and restrictive network mode. About trying to run it as boot script, i haven't tried, but yeah it probably needs to be ran once the OS is fully booted.
SuperLolMine said:
Hm, that module actually looks like it limits some apps in the background, which is what exactly triggers this issue. Basically whenever the OS tries to limit network for some apps, it's bugged due to the kernel and instead of limiting it only for some apps it limits it on all apps and it happens on Doze, battery saver and restrictive network mode. About trying to run it as boot script, i haven't tried, but yeah it probably needs to be ran once the OS is fully booted.
Click to expand...
Click to collapse
i mean that command under "Troubleshooting"
lurchiii said:
i mean that command under "Troubleshooting"
Click to expand...
Click to collapse
Oh yeah, that still controls doze, but basically the issue with BPF bug is that the OS can't restrict network for only some apps because then all apps lose network connectivity. I'm not sure if adding an app to the Doze whitelist may work, and even if it did you'd have to do it for every app you want notifications for. At least adding to the whitelist is permanent instead of the disable command which is temporary, but i'm not sure it will work, i think the best thing for now is trying to find a way to run the command at boot or at least from the phone itself without needing a computer.
Thanks for the idea though, sadly i can't test the whitelist right now as i'm back on MIUI (probably going back to PE soon)
SuperLolMine said:
Oh yeah, that still controls doze, but basically the issue with BPF bug is that the OS can't restrict network for only some apps because then all apps lose network connectivity. I'm not sure if adding an app to the Doze whitelist may work, and even if it did you'd have to do it for every app you want notifications for. At least adding to the whitelist is permanent instead of the disable command which is temporary, but i'm not sure it will work, i think the best thing for now is trying to find a way to run the command at boot or at least from the phone itself without needing a computer.
Thanks for the idea though, sadly i can't test the whitelist right now as i'm back on MIUI (probably going back to PE soon)
Click to expand...
Click to collapse
to run the command without PC and without repeatedly typing it, i use Script Manager:
Script Manager | F-Droid - Free and Open Source Android App Repository
An application to manage shell scripts!
f-droid.org
Add a new Script and type:
#!/system/bin/sh
dumpsys deviceidle disable
Hit save and apply.. done
lurchiii said:
to run the command without PC and without repeatedly typing it, i use Script Manager:
Script Manager | F-Droid - Free and Open Source Android App Repository
An application to manage shell scripts!
f-droid.org
Add a new Script and type:
#!/system/bin/sh
dumpsys deviceidle disable
Hit save and apply.. done
Click to expand...
Click to collapse
Oh, i didn't know about this application, thank you! I usually had to use a pc when i reboot my phone for whatever reason so it's nice to at least be able to do it from the phone. I wonder if a boot script can be made with maybe another app that runs a little bit after startup
i tried with :"sleep xx" but it wont help.

Categories

Resources