Skip to content

Instantly share code, notes, and snippets.

View ryuunoakaihitomi's full-sized avatar
💤
sleepy

ZQY ryuunoakaihitomi

💤
sleepy
  • A small company
  • China
View GitHub Profile
@ryuunoakaihitomi
ryuunoakaihitomi / c.cpp
Last active May 18, 2018 10:08
C++作业
//1
#include <iostream>
using namespace std;
int main()
{
int in;
cin>>in;
if(in>=1000||in<0)
@ryuunoakaihitomi
ryuunoakaihitomi / writeTextSH.java
Last active July 31, 2017 03:18
Use root shell to write File
public void writeTextSH(String body,String path)
{
try
{
java.lang.Process p = Runtime.getRuntime().exec("su");
OutputStreamWriter d = new OutputStreamWriter(p.getOutputStream());
d.write("mkdir "+path.subSequence(0, path.lastIndexOf("/")).toString()+"\n");
d.write("cat > "+path+" << EOF\n"+body+ "\nEOF\nexit\n");
d.flush();
p.getErrorStream().close();