Java 类org.apache.cordova.api.PluginResult.Status 实例源码

项目:mensacard-hack    文件:NfcPlugin.java   
private PluginResult registerTagListener() throws NFCException, JSONException {
    ReaderWriterManager nfc = ReaderWriterManager.getInstance();

    tagListener  = new DetectionListener() {

        public void onTargetDetected(Target target) {

            Hashtable props = Util.getTagProperties(target);

            NDEFMessage message = null;
            try {
                NDEFTagConnection tagConnection = (NDEFTagConnection) Connector.open(target.getUri(Target.NDEF_TAG));
                message = tagConnection.read();  // might want to handle NFCException different
            } catch (IOException e) {
                Logger.error("Failed reading tag " + e.toString());
            }

            fireNdefEvent(TAG_DEFAULT, message, props);

        }
    };
    nfc.addDetectionListener(tagListener);
    return new PluginResult(Status.OK);
}
项目:12306-android-Decompile    文件:AccelListener.java   
private void fail(int paramInt, String paramString)
{
  JSONObject localJSONObject = new JSONObject();
  try
  {
    localJSONObject.put("code", paramInt);
    localJSONObject.put("message", paramString);
    PluginResult localPluginResult = new PluginResult(PluginResult.Status.ERROR, localJSONObject);
    localPluginResult.setKeepCallback(true);
    this.callbackContext.sendPluginResult(localPluginResult);
    return;
  }
  catch (JSONException localJSONException)
  {
    while (true)
      localJSONException.printStackTrace();
  }
}
项目:12306-android-Decompile    文件:AccelListener.java   
public boolean execute(String paramString, JSONArray paramJSONArray, CallbackContext paramCallbackContext)
{
  if (paramString.equals("start"))
  {
    this.callbackContext = paramCallbackContext;
    if (this.status != RUNNING)
      start();
  }
  while (true)
  {
    PluginResult localPluginResult = new PluginResult(PluginResult.Status.NO_RESULT, "");
    localPluginResult.setKeepCallback(true);
    paramCallbackContext.sendPluginResult(localPluginResult);
    return true;
    if (!paramString.equals("stop"))
      break;
    if (this.status != RUNNING)
      continue;
    stop();
  }
  return false;
}
项目:12306-android-Decompile    文件:NativeToJsMessageQueue.java   
public void addPluginResult(PluginResult paramPluginResult, String paramString)
{
  if (paramString == null)
  {
    Log.e("JsMessageQueue", "Got plugin result with no callbackId", new Throwable());
    return;
  }
  if (paramPluginResult.getStatus() == PluginResult.Status.NO_RESULT.ordinal());
  for (int i = 1; ; i = 0)
  {
    boolean bool = paramPluginResult.getKeepCallback();
    if ((i != 0) && (bool))
      break;
    enqueueMessage(new JsMessage(paramPluginResult, paramString));
    return;
  }
}
项目:12306-android-Decompile    文件:InAppBrowser.java   
public void onReceivedError(WebView paramWebView, int paramInt, String paramString1, String paramString2)
{
  super.onReceivedError(paramWebView, paramInt, paramString1, paramString2);
  try
  {
    JSONObject localJSONObject = new JSONObject();
    localJSONObject.put("type", "loaderror");
    localJSONObject.put("url", paramString2);
    localJSONObject.put("code", paramInt);
    localJSONObject.put("message", paramString1);
    InAppBrowser.this.sendUpdate(localJSONObject, true, PluginResult.Status.ERROR);
    return;
  }
  catch (JSONException localJSONException)
  {
    Log.d("InAppBrowser", "Should never happen");
  }
}
项目:12306-android-Decompile    文件:NativePage.java   
public boolean execute(String paramString, JSONArray paramJSONArray, CallbackContext paramCallbackContext)
  throws JSONException
{
  try
  {
    if ("show".equals(paramString))
    {
      show(paramJSONArray);
      paramCallbackContext.success(PluginResult.Status.OK.name());
      return true;
    }
    paramCallbackContext.error("Invalid action: " + paramString);
    return true;
  }
  catch (Exception localException)
  {
    WLUtils.debug("NativePage.show failed. Reason is: " + localException.getMessage(), localException);
    paramCallbackContext.error("NativePage.show failed. Reason is: " + localException.getMessage());
  }
  return true;
}
项目:12306-android-Decompile    文件:DeviceAuthPlugin.java   
private String saveCertificate(JSONArray paramJSONArray)
{
  try
  {
    String str1 = paramJSONArray.getString(0);
    String str2 = paramJSONArray.getString(1);
    String str3 = paramJSONArray.getString(2);
    WLDeviceAuthManager.getInstance().saveCertificate(str1, str2, str3);
    String str4 = PluginResult.Status.OK.name();
    return str4;
  }
  catch (Exception localException)
  {
    WLUtils.error("Authentication with Worklight server failed, because device provisioning is unable to save required certificate with " + localException.getMessage(), localException);
  }
  return "result:error";
}
项目:12306-android-Decompile    文件:CloseDatabaseActionDispatcher.java   
public PluginResult dispatch(BaseActionDispatcher.Context paramContext)
  throws Throwable
{
  DatabaseManager localDatabaseManager = DatabaseManager.getInstance();
  try
  {
    localDatabaseManager.clearDbPath();
    localDatabaseManager.clearDatabaseKey();
    if (localDatabaseManager.isDatabaseOpen())
      localDatabaseManager.closeDatabase();
    PluginResult localPluginResult = new PluginResult(PluginResult.Status.OK, 0);
    return localPluginResult;
  }
  catch (Throwable localThrowable)
  {
  }
  return new PluginResult(PluginResult.Status.ERROR, 23);
}
项目:12306-android-Decompile    文件:FindByIdActionDispatcher.java   
public PluginResult dispatch(DatabaseActionDispatcher.Context paramContext)
  throws Throwable
{
  JSONArray localJSONArray1 = getIds(paramContext);
  try
  {
    JSONArray localJSONArray2 = (JSONArray)paramContext.performReadableDatabaseAction(new FindByIdAction(localJSONArray1, null));
    if (localJSONArray2 == null)
      return new PluginResult(PluginResult.Status.ERROR, 22);
    JacksonSerializedPluginResult localJacksonSerializedPluginResult = new JacksonSerializedPluginResult(PluginResult.Status.OK, localJSONArray2);
    return localJacksonSerializedPluginResult;
  }
  catch (Throwable localThrowable)
  {
    if (this.logger.isLoggable(6))
      this.logger.logError("error while executing find by ID query on database \"" + paramContext.getDatabaseName() + "\"", localThrowable);
  }
  return new PluginResult(PluginResult.Status.ERROR, 22);
}
项目:12306-android-Decompile    文件:ChangePasswordActionDispatcher.java   
public PluginResult dispatch(BaseActionDispatcher.Context paramContext)
  throws Throwable
{
  if (!DatabaseManager.getInstance().isDatabaseOpen())
    return new PluginResult(PluginResult.Status.ERROR, -50);
  String str1 = getNewPW(paramContext);
  String str2 = getOldPW(paramContext);
  String str3 = getUserName(paramContext);
  SecurityManager localSecurityManager = SecurityManager.getInstance(paramContext.getCordovaContext().getActivity());
  try
  {
    String str4 = localSecurityManager.getDPK(str2, str3);
    String str5 = localSecurityManager.getSalt(str3);
    localSecurityManager.storeDPK(str1, str3, str4, str5, true, false);
    return new PluginResult(PluginResult.Status.OK, 0);
  }
  catch (Throwable localThrowable)
  {
  }
  return new PluginResult(PluginResult.Status.ERROR, 24);
}
项目:12306-android-Decompile    文件:MarkCleanActionDispatcher.java   
public PluginResult dispatch(DatabaseActionDispatcher.Context paramContext)
  throws Throwable
{
  JSONArray localJSONArray = getDocs(paramContext);
  for (int i = 0; i < localJSONArray.length(); i++)
  {
    JSONObject localJSONObject = localJSONArray.getJSONObject(i);
    MarkCleanAction localMarkCleanAction = new MarkCleanAction(localJSONObject.getInt("_id"), localJSONObject.getString("_operation"), null);
    try
    {
      if (((Integer)paramContext.performWritableDatabaseAction(localMarkCleanAction)).intValue() > 0)
        continue;
      PluginResult localPluginResult = new PluginResult(PluginResult.Status.ERROR, 15);
      return localPluginResult;
    }
    catch (Throwable localThrowable)
    {
      Exception localException = new Exception("Failed trying to mark document clean");
      this.logger.logError("Failed trying to mark document clean", localException);
      return new PluginResult(PluginResult.Status.ERROR, 15);
    }
  }
  return new PluginResult(PluginResult.Status.OK, 0);
}
项目:12306-android-Decompile    文件:SimpleQueryActionDispatcher.java   
public PluginResult dispatch(DatabaseActionDispatcher.Context paramContext)
  throws Throwable
{
  int i = -1;
  try
  {
    int k = ((Integer)paramContext.performReadableDatabaseAction(new SimpleQueryAction(paramContext, null))).intValue();
    i = k;
    int j = getModifiedResultValue(i);
    logResult(paramContext, j);
    return new PluginResult(PluginResult.Status.OK, j);
  }
  catch (Throwable localThrowable)
  {
    while (true)
    {
      if (!this.logger.isLoggable(6))
        continue;
      this.logger.logError("error occurred while performing query:");
      this.logger.logError("   " + getFormattedQuery(paramContext), localThrowable);
    }
  }
}
项目:12306-android-Decompile    文件:AccelListener.java   
private void fail(int paramInt, String paramString)
{
  JSONObject localJSONObject = new JSONObject();
  try
  {
    localJSONObject.put("code", paramInt);
    localJSONObject.put("message", paramString);
    PluginResult localPluginResult = new PluginResult(PluginResult.Status.ERROR, localJSONObject);
    localPluginResult.setKeepCallback(true);
    this.callbackContext.sendPluginResult(localPluginResult);
    return;
  }
  catch (JSONException localJSONException)
  {
    while (true)
      localJSONException.printStackTrace();
  }
}
项目:12306-android-Decompile    文件:AccelListener.java   
public boolean execute(String paramString, JSONArray paramJSONArray, CallbackContext paramCallbackContext)
{
  if (paramString.equals("start"))
  {
    this.callbackContext = paramCallbackContext;
    if (this.status != RUNNING)
      start();
  }
  while (true)
  {
    PluginResult localPluginResult = new PluginResult(PluginResult.Status.NO_RESULT, "");
    localPluginResult.setKeepCallback(true);
    paramCallbackContext.sendPluginResult(localPluginResult);
    return true;
    if (!paramString.equals("stop"))
      break;
    if (this.status != RUNNING)
      continue;
    stop();
  }
  return false;
}
项目:12306-android-Decompile    文件:NativeToJsMessageQueue.java   
public void addPluginResult(PluginResult paramPluginResult, String paramString)
{
  if (paramString == null)
  {
    Log.e("JsMessageQueue", "Got plugin result with no callbackId", new Throwable());
    return;
  }
  if (paramPluginResult.getStatus() == PluginResult.Status.NO_RESULT.ordinal());
  for (int i = 1; ; i = 0)
  {
    boolean bool = paramPluginResult.getKeepCallback();
    if ((i != 0) && (bool))
      break;
    enqueueMessage(new JsMessage(paramPluginResult, paramString));
    return;
  }
}
项目:12306-android-Decompile    文件:InAppBrowser.java   
public void onReceivedError(WebView paramWebView, int paramInt, String paramString1, String paramString2)
{
  super.onReceivedError(paramWebView, paramInt, paramString1, paramString2);
  try
  {
    JSONObject localJSONObject = new JSONObject();
    localJSONObject.put("type", "loaderror");
    localJSONObject.put("url", paramString2);
    localJSONObject.put("code", paramInt);
    localJSONObject.put("message", paramString1);
    InAppBrowser.this.sendUpdate(localJSONObject, true, PluginResult.Status.ERROR);
    return;
  }
  catch (JSONException localJSONException)
  {
    Log.d("InAppBrowser", "Should never happen");
  }
}
项目:12306-android-Decompile    文件:NativePage.java   
public boolean execute(String paramString, JSONArray paramJSONArray, CallbackContext paramCallbackContext)
  throws JSONException
{
  try
  {
    if ("show".equals(paramString))
    {
      show(paramJSONArray);
      paramCallbackContext.success(PluginResult.Status.OK.name());
      return true;
    }
    paramCallbackContext.error("Invalid action: " + paramString);
    return true;
  }
  catch (Exception localException)
  {
    WLUtils.debug("NativePage.show failed. Reason is: " + localException.getMessage(), localException);
    paramCallbackContext.error("NativePage.show failed. Reason is: " + localException.getMessage());
  }
  return true;
}
项目:12306-android-Decompile    文件:DeviceAuthPlugin.java   
private String saveCertificate(JSONArray paramJSONArray)
{
  try
  {
    String str1 = paramJSONArray.getString(0);
    String str2 = paramJSONArray.getString(1);
    String str3 = paramJSONArray.getString(2);
    WLDeviceAuthManager.getInstance().saveCertificate(str1, str2, str3);
    String str4 = PluginResult.Status.OK.name();
    return str4;
  }
  catch (Exception localException)
  {
    WLUtils.error("Authentication with Worklight server failed, because device provisioning is unable to save required certificate with " + localException.getMessage(), localException);
  }
  return "result:error";
}
项目:12306-android-Decompile    文件:CloseDatabaseActionDispatcher.java   
public PluginResult dispatch(BaseActionDispatcher.Context paramContext)
  throws Throwable
{
  DatabaseManager localDatabaseManager = DatabaseManager.getInstance();
  try
  {
    localDatabaseManager.clearDbPath();
    localDatabaseManager.clearDatabaseKey();
    if (localDatabaseManager.isDatabaseOpen())
      localDatabaseManager.closeDatabase();
    PluginResult localPluginResult = new PluginResult(PluginResult.Status.OK, 0);
    return localPluginResult;
  }
  catch (Throwable localThrowable)
  {
  }
  return new PluginResult(PluginResult.Status.ERROR, 23);
}
项目:12306-android-Decompile    文件:FindByIdActionDispatcher.java   
public PluginResult dispatch(DatabaseActionDispatcher.Context paramContext)
  throws Throwable
{
  JSONArray localJSONArray1 = getIds(paramContext);
  try
  {
    JSONArray localJSONArray2 = (JSONArray)paramContext.performReadableDatabaseAction(new FindByIdAction(localJSONArray1, null));
    if (localJSONArray2 == null)
      return new PluginResult(PluginResult.Status.ERROR, 22);
    JacksonSerializedPluginResult localJacksonSerializedPluginResult = new JacksonSerializedPluginResult(PluginResult.Status.OK, localJSONArray2);
    return localJacksonSerializedPluginResult;
  }
  catch (Throwable localThrowable)
  {
    if (this.logger.isLoggable(6))
      this.logger.logError("error while executing find by ID query on database \"" + paramContext.getDatabaseName() + "\"", localThrowable);
  }
  return new PluginResult(PluginResult.Status.ERROR, 22);
}
项目:12306-android-Decompile    文件:ChangePasswordActionDispatcher.java   
public PluginResult dispatch(BaseActionDispatcher.Context paramContext)
  throws Throwable
{
  if (!DatabaseManager.getInstance().isDatabaseOpen())
    return new PluginResult(PluginResult.Status.ERROR, -50);
  String str1 = getNewPW(paramContext);
  String str2 = getOldPW(paramContext);
  String str3 = getUserName(paramContext);
  SecurityManager localSecurityManager = SecurityManager.getInstance(paramContext.getCordovaContext().getActivity());
  try
  {
    String str4 = localSecurityManager.getDPK(str2, str3);
    String str5 = localSecurityManager.getSalt(str3);
    localSecurityManager.storeDPK(str1, str3, str4, str5, true, false);
    return new PluginResult(PluginResult.Status.OK, 0);
  }
  catch (Throwable localThrowable)
  {
  }
  return new PluginResult(PluginResult.Status.ERROR, 24);
}
项目:12306-android-Decompile    文件:MarkCleanActionDispatcher.java   
public PluginResult dispatch(DatabaseActionDispatcher.Context paramContext)
  throws Throwable
{
  JSONArray localJSONArray = getDocs(paramContext);
  for (int i = 0; i < localJSONArray.length(); i++)
  {
    JSONObject localJSONObject = localJSONArray.getJSONObject(i);
    MarkCleanAction localMarkCleanAction = new MarkCleanAction(localJSONObject.getInt("_id"), localJSONObject.getString("_operation"), null);
    try
    {
      if (((Integer)paramContext.performWritableDatabaseAction(localMarkCleanAction)).intValue() > 0)
        continue;
      PluginResult localPluginResult = new PluginResult(PluginResult.Status.ERROR, 15);
      return localPluginResult;
    }
    catch (Throwable localThrowable)
    {
      Exception localException = new Exception("Failed trying to mark document clean");
      this.logger.logError("Failed trying to mark document clean", localException);
      return new PluginResult(PluginResult.Status.ERROR, 15);
    }
  }
  return new PluginResult(PluginResult.Status.OK, 0);
}
项目:12306-android-Decompile    文件:SimpleQueryActionDispatcher.java   
public PluginResult dispatch(DatabaseActionDispatcher.Context paramContext)
  throws Throwable
{
  int i = -1;
  try
  {
    int k = ((Integer)paramContext.performReadableDatabaseAction(new SimpleQueryAction(paramContext, null))).intValue();
    i = k;
    int j = getModifiedResultValue(i);
    logResult(paramContext, j);
    return new PluginResult(PluginResult.Status.OK, j);
  }
  catch (Throwable localThrowable)
  {
    while (true)
    {
      if (!this.logger.isLoggable(6))
        continue;
      this.logger.logError("error occurred while performing query:");
      this.logger.logError("   " + getFormattedQuery(paramContext), localThrowable);
    }
  }
}
项目:steroids-plugin-googleadmob    文件:AdMobPlugin.java   
/**
 * Parses the create banner view input parameters and runs the create banner
 * view action on the UI thread.  If this request is successful, the developer
 * should make the requestAd call to request an ad for the banner.
 *
 * @param inputs The JSONArray representing input parameters.  This function
 *        expects the first object in the array to be a JSONObject with the
 *        input parameters.
 * @return A PluginResult representing whether or not the banner was created
 *         successfully.
 */
private PluginResult executeCreateBannerView(JSONArray inputs) {
  String publisherId;
  String size;

  // Get the input data.
  try {
    JSONObject data = inputs.getJSONObject(0);
    publisherId = data.getString("publisherId");
    size = data.getString("adSize");
    this.positionAtTop = data.getBoolean("positionAtTop");
  } catch (JSONException exception) {
    Log.w(LOGTAG, String.format("Got JSON Exception: %s", exception.getMessage()));
    return new PluginResult(Status.JSON_EXCEPTION);
  }

  // Create the AdView on the UI thread.
  return executeRunnable(new CreateBannerViewRunnable(
      publisherId, adSizeFromSize(size)));
}
项目:steroids-plugin-googleadmob    文件:AdMobPlugin.java   
/**
 * Parses the request ad input parameters and runs the request ad action on
 * the UI thread.
 *
 * @param inputs The JSONArray representing input parameters.  This function
 *        expects the first object in the array to be a JSONObject with the
 *        input parameters.
 * @return A PluginResult representing whether or not an ad was requested
 *         succcessfully.  Listen for onReceiveAd() and onFailedToReceiveAd()
 *         callbacks to see if an ad was successfully retrieved. 
 */
private PluginResult executeRequestAd(JSONArray inputs) {
  boolean isTesting;
  JSONObject inputExtras;

  // Get the input data.
  try {
    JSONObject data = inputs.getJSONObject(0);
    isTesting = data.getBoolean("isTesting");
    inputExtras = data.getJSONObject("extras");
  } catch (JSONException exception) {
    Log.w(LOGTAG, String.format("Got JSON Exception: %s", exception.getMessage()));
    return new PluginResult(Status.JSON_EXCEPTION);
  }

  // Request an ad on the UI thread.
  return executeRunnable(new RequestAdRunnable(isTesting, inputExtras));
}
项目:mensacard-hack    文件:NfcPlugin.java   
private PluginResult registerMimeListener(JSONArray args) throws NFCException, JSONException {
    ReaderWriterManager nfc = ReaderWriterManager.getInstance();
    String mimeType = args.getString(0);

    NDEFMessageListener listener = new NDEFMessageListener() {
        public void onNDEFMessageDetected(final NDEFMessage msg)
        {
            NfcPlugin.this.fireNdefEvent(NDEF_MIME, msg, null);
        }
    };

    nfc.addNDEFMessageListener(listener, NDEFRecord.TNF_MEDIA, mimeType, true);
    return new PluginResult(Status.OK);
}
项目:mensacard-hack    文件:NfcPlugin.java   
private PluginResult shareTag(JSONArray args) throws NFCException, JSONException {

        NDEFMessage message = Util.jsonToNdefMessage(args.getString(0));
        virtualTag = new VirtualNDEFTag(message);
        virtualTag.startEmulation();
        return new PluginResult(Status.OK);
    }
项目:12306-android-Decompile    文件:NativeToJsMessageQueue.java   
void encodeAsJsMessage(StringBuilder paramStringBuilder)
{
  if (this.pluginResult == null)
  {
    paramStringBuilder.append(this.jsPayloadOrCallbackId);
    return;
  }
  int i = this.pluginResult.getStatus();
  if ((i == PluginResult.Status.OK.ordinal()) || (i == PluginResult.Status.NO_RESULT.ordinal()));
  for (boolean bool = true; ; bool = false)
  {
    paramStringBuilder.append("cordova.callbackFromNative('").append(this.jsPayloadOrCallbackId).append("',").append(bool).append(",").append(i).append(",[").append(this.pluginResult.getMessage()).append("],").append(this.pluginResult.getKeepCallback()).append(");");
    return;
  }
}
项目:12306-android-Decompile    文件:NetworkManager.java   
private void sendUpdate(String paramString)
{
  if (this.connectionCallbackContext != null)
  {
    PluginResult localPluginResult = new PluginResult(PluginResult.Status.OK, paramString);
    localPluginResult.setKeepCallback(true);
    this.connectionCallbackContext.sendPluginResult(localPluginResult);
  }
  this.webView.postMessage("networkconnection", paramString);
}
项目:12306-android-Decompile    文件:NetworkManager.java   
public boolean execute(String paramString, JSONArray paramJSONArray, CallbackContext paramCallbackContext)
{
  if (paramString.equals("getConnectionInfo"))
  {
    this.connectionCallbackContext = paramCallbackContext;
    NetworkInfo localNetworkInfo = this.sockMan.getActiveNetworkInfo();
    PluginResult localPluginResult = new PluginResult(PluginResult.Status.OK, getConnectionInfo(localNetworkInfo));
    localPluginResult.setKeepCallback(true);
    paramCallbackContext.sendPluginResult(localPluginResult);
    return true;
  }
  return false;
}
项目:12306-android-Decompile    文件:CameraLauncher.java   
public boolean execute(String paramString, JSONArray paramJSONArray, CallbackContext paramCallbackContext)
  throws JSONException
{
  this.callbackContext = paramCallbackContext;
  if (paramString.equals("takePicture"))
  {
    this.saveToPhotoAlbum = false;
    this.targetHeight = 0;
    this.targetWidth = 0;
    this.encodingType = 0;
    this.mediaType = 0;
    this.mQuality = 80;
    this.mQuality = paramJSONArray.getInt(0);
    int i = paramJSONArray.getInt(1);
    int j = paramJSONArray.getInt(2);
    this.targetWidth = paramJSONArray.getInt(3);
    this.targetHeight = paramJSONArray.getInt(4);
    this.encodingType = paramJSONArray.getInt(5);
    this.mediaType = paramJSONArray.getInt(6);
    this.correctOrientation = paramJSONArray.getBoolean(8);
    this.saveToPhotoAlbum = paramJSONArray.getBoolean(9);
    if (this.targetWidth < 1)
      this.targetWidth = -1;
    if (this.targetHeight < 1)
      this.targetHeight = -1;
    if (j == 1)
      takePicture(i, this.encodingType);
    while (true)
    {
      PluginResult localPluginResult = new PluginResult(PluginResult.Status.NO_RESULT);
      localPluginResult.setKeepCallback(true);
      paramCallbackContext.sendPluginResult(localPluginResult);
      return true;
      if ((j != 0) && (j != 2))
        continue;
      getImage(j, i);
    }
  }
  return false;
}
项目:12306-android-Decompile    文件:FileTransfer.java   
public boolean execute(String paramString, JSONArray paramJSONArray, CallbackContext paramCallbackContext)
  throws JSONException
{
  if ((paramString.equals("upload")) || (paramString.equals("download")))
  {
    String str1 = paramJSONArray.getString(0);
    String str2 = paramJSONArray.getString(1);
    if (paramString.equals("upload"))
      try
      {
        upload(URLDecoder.decode(str1, "UTF-8"), str2, paramJSONArray, paramCallbackContext);
        return true;
      }
      catch (UnsupportedEncodingException localUnsupportedEncodingException)
      {
        paramCallbackContext.sendPluginResult(new PluginResult(PluginResult.Status.MALFORMED_URL_EXCEPTION, "UTF-8 error."));
        return true;
      }
    download(str1, str2, paramJSONArray, paramCallbackContext);
    return true;
  }
  if (paramString.equals("abort"))
  {
    abort(paramJSONArray.getString(0));
    paramCallbackContext.success();
    return true;
  }
  return false;
}
项目:12306-android-Decompile    文件:BatteryListener.java   
private void sendUpdate(JSONObject paramJSONObject, boolean paramBoolean)
{
  if (this.batteryCallbackContext != null)
  {
    PluginResult localPluginResult = new PluginResult(PluginResult.Status.OK, paramJSONObject);
    localPluginResult.setKeepCallback(paramBoolean);
    this.batteryCallbackContext.sendPluginResult(localPluginResult);
  }
}
项目:12306-android-Decompile    文件:BatteryListener.java   
public boolean execute(String paramString, JSONArray paramJSONArray, CallbackContext paramCallbackContext)
{
  if (paramString.equals("start"))
  {
    if (this.batteryCallbackContext != null)
    {
      paramCallbackContext.error("Battery listener already running.");
      return true;
    }
    this.batteryCallbackContext = paramCallbackContext;
    IntentFilter localIntentFilter = new IntentFilter();
    localIntentFilter.addAction("android.intent.action.BATTERY_CHANGED");
    if (this.receiver == null)
    {
      this.receiver = new BroadcastReceiver()
      {
        public void onReceive(Context paramContext, Intent paramIntent)
        {
          BatteryListener.this.updateBatteryInfo(paramIntent);
        }
      };
      this.cordova.getActivity().registerReceiver(this.receiver, localIntentFilter);
    }
    PluginResult localPluginResult = new PluginResult(PluginResult.Status.NO_RESULT);
    localPluginResult.setKeepCallback(true);
    paramCallbackContext.sendPluginResult(localPluginResult);
    return true;
  }
  if (paramString.equals("stop"))
  {
    removeBatteryListener();
    sendUpdate(new JSONObject(), false);
    this.batteryCallbackContext = null;
    paramCallbackContext.success();
    return true;
  }
  return false;
}
项目:12306-android-Decompile    文件:ChildBrowser.java   
private void sendUpdate(JSONObject paramJSONObject, boolean paramBoolean)
{
  if (this.browserCallbackId != null)
  {
    Log.d("ChildBrowser", this.browserCallbackId);
    PluginResult localPluginResult = new PluginResult(PluginResult.Status.OK, paramJSONObject);
    localPluginResult.setKeepCallback(paramBoolean);
    success(localPluginResult, this.browserCallbackId);
  }
}
项目:12306-android-Decompile    文件:WebResourcesDownloaderPlugin.java   
public boolean execute(String paramString, JSONArray paramJSONArray, CallbackContext paramCallbackContext)
  throws JSONException
{
  try
  {
    if ((!"updateApp".equals(paramString)) && (!"switchApp".equals(paramString)))
    {
      paramCallbackContext.error("Invalid action: " + paramString);
      return true;
    }
    String str1 = CookieManager.getInstance().getCookie(new WLConfig(this.cordova.getActivity()).getAppURL().toString());
    String str2 = paramJSONArray.getString(0);
    if (str2 != null)
      str2 = str2.trim();
    boolean bool = paramJSONArray.getString(1).equals("true");
    String str3 = WLUtils.readWLPref(this.cordova.getActivity(), "wlSkinName");
    if ("updateApp".equals(paramString))
    {
      String str7 = new WLConfig(this.cordova.getActivity()).getAppURL().toString() + "updates?action=getzip&skin=" + str3;
      new WebResourcesDownloader((WLDroidGap)this.cordova, str1, str2, bool, "directUpdateDownloadingMessage", str7, str3).execute(new Void[0]);
    }
    while (true)
    {
      paramCallbackContext.success(PluginResult.Status.OK.name());
      return true;
      if (!"switchApp".equals(paramString))
        continue;
      String str4 = paramJSONArray.getString(1);
      String str5 = paramJSONArray.getString(2);
      String str6 = new WLConfig(this.cordova.getActivity()).getRootURL().toString() + "/dev/appdata?appId=" + str4 + "&appVer=" + str5 + "&appEnv=android&skin=" + str3;
      new WebResourcesDownloader((WLDroidGap)this.cordova, str1, str2, false, "downloadingWebResourcesMessage", str6, str3).execute(new Void[0]);
    }
  }
  catch (JSONException localJSONException)
  {
    paramCallbackContext.error("Action: " + paramString + " failed. " + localJSONException.getMessage());
  }
  return true;
}
项目:12306-android-Decompile    文件:SSLWebResourcesDownloaderPlugin.java   
public boolean execute(String paramString, JSONArray paramJSONArray, CallbackContext paramCallbackContext)
  throws JSONException
{
  try
  {
    if ((!"updateApp".equals(paramString)) && (!"switchApp".equals(paramString)))
    {
      paramCallbackContext.error("Invalid action: " + paramString);
      return true;
    }
    String str1 = CookieManager.getInstance().getCookie(new WLConfig(this.cordova.getActivity()).getAppURL().toString());
    String str2 = paramJSONArray.getString(0);
    if (str2 != null)
      str2 = str2.trim();
    boolean bool = paramJSONArray.getString(1).equals("true");
    String str3 = WLUtils.readWLPref(this.cordova.getActivity(), "wlSkinName");
    if ("updateApp".equals(paramString))
    {
      String str7 = new WLConfig(this.cordova.getActivity()).getAppURL().toString() + "updates?action=getzip&skin=" + str3;
      new SSLWebResourcesDownloader((WLDroidGap)this.cordova, str1, str2, bool, "directUpdateDownloadingMessage", str7, str3).execute(new Void[0]);
    }
    while (true)
    {
      paramCallbackContext.success(PluginResult.Status.OK.name());
      return true;
      if (!"switchApp".equals(paramString))
        continue;
      String str4 = paramJSONArray.getString(1);
      String str5 = paramJSONArray.getString(2);
      String str6 = new WLConfig(this.cordova.getActivity()).getRootURL().toString() + "/dev/appdata?appId=" + str4 + "&appVer=" + str5 + "&appEnv=android&skin=" + str3;
      new SSLWebResourcesDownloader((WLDroidGap)this.cordova, str1, str2, false, "downloadingWebResourcesMessage", str6, str3).execute(new Void[0]);
    }
  }
  catch (JSONException localJSONException)
  {
    paramCallbackContext.error("Action: " + paramString + " failed. " + localJSONException.getMessage());
  }
  return true;
}
项目:12306-android-Decompile    文件:WLGeolocationPlugin.java   
private boolean getLocation(JSONArray paramJSONArray, CallbackContext paramCallbackContext)
  throws JSONException
{
  int i = paramJSONArray.getInt(2);
  Location localLocation1 = this.gpsListener.getLastKnownLocation();
  Location localLocation2 = this.networkListener.getLastKnownLocation();
  Location localLocation3;
  if ((localLocation1 != null) && (localLocation2 != null))
    if (localLocation1.getTime() >= localLocation2.getTime())
      localLocation3 = localLocation1;
  while ((localLocation3 != null) && (System.currentTimeMillis() - localLocation3.getTime() <= i))
  {
    paramCallbackContext.sendPluginResult(new PluginResult(PluginResult.Status.OK, returnLocationJSON(localLocation3)));
    return true;
    localLocation3 = localLocation2;
    continue;
    if (localLocation1 != null)
    {
      localLocation3 = localLocation1;
      continue;
    }
    localLocation3 = null;
    if (localLocation2 == null)
      continue;
    localLocation3 = localLocation2;
  }
  String str = paramJSONArray.getString(0);
  WLLocationListener localWLLocationListener = getListener(paramJSONArray, 1, 3, paramCallbackContext);
  if (localWLLocationListener == null)
    return false;
  localWLLocationListener.addCallback(str, paramCallbackContext, i);
  return true;
}
项目:12306-android-Decompile    文件:DeviceAuthPlugin.java   
private boolean callback(String paramString, CallbackContext paramCallbackContext)
{
  if ("result:error".equals(paramString))
  {
    paramCallbackContext.error(PluginResult.Status.ERROR.name());
    return true;
  }
  paramCallbackContext.success(paramString);
  return true;
}
项目:12306-android-Decompile    文件:IsKeyGenRequiredActionDispatcher.java   
public PluginResult dispatch(BaseActionDispatcher.Context paramContext)
  throws Throwable
{
  String str = getUserName(paramContext);
  if (SecurityManager.getInstance(paramContext.getCordovaContext().getActivity()).isDPKAvailable(str));
  for (int i = 1; ; i = 0)
    return new PluginResult(PluginResult.Status.OK, i);
}