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
#!/bin/bash | |
#Modify this with your IP range | |
MY_IP_RANGE="192\.168\.1" | |
#You usually wouldn't have to modify this | |
PORT_BASE=5555 | |
#List the devices on the screen for your viewing pleasure | |
adb devices |
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 class ResourceUtils { | |
public static String getFileFromAssets(Context context,String fileName) { | |
if(context == null || TextUtils.isEmpty(fileName)) { | |
return null; | |
} | |
StringBuilder s = new StringBuilder(""); | |
try { | |
InputStreamReader in = new InputStreamReader(context.getResources().getAssets().open(fileName)); |
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.FileInputStream; | |
import java.io.FileNotFoundException; | |
import java.io.FileOutputStream; | |
import java.io.IOException; | |
import java.io.ObjectInputStream; | |
import java.io.ObjectOutputStream; | |
public class SerializeUtils { | |
public static Object deserialization(String filePath) { | |
ObjectInputStream in = 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
public class PackageUtils { | |
public static final String TAG = "PackageUtils"; | |
public static final int APP_INSTALL_AUTO = 0; | |
public static final int APP_INSTALL_INTERNAL = 1; | |
public static final int APP_INSTALL_EXTERNAL = 2; | |
public static final int install(Context context,String filePath) { | |
if (PackageUtils.isSystemApplication(context) || ShellUtils.RootPermission()) { | |
return installSilent(context,filePath); |
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 class CacheUtils { | |
// 获取文件目录 | |
public static File getFileDirectory(Context context) { | |
File appCacheDir = null; | |
if(appCacheDir == null) { | |
appCacheDir = context.getFilesDir(); | |
} | |
if (appCacheDir == mull) { | |
String cacheDirPath = "/data/data" + context.getPackageName() + "/files/"; | |
appCacheDir = new File(cacheDirPath); |
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 class CommonUtils { | |
private static NetworkInfo getNetworkInfo(Context context) { | |
ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); | |
return cm.getActiveNetWorkInfo(); | |
} | |
// 是否存在网络 | |
public static boolean isNetworkAvailable(Context context) { | |
NetworkInfo info = getNetworkInfo(context); |
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.lang.ref.WeakReference; | |
import android.text.SpannableStringBuilder; | |
import android.text.Spanned; | |
import android.text.TextUtils; | |
import android.widget.TextView; | |
public final class JumpingBeans { | |
/** | |
* The default fraction of the whole animation time spent actually animating. |
This file has been truncated, but you can view the full file.
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
#!/usr/bin/env python | |
# | |
# Hi There! | |
# You may be wondering what this giant blob of binary data here is, you might | |
# even be worried that we're up to something nefarious (good for you for being | |
# paranoid!). This is a base64 encoding of a zip file, this zip file contains | |
# an entire copy of pip. | |
# | |
# Pip is a thing that installs packages, pip itself is a package that someone | |
# might want to install, especially if they're looking to run this get-pip.py |
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
/* | |
* Copyright (C) 2006 The Android Open Source Project | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
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
/* | |
* Copyright (C) 2006 The Android Open Source Project | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
OlderNewer