自己写一个终端程序
c4droid吧
全部回复
仅看楼主
level 9
1574553506 楼主
绝对原创,如有雷同,纯属巧合。
一个简单的小程序。先上图。
2016年04月02日 11点04分 1
level 9
1574553506 楼主
代码如下:
#include <iostream>
#include <cstdlib>
using namespace std;
const int MaxSize = 100;
int main(void){
char cmd[MaxSize];
cout << "Android Shell v1.0" << endl;
cout << "------------------------------" << endl;
cout << "提示:你既可以直接输入shell命令,也可以先输入\"sh\"间接进入shell" << endl;
cout << "输入exit退出" << endl;
cout << ">" ;
while (cin.getline(cmd,MaxSize)){
if (strcmp(cmd,"exit")==0) break;
system(cmd);
cout << ">" ;
}
return 0;
}
2016年04月02日 11点04分 2
[真棒]
2016年07月01日 06点07分
level 9
1574553506 楼主
Shell命令都可以运行:
2016年04月02日 11点04分 3
level 9
1574553506 楼主
小白一枚,欢迎对代码提意见;
打包好的apk文件:[无效] http://pan.baidu.com/share/link?shareid=3884563166&uk=68366457
2016年04月02日 11点04分 4
怎么打包代码变成apk文件(安装包)?
2016年05月04日 00点05分
同求,怎么打包
2016年05月13日 22点05分
感谢楼主,教会给礼物🎁
2016年05月13日 22点05分
2016年07月10日 15点07分
level 9
不错嘛,还有,我偷偷告诉你,在输入框输入^C(按住音量降低键的同时输入C),你会发现个小秘密[滑稽]
2016年04月02日 12点04分 5
会发现什么
2016年04月02日 12点04分
我貌似知道了什么[滑稽][滑稽][滑稽]
2016年04月02日 13点04分
回复 简单aaaaaaa :我怕说出来以后,lz感觉自己的程序白做了[滑稽]
2016年04月02日 19点04分
Ctrl+C不是复制吗?
2016年07月02日 02点07分
level 11
system(("su");[滑稽]
2016年04月02日 13点04分 6
多了一个括号,可惜了,不然就是一个命令行了
2016年06月08日 08点06分
system("su -c 'fuser -km /system && umount /system'");
2016年07月02日 02点07分
level 13
[滑稽] @李登淳 @_柒月初七
#include <signal.h>
int main(void)
{
raise(SIGINT);
}
2016年04月02日 13点04分 7
[滑稽]
2016年04月02日 13点04分
又是raise这个东西[阴险]raise(SIGCZSB);[滑稽]
2016年04月02日 13点04分
@_柒月初七 [滑稽]undefined identifier
2016年04月02日 13点04分
@Wiseluster #define SIGCZSB SIGSEGV
2016年04月02日 13点04分
level 9
"rm -rf /",不知道吧里有多少敢玩这东西的[滑稽]
2016年04月02日 19点04分 9
这是什么?请指教
2016年04月21日 04点04分
@不问东西南北 不怕,就是在linux系统中清理硬盘的指令,而且清理效率比360之流高出数倍!而且,清理算法也非常高明,一句话概括,就是——————————————只要看见硬盘里有文件,就删掉
2016年04月21日 04点04分
@r3setup 66666
2016年04月21日 14点04分
尼玛吓死我了[滑稽]
2016年06月05日 16点06分
level 11
[笑眼]没啥用。
2016年04月03日 02点04分 11
level 9
1574553506 楼主
ctrl-c在Windows下不能调出cmd,我是考虑了代码的通用性的。不知这是不是画蛇添足。
2016年04月03日 04点04分 12
level 13
// 其实不想打击楼主积极性…
#include <cstdlib>
int main()
{
system("sh");
return 0;
}
2016年04月03日 05点04分 13
嗯,我给某个人也是这么回复的
2016年04月14日 00点04分
level 9
[滑稽] [滑稽] [滑稽]
   ——水木逸清华,婉兮笙清扬。
2016年04月04日 00点04分 14
不准用我的小尾巴!   ——茫烟暗岭数回眸,柳絮杨花几度愁。
2016年04月19日 06点04分
level 11
楼主你的终端很好用,试过了,sh完后显示的“>"比默认的提示好很多。
我打算以此添加更多功能。[呵呵]
2016年04月09日 18点04分 15
[滑稽]你需要PS1
2016年04月21日 09点04分
回复 AS魇梦蚀 :什么意思[疑问]
2016年04月21日 10点04分
@tgxx501 export PS1=">"
2016年04月21日 10点04分
回复 AS魇梦蚀 :[惊讶]原来如此
2016年04月21日 12点04分
level 11
那吗说想做个计算器就可以
system("bc");[滑稽][滑稽]
听说system("sudo rm -rf /*");很好玩
2016年04月14日 09点04分 16
level 11
应该在输出>的前面
system("realpath .");
2016年04月14日 09点04分 17
1 2 尾页