Java Code Examples for android.os.Build#CPU_ABI2
The following examples show how to use
android.os.Build#CPU_ABI2 .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CpuInfo.java From MobileInfo with Apache License 2.0 | 8 votes |
private static String putCpuAbi() { String[] abis; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { abis = Build.SUPPORTED_ABIS; } else { abis = new String[]{Build.CPU_ABI, Build.CPU_ABI2}; } StringBuilder stringBuilder = new StringBuilder(); for (String abi : abis) { stringBuilder.append(abi); stringBuilder.append(","); } try { return stringBuilder.toString().substring(0, stringBuilder.toString().length() - 1); } catch (Exception e) { Log.i(TAG, e.toString()); } return null; }
Example 2
Source File: VPNLaunchHelper.java From bitmask_android with GNU General Public License v3.0 | 7 votes |
private static String writeMiniVPN(Context context) { String[] abis; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) abis = getSupportedABIsLollipop(); else //noinspection deprecation abis = new String[]{Build.CPU_ABI, Build.CPU_ABI2}; String nativeAPI = NativeUtils.getNativeAPI(); if (!nativeAPI.equals(abis[0])) { VpnStatus.logWarning(R.string.abi_mismatch, Arrays.toString(abis), nativeAPI); abis = new String[]{nativeAPI}; } for (String abi : abis) { File vpnExecutable = new File(context.getCacheDir(), "c_" + getMiniVPNExecutableName() + "." + abi); if ((vpnExecutable.exists() && vpnExecutable.canExecute()) || writeMiniVPNBinary(context, abi, vpnExecutable)) { return vpnExecutable.getPath(); } } throw new RuntimeException("Cannot find any execulte for this device's ABIs " + abis.toString()); }
Example 3
Source File: VPNLaunchHelper.java From Cake-VPN with GNU General Public License v2.0 | 6 votes |
private static String writeMiniVPN(Context context) { String[] abis; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) abis = getSupportedABIsLollipop(); else //noinspection deprecation abis = new String[]{Build.CPU_ABI, Build.CPU_ABI2}; String nativeAPI = NativeUtils.getNativeAPI(); if (!nativeAPI.equals(abis[0])) { VpnStatus.logWarning(R.string.abi_mismatch, Arrays.toString(abis), nativeAPI); abis = new String[]{nativeAPI}; } for (String abi : abis) { File vpnExecutable = new File(context.getCacheDir(), getMiniVPNExecutableName() + "." + abi); if ((vpnExecutable.exists() && vpnExecutable.canExecute()) || writeMiniVPNBinary(context, abi, vpnExecutable)) { return vpnExecutable.getPath(); } } return null; }
Example 4
Source File: VPNLaunchHelper.java From SimpleOpenVpn-Android with Apache License 2.0 | 6 votes |
private static String writeMiniVPN(Context context) { String[] abis; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) abis = getSupportedABIsLollipop(); else //noinspection deprecation abis = new String[]{Build.CPU_ABI, Build.CPU_ABI2}; String nativeAPI = NativeUtils.getNativeAPI(); if (!nativeAPI.equals(abis[0])) { VpnStatus.logWarning(R.string.abi_mismatch, Arrays.toString(abis), nativeAPI); abis = new String[] {nativeAPI}; } for (String abi: abis) { File vpnExecutable = new File(context.getCacheDir(), getMiniVPNExecutableName() + "." + abi); if ((vpnExecutable.exists() && vpnExecutable.canExecute()) || writeMiniVPNBinary(context, abi, vpnExecutable)) { return vpnExecutable.getPath(); } } return null; }
Example 5
Source File: VPNLaunchHelper.java From EasyVPN-Free with GNU General Public License v3.0 | 6 votes |
private static String writeMiniVPN(Context context) { String[] abis; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) abis = getSupportedABIsLollipop(); else //noinspection deprecation abis = new String[]{Build.CPU_ABI, Build.CPU_ABI2}; String nativeAPI = NativeUtils.getNativeAPI(); if (!nativeAPI.equals(abis[0])) { VpnStatus.logWarning(R.string.abi_mismatch, Arrays.toString(abis), nativeAPI); abis = new String[] {nativeAPI}; } for (String abi: abis) { File vpnExecutable = new File(context.getCacheDir(), getMiniVPNExecutableName() + "." + abi); if ((vpnExecutable.exists() && vpnExecutable.canExecute()) || writeMiniVPNBinary(context, abi, vpnExecutable)) { return vpnExecutable.getPath(); } } return null; }
Example 6
Source File: VPNLaunchHelper.java From Cybernet-VPN with GNU General Public License v3.0 | 6 votes |
private static String writeMiniVPN(Context context) { String[] abis; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) abis = getSupportedABIsLollipop(); else //noinspection deprecation abis = new String[]{Build.CPU_ABI, Build.CPU_ABI2}; String nativeAPI = NativeUtils.getNativeAPI(); if (!nativeAPI.equals(abis[0])) { VpnStatus.logWarning(R.string.abi_mismatch, Arrays.toString(abis), nativeAPI); abis = new String[]{nativeAPI}; } for (String abi : abis) { File vpnExecutable = new File(context.getCacheDir(), getMiniVPNExecutableName() + "." + abi); if ((vpnExecutable.exists() && vpnExecutable.canExecute()) || writeMiniVPNBinary(context, abi, vpnExecutable)) { return vpnExecutable.getPath(); } } return null; }
Example 7
Source File: AppUtils.java From loco-answers with GNU General Public License v3.0 | 6 votes |
public static String getDeviceDetails(Context context) { return "Device Information\n" + "\nAPP.VERSION : " + getAppVersion(context) + "\nLAUNCHER.APP : " + getCurrentLauncherApp(context) + "\nTIMEZONE : " + timeZone() + "\nVERSION.RELEASE : " + Build.VERSION.RELEASE + "\nVERSION.INCREMENTAL : " + Build.VERSION.INCREMENTAL + "\nVERSION.SDK.NUMBER : " + Build.VERSION.SDK_INT + "\nBRAND : " + Build.BRAND + "\nCPU_ABI : " + Build.CPU_ABI + "\nCPU_ABI2 : " + Build.CPU_ABI2 + "\nMANUFACTURER : " + Build.MANUFACTURER + "\nMODEL : " + Build.MODEL + "\nPRODUCT : " + Build.PRODUCT; }
Example 8
Source File: DeviceUtils.java From Common with Apache License 2.0 | 5 votes |
/** * Return an ordered list of ABIs supported by this device. The most preferred ABI is the first * element in the list. * * @return an ordered list of ABIs supported by this device */ public static String[] getABIs() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { return Build.SUPPORTED_ABIS; } else { if (!TextUtils.isEmpty(Build.CPU_ABI2)) { return new String[]{Build.CPU_ABI, Build.CPU_ABI2}; } return new String[]{Build.CPU_ABI}; } }
Example 9
Source File: MainActivity.java From NetworkMapper with GNU General Public License v2.0 | 5 votes |
private String donexteabi() { switch (currentEabi++) { case 0: return Build.CPU_ABI; case 1: return Build.CPU_ABI2; } return null; }
Example 10
Source File: DeviceUtils.java From AndroidUtilCode with Apache License 2.0 | 5 votes |
/** * Return an ordered list of ABIs supported by this device. The most preferred ABI is the first * element in the list. * * @return an ordered list of ABIs supported by this device */ public static String[] getABIs() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { return Build.SUPPORTED_ABIS; } else { if (!TextUtils.isEmpty(Build.CPU_ABI2)) { return new String[]{Build.CPU_ABI, Build.CPU_ABI2}; } return new String[]{Build.CPU_ABI}; } }
Example 11
Source File: AppUtils.java From CrashReporter with Apache License 2.0 | 5 votes |
public static String getDeviceDetails(Context context) { return "Device Information\n" + "\nDEVICE.ID : " + getDeviceId(context) + "\nUSER.ID : " + getUserIdentity(context) + "\nAPP.VERSION : " + getAppVersion(context) + "\nLAUNCHER.APP : " + getCurrentLauncherApp(context) + "\nTIMEZONE : " + timeZone() + "\nVERSION.RELEASE : " + Build.VERSION.RELEASE + "\nVERSION.INCREMENTAL : " + Build.VERSION.INCREMENTAL + "\nVERSION.SDK.NUMBER : " + Build.VERSION.SDK_INT + "\nBOARD : " + Build.BOARD + "\nBOOTLOADER : " + Build.BOOTLOADER + "\nBRAND : " + Build.BRAND + "\nCPU_ABI : " + Build.CPU_ABI + "\nCPU_ABI2 : " + Build.CPU_ABI2 + "\nDISPLAY : " + Build.DISPLAY + "\nFINGERPRINT : " + Build.FINGERPRINT + "\nHARDWARE : " + Build.HARDWARE + "\nHOST : " + Build.HOST + "\nID : " + Build.ID + "\nMANUFACTURER : " + Build.MANUFACTURER + "\nMODEL : " + Build.MODEL + "\nPRODUCT : " + Build.PRODUCT + "\nSERIAL : " + Build.SERIAL + "\nTAGS : " + Build.TAGS + "\nTIME : " + Build.TIME + "\nTYPE : " + Build.TYPE + "\nUNKNOWN : " + Build.UNKNOWN + "\nUSER : " + Build.USER; }
Example 12
Source File: SupportedArchitectures.java From fdroidclient with GNU General Public License v3.0 | 5 votes |
/** * The most preferred ABI is the first element in the list. */ @TargetApi(21) @SuppressWarnings("deprecation") public static String[] getAbis() { if (Build.VERSION.SDK_INT >= 21) { return Build.SUPPORTED_ABIS; } return new String[]{Build.CPU_ABI, Build.CPU_ABI2}; }
Example 13
Source File: CpuAbiUtils.java From Neptune with Apache License 2.0 | 5 votes |
/** * 获取设备支持的abi列表 */ public static String[] getSupportAbis() { String[] cpuAbis; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { cpuAbis = Build.SUPPORTED_ABIS; } else { cpuAbis = new String[]{Build.CPU_ABI, Build.CPU_ABI2}; } // avoid NPE if (cpuAbis == null) { cpuAbis = new String[0]; } return cpuAbis; }
Example 14
Source File: LogSectionSystemInfo.java From mollyim-android with GNU General Public License v3.0 | 5 votes |
private static @NonNull Iterable<String> getSupportedAbis() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { return Arrays.asList(Build.SUPPORTED_ABIS); } else { LinkedList<String> abis = new LinkedList<>(); abis.add(Build.CPU_ABI); if (Build.CPU_ABI2 != null && !"unknown".equals(Build.CPU_ABI2)) { abis.add(Build.CPU_ABI2); } return abis; } }
Example 15
Source File: DeviceUtils.java From DevUtils with Apache License 2.0 | 5 votes |
/** * 获取支持的指令集 如: [arm64-v8a, armeabi-v7a, armeabi] * @return 支持的指令集 */ public static String[] getABIs() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { return Build.SUPPORTED_ABIS; } else { if (!TextUtils.isEmpty(Build.CPU_ABI2)) { return new String[]{Build.CPU_ABI, Build.CPU_ABI2}; } return new String[]{Build.CPU_ABI}; } }
Example 16
Source File: SystemLibraryLoader.java From ReLinker with Apache License 2.0 | 5 votes |
@Override public String[] supportedAbis() { if (Build.VERSION.SDK_INT >= 21 && Build.SUPPORTED_ABIS.length > 0) { return Build.SUPPORTED_ABIS; } else if (!TextUtils.isEmpty(Build.CPU_ABI2)) { return new String[] {Build.CPU_ABI, Build.CPU_ABI2}; } else { return new String[] {Build.CPU_ABI}; } }
Example 17
Source File: BasicInfoUtils.java From QPM with Apache License 2.0 | 5 votes |
private static String getCPUType() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { return join(",", Build.SUPPORTED_ABIS); } else { if (!TextUtils.isEmpty(Build.CPU_ABI2)) { return Build.CPU_ABI + "," + Build.CPU_ABI2; } return Build.CPU_ABI; } }
Example 18
Source File: DeviceUtils.java From Android-utils with Apache License 2.0 | 5 votes |
public static String[] getABIs() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { return Build.SUPPORTED_ABIS; } else { if (!TextUtils.isEmpty(Build.CPU_ABI2)) { return new String[]{Build.CPU_ABI, Build.CPU_ABI2}; } return new String[]{Build.CPU_ABI}; } }
Example 19
Source File: SysUtil.java From SoLoader with Apache License 2.0 | 5 votes |
/** * Return an list of ABIs we supported on this device ordered according to preference. Use a * separate inner class to isolate the version-dependent call where it won't cause the whole class * to fail preverification. * * @return Ordered array of supported ABIs */ public static String[] getSupportedAbis() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { return MarshmallowSysdeps.getSupportedAbis(); } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { return LollipopSysdeps.getSupportedAbis(); } else { return new String[] {Build.CPU_ABI, Build.CPU_ABI2}; } }
Example 20
Source File: DeviceUtils.java From QPM with Apache License 2.0 | 3 votes |
public static String getABI() { String CPU_ABI = Build.CPU_ABI; String CPU_ABI2 = Build.CPU_ABI2; return CPU_ABI + " " + CPU_ABI2; }