Advertisement
vovan333

JAVA SHITCODE

Oct 20th, 2016
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.14 KB | None | 0 0
  1. package com.asmjs.phoneinfo;
  2.  
  3. import android.app.Activity;
  4. import android.graphics.Point;
  5. import android.os.Build;
  6. import android.os.Environment;
  7. import android.os.StatFs;
  8.  
  9. import java.io.IOException;
  10.  
  11. public class Device
  12. {
  13.     public static String Model()
  14.     {
  15.         return Build.MODEL;
  16.     }
  17.  
  18.     public static class OS
  19.     {
  20.         public String AndroidRelease()
  21.         {
  22.             return Build.VERSION.RELEASE;
  23.         }
  24.  
  25.         public String LinuxKernelRelease()
  26.         {
  27.             return System.getProperty("os.version");
  28.         }
  29.     }
  30.  
  31.     public static class CPU
  32.     {
  33.         public int CoreCount()
  34.         {
  35.             return Runtime.getRuntime().availableProcessors();
  36.         }
  37.  
  38.         public float Frequency() throws IOException
  39.         {
  40.             String filename = "/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq";
  41.             float freq = Float.parseFloat(FileIO.ReadFile(filename));
  42.             return freq / 1000000;
  43.         }
  44.     }
  45.  
  46.     public static class Display
  47.     {
  48.         public Point Size(Activity activity)
  49.         {
  50.             android.view.Display display = activity.getWindowManager().getDefaultDisplay();
  51.             Point size = new Point();
  52.             display.getSize(size);
  53.             return size;
  54.         }
  55.     }
  56.  
  57.     public static class Camera
  58.     {
  59.         public int Resolution()
  60.         {
  61.             android.hardware.Camera camera = android.hardware.Camera.open();
  62.             android.hardware.Camera.Parameters params = camera.getParameters();
  63.             android.hardware.Camera.Size size = params.getPictureSize();
  64.             return (size.width * size.height) / 1000000;
  65.         }
  66.     }
  67.  
  68.     public static class Storage
  69.     {
  70.         public static float SDCardGBSize()
  71.         {
  72.             StatFs stats = new StatFs(Environment.getExternalStorageDirectory().getPath());
  73.             long bytes = stats.getTotalBytes();
  74.             int divider = 1073741824;
  75.             float result = bytes / divider;
  76.             return result;
  77.         }
  78.  
  79.         public static float PhoneStorageGBSize()
  80.         {
  81.             return 0;
  82.         }
  83.     }
  84. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement