Virtual Trading v2.0.95版本的 MD5 值为:ef0f95d706f7364286da0edbbd29a27d

以下内容为反编译后的 BrowserPromptHelper.java 源代码,内容仅作参考


package com.sunny.CustomWebView;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import com.google.appinventor.components.annotations.DesignerComponent;
import com.google.appinventor.components.annotations.SimpleObject;
import com.google.appinventor.components.annotations.UsesActivities;
import com.google.appinventor.components.annotations.androidmanifest.ActionElement;
import com.google.appinventor.components.annotations.androidmanifest.ActivityElement;
import com.google.appinventor.components.annotations.androidmanifest.CategoryElement;
import com.google.appinventor.components.annotations.androidmanifest.DataElement;
import com.google.appinventor.components.annotations.androidmanifest.IntentFilterElement;
import com.google.appinventor.components.common.ComponentCategory;
import com.google.appinventor.components.runtime.AndroidNonvisibleComponent;
import com.google.appinventor.components.runtime.ComponentContainer;
import com.google.appinventor.components.runtime.util.JsonUtil;
import com.google.appinventor.components.runtime.util.NanoHTTPD;

@UsesActivities(activities = {@ActivityElement(intentFilters = {@IntentFilterElement(actionElements = {@ActionElement(name = "android.intent.action.VIEW")}, categoryElements = {@CategoryElement(name = "android.intent.category.DEFAULT"), @CategoryElement(name = "android.intent.category.BROWSABLE")}, dataElements = {@DataElement(scheme = "http"), @DataElement(scheme = "https")}), @IntentFilterElement(actionElements = {@ActionElement(name = "android.intent.action.VIEW")}, categoryElements = {@CategoryElement(name = "android.intent.category.DEFAULT"), @CategoryElement(name = "android.intent.category.BROWSABLE")}, dataElements = {@DataElement(scheme = "http"), @DataElement(scheme = "https"), @DataElement(mimeType = NanoHTTPD.MIME_HTML), @DataElement(mimeType = NanoHTTPD.MIME_PLAINTEXT), @DataElement(mimeType = "application/xhtml+xml")})}, name = "com.sunny.CustomWebView.BrowserPromptHelper$WebActivity")})
@DesignerComponent(androidMinSdk = 21, category = ComponentCategory.EXTENSION, description = "Helper class of CustomWebView extension to add app to browsers list<br> Developed by Sunny Gupta", helpUrl = "https://github.com/vknow360/CustomWebView", iconName = "https://res.cloudinary.com/andromedaviewflyvipul/image/upload/c_scale,h_20,w_20/v1571472765/ktvu4bapylsvnykoyhdm.png", nonVisible = true, version = 1, versionName = "1.1")
@SimpleObject(external = true)
public final class BrowserPromptHelper extends AndroidNonvisibleComponent {

    public static class WebActivity extends Activity {
        @Override
        protected void onCreate(Bundle bundle) {
            super.onCreate(bundle);
            Uri data = getIntent().getData();
            if (data == null || data.toString() == null) {
                return;
            }
            Intent launchIntentForPackage = getPackageManager().getLaunchIntentForPackage(getPackageName());
            launchIntentForPackage.putExtra("APP_INVENTOR_START", JsonUtil.encodeJsonObject(data.toString()));
            startActivity(launchIntentForPackage);
            finish();
        }
    }

    public BrowserPromptHelper(ComponentContainer componentContainer) {
        super(componentContainer.$form());
    }
}