Implementiere auf Befehl auf rooted android und erhalte das Ergebnis

Ich bin ein Anfänger in Stackoverflow, also kann ich keinen Kommentar hinzufügen.

Ich habe diese Seite gesehen:
Liest die Befehlsausgabe im su-Prozess

und ich habe diese Antwort ausprobiert und es ist ok:

Process p = Runtime.getRuntime().exec(new String[]{"su", "-c", "system/bin/sh"});
DataOutputStream stdin = new DataOutputStream(p.getOutputStream());
//from here all commands are executed with su permissions
stdin.writeBytes("ls /data\n"); // \n executes the command
InputStream stdout = p.getInputStream();
byte[] buffer = new byte[BUFF_LEN];
int read;
String out = new String();
//read method will wait forever if there is nothing in the stream
//so we need to read it in another way than while((read=stdout.read(buffer))>0)
while(true){
    read = stdout.read(buffer);
    out += new String(buffer, 0, read);
    if(read<BUFF_LEN){
        //we have read everything
        break;
       }
 }
 //do something with the output

Aber als ich in der Shell einen Befehl ausprobierte, war die Antwort derselbe Befehl.

Ich setze diesen Befehl:

stdin.writeBytes("echo AT+CQI?\n");

die antwort war:

AT+CQI?

Ich hab geschrieben:

stdin.writeBytes("echo ATinkd\n");

die antwort war:

ATinkd

Das ist gemein "bla..bla..bla ..". Das heißt, das Android-System erkennt diese Befehle nicht als at-Befehle.

Ich frage mich, ob jemand einen Rat oder eine Lösung hat.

Antworten auf die Frage(1)

Ihre Antwort auf die Frage