Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View CoXier's full-sized avatar
:octocat:
Focusing

Eric Li CoXier

:octocat:
Focusing
View GitHub Profile
@CoXier
CoXier / java
Created May 18, 2019 07:10
Curl okhttp api request
import okhttp3.*;
import okio.Buffer;
import java.io.IOException;
import java.nio.charset.Charset;
public class CurlLoggerInterceptor implements Interceptor {
private StringBuilder curlCommandBuilder;
private final Charset UTF8 = Charset.forName("UTF-8");
private String tag = null;
import android.content.Context;
import android.os.Build;
import android.support.annotation.IntDef;
import android.support.annotation.RequiresApi;
import android.util.AttributeSet;
import android.view.TextureView;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

截取视频

ffmpeg -i input.mp4 -acodec copy -ss 00:00:14 -t 00:00:23 output.mp4

-ss:起始时间 -t: 总时间

去水印

ffmpeg -i input.mp4 -vf delogo=x=1035:y=40:w=210:h=80 no_log.mp4
@CoXier
CoXier / Android Studio 导入 AOSP.md
Last active October 21, 2017 06:01
Android Studio 导入 AOSP
  • 生成 idegen.jar  mmm development/tools/idegen/ 注意使用 bash
  • 生成 android.ipr development/tools/idegen/idegen.sh

导入 Android Studio 后的常见问题:

  • 点击类名,跳转的是 class 文件,解决方法:进入 Project Structure->Modules,移除所有的依赖,只保留两个。具体参考:http://blog.csdn.net/yanbober/article/details/48846331
  • 资源路径找不到,如果 make 没有成功,那么 Android Studio 就无法找到资源。如果想看资源也是能找到的,如:frameworks/base/core/res/res/values/attrs.xml
@CoXier
CoXier / sqlite_viewer.sh
Created September 6, 2017 07:03
查看 Android 数据库
#!/bin/bash
usage() { echo "Usage: $0 [-p <package_name>] [-d <databases_name>]" 1>&2; exit 1; }
while getopts ":p:d:" o; do
case "${o}" in
p)
p=${OPTARG}
;;
d)
d=${OPTARG}
;;
@CoXier
CoXier / Adb 常用命令.md
Last active September 6, 2017 07:00
Adb 常用命令

adb 常用命令

网络有关

  • svc data enable/disable 开关移动网络
  • svc wifi enable/disable 开关 wifi

文件操作相关

  • 拖出某一个 apk:
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in E:\sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:
@CoXier
CoXier / LRUCache
Created March 10, 2017 11:20
A simple solution for LRUCache
import java.util.HashMap;
/**
* Created by coxier on 17-3-10.
*/
public class LRUCache<K,V> {
private final class Node {
Node next;
Node pre;
@CoXier
CoXier / SimpleGestureListener.java
Created February 21, 2017 09:04
Android gesture detector
import android.util.Log;
import android.view.GestureDetector;
import android.view.MotionEvent;
/**
* Created by CoXier on 17-2-21.
*/
public class SimpleGestureListener extends GestureDetector.SimpleOnGestureListener {
private static final String TAG = "SimpleGestureListener";