SHARE
TWEET

AmbaCommandHelper.java APK 1.5

a guest May 17th, 2015 2,588 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov.
  2. // Jad home page: http://www.geocities.com/kpdus/jad.html
  3. // Decompiler options: braces fieldsfirst space lnc
  4.  
  5. package com.ants360.sports.lib;
  6.  
  7. import com.ants360.sports.lib.util.FileUtil;
  8. import java.io.File;
  9. import org.json.JSONObject;
  10.  
  11. // Referenced classes of package com.ants360.sports.lib:
  12. //            ConnectionController, CameraMessageCallback, AntsSportsCameraSocketConnection, CameraMessage,
  13. //            CameraCommandHandler
  14.  
  15. public class AmbaCommandHelper extends ConnectionController
  16.     implements CameraMessageCallback
  17. {
  18.  
  19.     public static final String OPTION_LISTING = " -D -S";
  20.     public static final String TYPE_APP_STATUS = "app_status";
  21.     public static final String TYPE_CAPTURE_MODE = "capture_mode";
  22.     public static final String TYPE_PHOTO_SIZE = "photo_size";
  23.     public static final String TYPE_PIV_ENABLE = "piv_enable";
  24.     public static final String TYPE_PRECISE_CONT_CAPTURING = "precise_cont_capturing";
  25.     public static final String TYPE_SD_CARD_STATUS = "sd_card_status";
  26.     public static final String TYPE_VIDEO_RESOLUTION = "video_resolution";
  27.     public static final String TYPE_ZOOM_FAST = "fast";
  28.     private CameraCommandHandler commandHandler;
  29.     private CameraMessageCallback mMessageCallback;
  30.     private CameraMessage message;
  31.  
  32.     public AmbaCommandHelper()
  33.     {
  34.         commandHandler = AntsSportsCameraSocketConnection.getInstance();
  35.         mMessageCallback = this;
  36.     }
  37.  
  38.     public AmbaCommandHelper(CameraMessageCallback cameramessagecallback)
  39.     {
  40.         commandHandler = AntsSportsCameraSocketConnection.getInstance();
  41.         mMessageCallback = cameramessagecallback;
  42.     }
  43.  
  44.     public static void stop()
  45.     {
  46.         CameraMessage cameramessage = new CameraMessage(258, null);
  47.         AntsSportsCameraSocketConnection.getInstance().clearMessageQueue();
  48.         AntsSportsCameraSocketConnection.getInstance().forceSendStopSessionMessage(cameramessage);
  49.     }
  50.  
  51.     public CameraMessageCallback getMessageCallback()
  52.     {
  53.         return mMessageCallback;
  54.     }
  55.  
  56.     public void onConnectionNotify(int i)
  57.     {
  58.         CameraMessage cameramessage = new CameraMessage(257);
  59.         i;
  60.         JVM INSTR tableswitch 1 2: default 36
  61.     //                   1 56
  62.     //                   2 37;
  63.            goto _L1 _L2 _L3
  64. _L1:
  65.         return;
  66. _L3:
  67.         if (mMessageCallback != null)
  68.         {
  69.             mMessageCallback.onReceiveErrorMessage(cameramessage, null);
  70.             return;
  71.         }
  72.         continue; /* Loop/switch isn't completed */
  73. _L2:
  74.         if (mMessageCallback != null)
  75.         {
  76.             mMessageCallback.onReceiveMessage(cameramessage, null);
  77.             return;
  78.         }
  79.         if (true) goto _L1; else goto _L4
  80. _L4:
  81.     }
  82.  
  83.     public void onReceiveErrorMessage(CameraMessage cameramessage, JSONObject jsonobject)
  84.     {
  85.     }
  86.  
  87.     public void onReceiveMessage(CameraMessage cameramessage, JSONObject jsonobject)
  88.     {
  89.     }
  90.  
  91.     public void onReceiveNotification(JSONObject jsonobject)
  92.     {
  93.     }
  94.  
  95.     public void registerNotificationHandler(CameraMessageCallback cameramessagecallback)
  96.     {
  97.         commandHandler.registerNotificationHandler(cameramessagecallback);
  98.     }
  99.  
  100.     public void sendCancelGetFile(String s)
  101.     {
  102.         message = new CameraMessage(1287, mMessageCallback);
  103.         message.put("param", s);
  104.         commandHandler.sendMessage(message);
  105.     }
  106.  
  107.     public void sendCancelPutFile(String s, int i)
  108.     {
  109.         message = new CameraMessage(1287, mMessageCallback);
  110.         message.put("param", s);
  111.         message.put("sent_size", Integer.valueOf(i));
  112.         commandHandler.sendMessage(message);
  113.     }
  114.  
  115.     public void sendChangeBitRate(int i)
  116.     {
  117.         message = new CameraMessage(16, mMessageCallback);
  118.         message.put("param", Integer.valueOf(i));
  119.         commandHandler.sendMessage(message);
  120.     }
  121.  
  122.     public void sendChangeDirectory(String s)
  123.     {
  124.         message = new CameraMessage(1283, mMessageCallback);
  125.         message.put("param", s);
  126.         commandHandler.sendMessage(message);
  127.     }
  128.  
  129.     public void sendContinueCaptureStop()
  130.     {
  131.         message = new CameraMessage(770, mMessageCallback);
  132.         commandHandler.sendMessage(message);
  133.     }
  134.  
  135.     public void sendDeleteFile(String s)
  136.     {
  137.         message = new CameraMessage(1281, mMessageCallback);
  138.         message.put("param", s);
  139.         commandHandler.sendMessage(message);
  140.     }
  141.  
  142.     public void sendForceResetVF()
  143.     {
  144.         message = new CameraMessage(259, mMessageCallback);
  145.         commandHandler.sendMessage(message);
  146.     }
  147.  
  148.     public void sendFormat(String s)
  149.     {
  150.         message = new CameraMessage(4, mMessageCallback);
  151.         message.put("param", s);
  152.         commandHandler.sendMessage(message);
  153.     }
  154.  
  155.     public void sendGetAllCurrentSetting()
  156.     {
  157.         message = new CameraMessage(3, mMessageCallback);
  158.         commandHandler.sendMessage(message);
  159.     }
  160.  
  161.     public void sendGetAllSettingOption(String s)
  162.     {
  163.         message = new CameraMessage(3, mMessageCallback);
  164.         message.put("param", s);
  165.         commandHandler.sendMessage(message);
  166.     }
  167.  
  168.     public void sendGetBatteryLevel()
  169.     {
  170.         message = new CameraMessage(13, mMessageCallback);
  171.         commandHandler.sendMessage(message);
  172.     }
  173.  
  174.     public void sendGetDigitalZoomInfo(String s)
  175.     {
  176.         message = new CameraMessage(15, mMessageCallback);
  177.         message.put("type", s);
  178.         commandHandler.sendMessage(message);
  179.     }
  180.  
  181.     public void sendGetFile(String s, long l, long l1)
  182.     {
  183.         message = new CameraMessage(1285, mMessageCallback);
  184.         message.put("param", s);
  185.         message.put("offset", Long.valueOf(l));
  186.         message.put("fetch_size", Long.valueOf(l1));
  187.         commandHandler.sendMessage(message);
  188.     }
  189.  
  190.     public void sendGetMediaInfo(String s)
  191.     {
  192.         message = new CameraMessage(1026, mMessageCallback);
  193.         message.put("param", s);
  194.         commandHandler.sendMessage(message);
  195.     }
  196.  
  197.     public void sendGetRecordTime()
  198.     {
  199.         message = new CameraMessage(515, mMessageCallback);
  200.         commandHandler.sendMessage(message);
  201.     }
  202.  
  203.     public void sendGetSetting(String s)
  204.     {
  205.         message = new CameraMessage(1, mMessageCallback);
  206.         message.put("type", s);
  207.         commandHandler.sendMessage(message);
  208.     }
  209.  
  210.     public void sendGetSingleSettingOptions(String s)
  211.     {
  212.         message = new CameraMessage(9, mMessageCallback);
  213.         message.put("param", s);
  214.         commandHandler.sendMessage(message);
  215.     }
  216.  
  217.     public void sendGetSpace(String s)
  218.     {
  219.         message = new CameraMessage(5, mMessageCallback);
  220.         message.put("type", s);
  221.         commandHandler.sendMessage(message);
  222.     }
  223.  
  224.     public void sendGetThumb(String s, String s1)
  225.     {
  226.         message = new CameraMessage(1025, mMessageCallback);
  227.         message.put("type", s);
  228.         message.put("param", s1);
  229.         commandHandler.sendMessage(message);
  230.     }
  231.  
  232.     public void sendIntoIdleStateMode()
  233.     {
  234.         message = new CameraMessage(0x100000d, mMessageCallback);
  235.         commandHandler.sendMessage(message);
  236.     }
  237.  
  238.     public void sendIsBindedBluetoothDevs()
  239.     {
  240.         message = new CameraMessage(0x100000f, mMessageCallback);
  241.         commandHandler.sendMessage(message);
  242.     }
  243.  
  244.     public void sendListing()
  245.     {
  246.         message = new CameraMessage(1282, mMessageCallback);
  247.         commandHandler.sendMessage(message);
  248.     }
  249.  
  250.     public void sendListingWithOption(String s)
  251.     {
  252.         message = new CameraMessage(1282, mMessageCallback);
  253.         message.put("param", s);
  254.         commandHandler.sendMessage(message);
  255.     }
  256.  
  257.     public void sendListingWithOptions(String s)
  258.     {
  259.         message = new CameraMessage(1282, mMessageCallback);
  260.         message.put("param", (new StringBuilder()).append(s).append(" -D -S").toString());
  261.         commandHandler.sendMessage(message);
  262.     }
  263.  
  264.     public void sendOutIdleStateMode()
  265.     {
  266.         message = new CameraMessage(0x100000e, mMessageCallback);
  267.         commandHandler.sendMessage(message);
  268.     }
  269.  
  270.     public void sendPIV()
  271.     {
  272.         message = new CameraMessage(0x100000b, mMessageCallback);
  273.         commandHandler.sendMessage(message);
  274.     }
  275.  
  276.     public void sendPutFIle(File file, String s)
  277.     {
  278.         message = new CameraMessage(1286, mMessageCallback);
  279.         message.put("md5sum", FileUtil.getFileMD5(file));
  280.         message.put("param", s);
  281.         message.put("size", Long.valueOf(file.length()));
  282.         message.put("offset", Integer.valueOf(0));
  283.         commandHandler.sendMessage(message);
  284.     }
  285.  
  286.     public void sendQuickRecordPause()
  287.     {
  288.         message = new CameraMessage(0x1000006, mMessageCallback);
  289.         commandHandler.sendMessage(message);
  290.     }
  291.  
  292.     public void sendQuickRecordResume()
  293.     {
  294.         message = new CameraMessage(0x1000007, mMessageCallback);
  295.         commandHandler.sendMessage(message);
  296.     }
  297.  
  298.     public void sendQuickRecordStart()
  299.     {
  300.         message = new CameraMessage(0x1000005, mMessageCallback);
  301.         commandHandler.sendMessage(message);
  302.     }
  303.  
  304.     public void sendResetVF()
  305.     {
  306.         message = new CameraMessage(259, mMessageCallback);
  307.         message.put("param", "none_force");
  308.         commandHandler.sendMessage(message);
  309.     }
  310.  
  311.     public void sendRestartWiFi()
  312.     {
  313.         message = new CameraMessage(0x1000008, mMessageCallback);
  314.         commandHandler.sendMessage(message);
  315.     }
  316.  
  317.     public void sendSetCaptureMode(String s)
  318.     {
  319.         message = new CameraMessage(0x100000c, mMessageCallback);
  320.         message.put("param", s);
  321.         commandHandler.sendMessage(message);
  322.     }
  323.  
  324.     public void sendSetDigitalZoom(String s, String s1)
  325.     {
  326.         message = new CameraMessage(14, mMessageCallback);
  327.         message.put("type", s);
  328.         message.put("param", s1);
  329.         commandHandler.sendMessage(message);
  330.     }
  331.  
  332.     public void sendSetSetting(String s, String s1)
  333.     {
  334.         message = new CameraMessage(2, mMessageCallback);
  335.         message.put("type", s);
  336.         message.put("param", s1);
  337.         commandHandler.sendMessage(message);
  338.     }
  339.  
  340.     public void sendStartRecord()
  341.     {
  342.         message = new CameraMessage(513, mMessageCallback);
  343.         commandHandler.sendMessage(message);
  344.     }
  345.  
  346.     public void sendStopRecord()
  347.     {
  348.         message = new CameraMessage(514, mMessageCallback);
  349.         commandHandler.sendMessage(message);
  350.     }
  351.  
  352.     public void sendStopVF()
  353.     {
  354.         message = new CameraMessage(260, mMessageCallback);
  355.         commandHandler.sendMessage(message);
  356.     }
  357.  
  358.     public void sendTakePhoto()
  359.     {
  360.         message = new CameraMessage(769, mMessageCallback);
  361.         commandHandler.sendMessage(message);
  362.     }
  363.  
  364.     public void sendTakePhotoWithMode(String s)
  365.     {
  366.         message = new CameraMessage(0x1000004, mMessageCallback);
  367.         message.put("param", s);
  368.         commandHandler.sendMessage(message);
  369.     }
  370.  
  371.     public void sendUnbindBluetoothDevs()
  372.     {
  373.         message = new CameraMessage(0x1000010, mMessageCallback);
  374.         commandHandler.sendMessage(message);
  375.     }
  376.  
  377.     public void sendUpgrade(String s)
  378.     {
  379.         message = new CameraMessage(0x1000003, mMessageCallback);
  380.         message.put("param", s);
  381.         commandHandler.sendMessage(message);
  382.     }
  383.  
  384.     public void setMessageCallback(CameraMessageCallback cameramessagecallback)
  385.     {
  386.         mMessageCallback = cameramessagecallback;
  387.     }
  388.  
  389.     public void startSession()
  390.     {
  391.         message = new CameraMessage(257, mMessageCallback);
  392.         message.put("param", Integer.valueOf(0));
  393.         commandHandler.start();
  394.         commandHandler.sendMessage(message);
  395.         commandHandler.bindController(this);
  396.     }
  397.  
  398.     public void stopSession()
  399.     {
  400.         if (AntsSportsCameraSocketConnection.sessionStart)
  401.         {
  402.             message = new CameraMessage(258, mMessageCallback);
  403.             commandHandler.sendMessage(message);
  404.         }
  405.     }
  406.  
  407.     public void unRegisterMessageHandler()
  408.     {
  409.         mMessageCallback = null;
  410.     }
  411.  
  412.     public void unRegisterNotificationHandler(CameraMessageCallback cameramessagecallback)
  413.     {
  414.         commandHandler.unRegisterNotificationHandler(cameramessagecallback);
  415.     }
  416. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top