[Q] Samba net rpc command implementations in Android API? Does it exist? - Android Q&A, Help & Troubleshooting

So, on most linux distributions that have samba pre-installed, there is a command "net rpc ..." that lets me run remote procedure call commands on windows systems. Primarily remote restart/shutdown "net rpc shutdown ..."
This comes in handy if I have alot of computers in my house to remotely restart, I even made a python script that parses a list of IP/host addresses and sends a restart command to them recursively.
Now, its a bit cumbersome to pull out my computer (on either windows or linux) and run these commands to give a quick restart to all my computers. Is it possible to implement some of this functionality into an android app? I've googled everywhere trying to find a implementation of this function, but all the apps that people make require some form of extra software to run on the windows PC's to allow the android app to send commands. I want to use the built-in WMI on windows machines, and not have to worry about some extra software running in the PC.
If anyone has any ideas or snippets of code, i'd love to hear it. If possible, it would be interesting to figure out how to write scratch code to construct RPC commands to send to windows hosts.
(I also have a far fetched idea of having a remote restart android wear app that i can press while in my house to restart all my computers! Taking convenience to the next level)

Bump, and I hope bumping isn't against the rules. Its just that this thread has had no views in the past 3 days.

Did you find any ressources on this subject ?
I'm search to do the same things as you, try to shutdown PC remotely from Android with help of net RPC shutdown
Please let me know if you have any Progress on this way
Sorry for my english i'm french...

I would be interested in that too
Sent from my sumire using XDA Labs

Related

[Q] Phone Audit with desktop application

If anyone is familiar with Speccy for the PC they know more or less what I am looking for.
I am looking for an app that does a thorough audit of a phone (Android platform) but not only displays it on the phone (plenty of apps do that). Id want it to export the audit to a file that can then be opened on a desktop application with a easier to navigate and study interface.
Currently like I said there is a number of applications that can do part of this as an added feature, but I have not seen any dedicated app to do an audit of the phone, things from programs, spaced used, network, hardware, permissions for particular programs, etc. Id like it to be as thorough as possible, but to be viewable in a reasonably ok interface on a desktop.
Browser maybe preferably for the linux and iOS users so that it isn't tied down to one Operating system.
Any ideas of something like this, or anyone working on something similar?
sorry for reviving this thread but I'm interested as well.

How to add console interaction to a android application

I already have a working application, but i would like to add the ability to control it via command line. The closest thing that I have found is the java development bridge which allows normal debugging through command line. I was wondering if anyone has used the jdb for automation, or found a better alternative.

[Q] communication between android app and java application

Hi all,
Im new in this forum and just wanna ask for some help on where can i find a simple tutorial or a sample project of an android application that can communicate with a java application on a PC.
im thinking via wifi.. also i got some knowledge in java programming and right now im starting to learn more about android development.
some simple tutorial/samples like an android app where you have to type a message and it will show on the java application when the send button is clicked.
Hi Wakkana,
If you want to communicate with your own computer on your local network, it's the most easy.
On your Android client, you have just to open a HttpURLConnection (see URL, URL.openConnection(), URL.setRequestMethod()) and check if the result is == 200 (if it's okay) or not. On your computer, you'll need to manage a connections server. There are good libs to do that, Netty for example, with really easy examples.
If you want to communicate with your own computer from an external network, you have to redirect from your box a port to your computer/server port, and use the box IP in the Android client.
BUT, I'm not sure xda is the best forum to speak about network programming (without a custom ROM for example)...
Try to get good java basis before start to learn Android

Interface Android application with Termux on the same device

Greetings. This is my first post; if another forum would have been more appropriate, please let me know.
My team has developed some machine learning software on Linux, mostly in Python, and mostly in the area of image and speech processing. Much of our input comes from Android devices, which exchange data with the backend server. Due to latency and other issues, we would like to look at putting our machine learning software on the Android device itself. Termux looks like an interesting solution; perhaps you know of other Linux shell apps.
My main question is: For communications between the "real" Android app, typically a Java program developed with Android Studio, and the "Linux machine" on the device, is the Linux instance treated like another system, with its own IP? Or is there a way to communicate directly between, say a camera app on the phone and the Linux instance?
btw, I am aware that Android OS is a Linux variant, so perhaps Termux is running on the same kernel?
Thanks,
Sid

Is there a way to get another device to access that url without having to type it man

Hello developers, best regards from Venezuela.
This question will be long because I am providing a lot of detail, so this question is as clear as possible.
Brief introduction.
I have created an app that runs on Android devices, this app allows you to share files between devices that are connected to the same WI-FI network. but with a different methodology to that used by apps that are intended to fulfill this same purpose.
On the device where my app is running (which we will named device one), a url similar to http://192.168.1.102:7898 is generated, and said url must be entered in a web browser installed on the device with which you want to share the files (which we will named device two).
The main purpose is to offer a way to share files between devices, using WI-FI. without the need for device two, my app has to be installed.
You can find more information in https://labs.xda-developers.com/store/app/com.tecnoelias.ipfiles
...
So far everything works fine. But, it is annoying that every time someone wants to share files using my app, on device two, they have to enter the url described above. keeping in mind that said url will change as the WI-FI router decides, and therefore, you should not use shortcuts to the url (bookmarks or navigation history).
Having said all this, the following question arises.
Is there a way to get device two to access that url without having to type it manually by the user?
To accomplish this, three ideas occurred to me.
1: Generate a QR code in the app. but this requires that on device two, an additional app is installed that can read QR codes. which violates my purpose.
2: Implement in the app, a mechanism that allows you to find other devices that my app is working on, and in this way, interact with those devices (through my app, similar to how other file transfer apps do). This is a good idea, but it nevertheless requires that my app be installed on both devices.
3: My third idea and the one I would like to implement is the following:
On device one, it will open my app and then activate it.
When the app is activated, the app will search for other devices that are connected to the same WI-FI network, until it finds device two.
If successful, a SOMEWHAT will be sent programmatically to the device two, that SOMEWHAT can be, a message, a bit, a data packet, or anything else that helps to realize this idea .
After device two receives that SOMEWHAT, it will show a notification or a pop-up window, which will allow access to the url generated in my app (on device one).
Consider two things. 1: Additional app MUST NOT be installed on device two. and 2: Because device two can be running any operating system, the SOMEWHAT will be a different mechanism for each operating system, (operating systems can be, Android, IOS, BlackBerry, Symbian, Windows Phone, Windows, Linux, Mac, among others).
If for example, device two, runs Android 10 (not rooted), and has the most common applications installed, which can be: WhatsApp, Facebook Messeinger, Google Play Services, other Google apps, and system applications.
My thought is that you should be able to use one of those apps, to receive the url, and after clicking on that url, the web browser will open, and then it will load the corresponding webpage (which in this case, is to access the files shared by device one, through my app).
Any idea?
You can give me your opinion, or you can just tell me that this can't be accomplished.
Any response or suggestion are appreciated.

Categories

Resources