0

I am currently working on a custom android platform with RJ45 Lan connection, the problem now, is that I would like to be able to set the ip address from my custom app..

using 'ifconfig' works from shell directly in android kernel being root, but how do I use it from an app?

Cœur
  • 37,241
  • 25
  • 195
  • 267
Qw_freak
  • 81
  • 1
  • 10

2 Answers2

0

You could use the RootTools library by stericson: http://code.google.com/p/roottools/

You can very easily run root shell commands with it :)

Check its wiki for usage: http://code.google.com/p/roottools/wiki/Usage

In fact, any method that can execute root commands should be okay.

shkschneider
  • 17,833
  • 13
  • 59
  • 112
  • [qoute]In fact, any method that can execute root commands should be okay.[/qoute] Unfortunately I have tried this, but it doesn't work, kernel just ignores mu plea for root privelegies... – Qw_freak Apr 24 '12 at 11:23
  • That is not logical, running commands via `adb shell` or via Java (with a correct implementation and a working Superuser) should be the exact same thing... Can't help you more without more informations on how you already tried. – shkschneider Apr 24 '12 at 11:35
0

My solution:

Since its my own kernel build I edited the source code of "su" and commented the security check away, so basically every user can become root..

Not a very pretty or secure solution, but my device will not be used for "unauthorized" apps anyway, and the rom will not be made public, so that will be the solution so far.

Qw_freak
  • 81
  • 1
  • 10
  • su has been working all the time(through shell), I just could'nt find a way to let an app use it... – Qw_freak Apr 25 '12 at 15:42