Skip to content

Commit 5d0d3e1

Browse files
first commit
0 parents  commit 5d0d3e1

19 files changed

+1002
-0
lines changed

.gitignore

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
target/
2+
!.mvn/wrapper/maven-wrapper.jar
3+
!**/src/main/**/target/
4+
!**/src/test/**/target/
5+
6+
### IntelliJ IDEA ###
7+
.idea/modules.xml
8+
.idea/jarRepositories.xml
9+
.idea/compiler.xml
10+
.idea/libraries/
11+
*.iws
12+
*.iml
13+
*.ipr
14+
15+
### Eclipse ###
16+
.apt_generated
17+
.classpath
18+
.factorypath
19+
.project
20+
.settings
21+
.springBeans
22+
.sts4-cache
23+
24+
### NetBeans ###
25+
/nbproject/private/
26+
/nbbuild/
27+
/dist/
28+
/nbdist/
29+
/.nb-gradle/
30+
build/
31+
!**/src/main/**/build/
32+
!**/src/test/**/build/
33+
34+
### VS Code ###
35+
.vscode/
36+
37+
### Mac OS ###
38+
.DS_Store
39+
40+
### heStudio ###
41+
out

.idea/.gitignore

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/artifacts/DeviceInformationGet.xml

+9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/artifacts/Setup_Shell.xml

+9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/encodings.xml

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/inspectionProfiles/Project_Default.xml

+10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

+15
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/uiDesigner.xml

+124
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pom.xml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<groupId>org.hestudio</groupId>
8+
<artifactId>DeviceInformationGet</artifactId>
9+
<version>1.0.0</version>
10+
11+
<developers>
12+
<developer>
13+
<name>undefined</name>
14+
<email>[email protected]</email>
15+
<organization>heStudio</organization>
16+
<organizationUrl>https://www.hestudio.net</organizationUrl>
17+
<timezone>Asia/Shanghai</timezone>
18+
</developer>
19+
</developers>
20+
21+
<organization>
22+
<name>heStudio</name>
23+
<url>https://www.hestudio.net</url>
24+
</organization>
25+
26+
<properties>
27+
<maven.compiler.source>17</maven.compiler.source>
28+
<maven.compiler.target>17</maven.compiler.target>
29+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
30+
</properties>
31+
32+
<dependencies>
33+
<dependency>
34+
<groupId>com.googlecode.lanterna</groupId>
35+
<artifactId>lanterna</artifactId>
36+
<version>3.1.1</version>
37+
</dependency>
38+
</dependencies>
39+
40+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
package org.hestudio.deviceinformationget.Get;
2+
3+
import org.hestudio.deviceinformationget.Main;
4+
5+
import com.googlecode.lanterna.gui2.MultiWindowTextGUI;
6+
import com.googlecode.lanterna.gui2.WindowBasedTextGUI;
7+
import com.googlecode.lanterna.gui2.dialogs.MessageDialog;
8+
import com.googlecode.lanterna.screen.Screen;
9+
import com.googlecode.lanterna.screen.TerminalScreen;
10+
import com.googlecode.lanterna.terminal.DefaultTerminalFactory;
11+
import com.googlecode.lanterna.terminal.Terminal;
12+
13+
import java.io.BufferedReader;
14+
import java.io.IOException;
15+
import java.io.InputStreamReader;
16+
17+
public class BinList {
18+
public static String[] Main() {
19+
try {
20+
Runtime runtime = Runtime.getRuntime();
21+
Process process = runtime.exec("ls -la /data/data/com.termux/files/usr/bin/");
22+
BufferedReader stdInput = new BufferedReader(new InputStreamReader(process.getInputStream()));
23+
24+
String[] BinList;
25+
String outputLine;
26+
StringBuilder Info = new StringBuilder();
27+
28+
while ((outputLine = stdInput.readLine()) != null) {
29+
Info.append(outputLine).append("\n");
30+
}
31+
BinList = Info.toString().split("\n");
32+
return BinList;
33+
34+
} catch (IOException e) {
35+
Screen screen = null;
36+
try {
37+
Terminal terminal = new DefaultTerminalFactory().createTerminal();
38+
screen = new TerminalScreen(terminal);
39+
screen.startScreen();
40+
41+
} catch (IOException ex) {
42+
throw new RuntimeException(e);
43+
}
44+
final WindowBasedTextGUI textGUI = new MultiWindowTextGUI(screen);
45+
MessageDialog.showMessageDialog(textGUI, Main.AppName, "Error: 程序在获取bin信息时遇到错误,请联系heStudio处理。");
46+
System.exit(-1);
47+
}
48+
return new String[0];
49+
}
50+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
package org.hestudio.deviceinformationget.Get;
2+
3+
import com.googlecode.lanterna.gui2.MultiWindowTextGUI;
4+
import com.googlecode.lanterna.gui2.WindowBasedTextGUI;
5+
import com.googlecode.lanterna.gui2.dialogs.MessageDialog;
6+
import com.googlecode.lanterna.screen.Screen;
7+
import com.googlecode.lanterna.screen.TerminalScreen;
8+
import com.googlecode.lanterna.terminal.DefaultTerminalFactory;
9+
import com.googlecode.lanterna.terminal.Terminal;
10+
import org.hestudio.deviceinformationget.Main;
11+
12+
import java.io.BufferedReader;
13+
import java.io.IOException;
14+
import java.io.InputStreamReader;
15+
16+
public class CPUInfo {
17+
public static String[] Main() {
18+
try {
19+
Runtime runtime = Runtime.getRuntime();
20+
Process process = runtime.exec("cat /proc/cpuinfo");
21+
BufferedReader stdInput = new BufferedReader(new InputStreamReader(process.getInputStream()));
22+
23+
String[] CPUInfo;
24+
String outputLine;
25+
StringBuilder Info = new StringBuilder();
26+
27+
while ((outputLine = stdInput.readLine()) != null) {
28+
Info.append(outputLine).append("\n");
29+
}
30+
CPUInfo = Info.toString().split("\n");
31+
return CPUInfo;
32+
33+
} catch (IOException e) {
34+
Screen screen = null;
35+
try {
36+
Terminal terminal = new DefaultTerminalFactory().createTerminal();
37+
screen = new TerminalScreen(terminal);
38+
screen.startScreen();
39+
40+
} catch (IOException ex) {
41+
throw new RuntimeException(e);
42+
}
43+
final WindowBasedTextGUI textGUI = new MultiWindowTextGUI(screen);
44+
MessageDialog.showMessageDialog(textGUI, Main.AppName, "Error: 程序在获取CPU信息时遇到错误,请联系heStudio处理。");
45+
System.exit(-1);
46+
}
47+
return new String[0];
48+
}
49+
}

0 commit comments

Comments
 (0)