public void parseApk(Context context, String apkFilePath){
PackageManager packageManager = context.getPackageManager();
PackageInfo packageInfo = packageManager.getPackageArchiveInfo(apkFilePath, 0);
if(packageInfo != null){
packageInfo.applicationInfo.sourceDir = apkFilePath;
packageInfo.applicationInfo.publicSourceDir = apkFilePath;
String name = packageInfo.applicationInfo.loadLabel(packageManager).toString();
String packageName = packageInfo.packageName;
String versionName = packageInfo.versionName;
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.*; | |
import java.util.LinkedList; | |
import java.util.List; | |
public class BatchConfiguration { | |
public int version = -1; | |
public List<MCPComment> commentList; | |
private BatchConfiguration() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.*; | |
import java.net.URI; | |
import java.nio.file.FileSystem; | |
import java.nio.file.*; | |
import java.nio.file.attribute.BasicFileAttributes; | |
import java.util.HashMap; | |
import java.util.LinkedList; | |
import java.util.Map; | |
public class ChannelApkGenerator { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.json.JSONArray; | |
import org.json.JSONException; | |
import org.json.JSONObject; | |
import java.util.Iterator; | |
/** | |
* 一个简单的JSON字符串格式化工具 | |
*/ | |
public class JsonFormatter { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package android.support.v4.app; | |
import android.app.Activity; | |
public class FragmentAssist { | |
public static Activity getActivity(FragmentManager fragmentManager) { | |
if (fragmentManager instanceof FragmentManagerImpl) { | |
return ((FragmentManagerImpl) fragmentManager).mActivity; | |
} else { | |
return null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 偷看ViewPager下一页动画 | |
*/ | |
public class PagerPeepAnimation extends Animation { | |
private ViewPager viewPager; | |
private AnimationListener wrapperAnimationListener; | |
private int peepWidth; | |
public PagerPeepAnimation(final ViewPager viewPager) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 创建一个可以改变颜色的ColorFilter | |
* @param color 透明度是没有用的 | |
* @return ColorMatrixColorFilter | |
*/ | |
public static ColorMatrixColorFilter makeResetColorFilter(int color){ | |
float mRed = Color.red(color); | |
float mGreen = Color.green(color); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 循环删除目录 | |
*/ | |
public static boolean delete(File file) { | |
if (file == null || !file.exists()) { | |
return false; | |
} | |
if (file.isFile()) { | |
return file.delete(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.yingyonghui.market.util; | |
import com.google.gson.Gson; | |
import com.google.gson.JsonElement; | |
import com.google.gson.JsonSyntaxException; | |
import com.yingyonghui.market.net.SafeJsonArray; | |
import com.yingyonghui.market.net.SafeJsonObject; | |
import org.json.JSONArray; | |
import org.json.JSONException; | |
import org.json.JSONObject; | |
import java.lang.reflect.Type; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.support.annotation.NonNull; | |
import android.support.annotation.Nullable; | |
import android.util.Base64; | |
import java.io.ByteArrayOutputStream; | |
import java.io.IOException; | |
import java.security.InvalidKeyException; | |
import java.security.Key; | |
import java.security.KeyFactory; | |
import java.security.KeyPair; |