using UnityEngine;
using System.Collections;
using System;
public class eventTest : MonoBehaviour
{
private event Action<uint> onClick;
private uint i = 0;
// Use this for initial……继续阅读 »
3年前 (2018-04-04) 1617浏览 0评论
0个赞
做一下记录:
find /sdcard/log/crash/ -mtime +30 | xargs rm -rf
……继续阅读 »
3年前 (2017-08-10) 1341浏览 0评论
0个赞
private YuvImage i420ToYuvImage(ByteBuffer[] yuvPlanes, int[] yuvStrides, int width, int height) {
if (yuvStrides[0] != width) {
return fastI420ToYuvImage(yuvPlanes, yuvStrides, width, hei……继续阅读 »
4年前 (2017-07-13) 1307浏览 0评论
0个赞
pm dump【包名】| grep -A 1 android.intent.action.MAIN: | tail -1
PS:windows貌似不能使用tail
……继续阅读 »
4年前 (2017-07-03) 1246浏览 0评论
1个赞
/**
* 通过包名获取task id,不存在为-1
*
* @param packageName
* @return
*/
public int getTaskId(String packageName) {
String result = execRootCmd("dumpsys activity | grep " + packageName);
……继续阅读 »
4年前 (2017-07-03) 1926浏览 0评论
0个赞
/**
* 返回当前的应用是否处于前台显示状态
*
* @param packageName
* @return
*/
public boolean isTopActivity(String packageName) {
String result = execRootCmd("dumpsys activity | grep \"mResumedActivity\"");
……继续阅读 »
4年前 (2017-06-02) 1609浏览 0评论
3个赞
public boolean isNumeric(String str) {
for (int i = 0; i < str.length(); i++) {
if (!Character.isDigit(str.charAt(i))) {
return false;
}
}
return true;
}
……继续阅读 »
4年前 (2017-06-02) 1322浏览 0评论
0个赞
这里使用的是ps命令,不用root或系统权限。
public int getPid(String name) {
String cmd = ("ps | grep " + name);
String str = execRootCmd(cmd);
if (str == null || str == "" || str.length(……继续阅读 »
4年前 (2017-06-02) 2270浏览 0评论
5个赞
// 执行命令并且输出结果
private String execRootCmd(String cmd) {
Log.d(TAG, "cmd: " + cmd);
String result = "";
DataOutputStream dos = null;
DataInputStream dis = null;
t……继续阅读 »
4年前 (2017-06-02) 1405浏览 0评论
2个赞
效果图如下:
package com.wangsu.tplibrary.ui;
import android.content.Context;
import android.graphics.PixelFormat;
import android.util.AttributeSet;
import android.view.Gravity;
import android.view.……继续阅读 »
4年前 (2017-05-21) 1609浏览 2评论
0个赞