Compare commits

..

9 Commits

Author SHA1 Message Date
ZhanGSKen
f53b222b7f <webpagesources>APK 15.0.6 release Publish. 2025-06-13 10:04:49 +08:00
ZhanGSKen
0c0cde8406 编译参数冲突修复 2025-06-13 09:41:59 +08:00
ZhanGSKen
46967065c0 修复dev网站证书问题,添加证书配置。 2025-06-13 09:37:45 +08:00
ZhanGSKen
8edbff5ac1 <webpagesources>APK 15.0.5 release Publish. 2025-06-12 02:46:36 +08:00
ZhanGSKen
434f8a8549 精简信息 2025-06-12 02:44:57 +08:00
ZhanGSKen
c04be60b13 修复外部应用传入view action时的处理方法Bug 2025-06-12 02:43:51 +08:00
ZhanGSKen
641098f8fb <webpagesources>APK 15.0.4 release Publish. 2025-06-11 13:59:15 +08:00
ZhanGSKen
dba54ac4b2 编译测试 2025-06-11 13:57:48 +08:00
ZhanGSKen
c6cd779889 <webpagesources>APK 15.0.3 release Publish. 2025-06-11 13:46:01 +08:00
7 changed files with 96 additions and 49 deletions

View File

@@ -1,8 +1,8 @@
#Created by .winboll/winboll_app_build.gradle #Created by .winboll/winboll_app_build.gradle
#Wed Jun 11 13:42:17 HKT 2025 #Fri Jun 13 10:04:49 HKT 2025
stageCount=3 stageCount=7
libraryProject= libraryProject=
baseVersion=15.0 baseVersion=15.0
publishVersion=15.0.2 publishVersion=15.0.6
buildCount=0 buildCount=0
baseBetaVersion=15.0.3 baseBetaVersion=15.0.7

View File

@@ -9,6 +9,7 @@ import android.app.Activity;
import android.content.Intent; import android.content.Intent;
import android.net.Uri; import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import android.os.PersistableBundle;
import android.view.Menu; import android.view.Menu;
import android.view.MenuItem; import android.view.MenuItem;
import android.webkit.ValueCallback; import android.webkit.ValueCallback;
@@ -18,13 +19,13 @@ import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction; import androidx.fragment.app.FragmentTransaction;
import cc.winboll.studio.libappbase.GlobalApplication; import cc.winboll.studio.libappbase.GlobalApplication;
import cc.winboll.studio.libappbase.LogUtils; import cc.winboll.studio.libappbase.LogUtils;
import cc.winboll.studio.libappbase.LogView;
import cc.winboll.studio.libappbase.winboll.IWinBoLLActivity; import cc.winboll.studio.libappbase.winboll.IWinBoLLActivity;
import cc.winboll.studio.webpagesources.R; import cc.winboll.studio.webpagesources.R;
import cc.winboll.studio.webpagesources.activities.AboutActivity; import cc.winboll.studio.webpagesources.activities.AboutActivity;
import cc.winboll.studio.webpagesources.fragment.SourcesFragment; import cc.winboll.studio.webpagesources.fragment.SourcesFragment;
import cc.winboll.studio.webpagesources.fragment.WebFragment; import cc.winboll.studio.webpagesources.fragment.WebFragment;
import cc.winboll.studio.webpagesources.view.StatusBarView; import cc.winboll.studio.webpagesources.view.StatusBarView;
import com.hjq.toast.ToastUtils;
public class MainActivity extends AppCompatActivity implements IWinBoLLActivity { public class MainActivity extends AppCompatActivity implements IWinBoLLActivity {
@@ -57,7 +58,7 @@ public class MainActivity extends AppCompatActivity implements IWinBoLLActivity
setContentView(R.layout.activity_main); setContentView(R.layout.activity_main);
Toolbar toolbar = findViewById(R.id.toolbar); Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar); setSupportActionBar(toolbar);
FragmentTransaction ft = ((FragmentManager)getSupportFragmentManager()).beginTransaction(); FragmentTransaction ft = ((FragmentManager)getSupportFragmentManager()).beginTransaction();
mSourcesFragment = new SourcesFragment(); mSourcesFragment = new SourcesFragment();
ft.add(R.id.activitymainFrameLayout1, mSourcesFragment, SourcesFragment.TAG); ft.add(R.id.activitymainFrameLayout1, mSourcesFragment, SourcesFragment.TAG);
@@ -67,24 +68,23 @@ public class MainActivity extends AppCompatActivity implements IWinBoLLActivity
ft.add(R.id.activitymainFrameLayout1, mWebFragment, WebFragment.TAG); ft.add(R.id.activitymainFrameLayout1, mWebFragment, WebFragment.TAG);
ft.show(mWebFragment); ft.show(mWebFragment);
ft.commit(); ft.commit();
// 处理 onCreate 时的 Intent
handleIntent(getIntent());
mStatusBarView = findViewById(R.id.activitymainStatusBarView1); mStatusBarView = findViewById(R.id.activitymainStatusBarView1);
_MainActivity = this; _MainActivity = this;
postStatusBarMessage("主窗口加载完成。"); postStatusBarMessage("主窗口加载完成。");
} //ToastUtils.show("Start");
@Override
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
// 处理 onNewIntent 时的 IntentActivity 已存在时调用)
handleIntent(intent);
} }
private void handleIntent(Intent intent) { // @Override
// protected void onNewIntent(Intent intent) {
// super.onNewIntent(intent);
// // 处理 onNewIntent 时的 IntentActivity 已存在时调用)
// handleIntent(intent);
// }
private String getIntentUrl(Intent intent) {
if (Intent.ACTION_VIEW.equals(intent.getAction())) { if (Intent.ACTION_VIEW.equals(intent.getAction())) {
//ToastUtils.show("ACTION_VIEW");
Uri data = intent.getData(); Uri data = intent.getData();
if (data != null) { if (data != null) {
String url = data.toString(); // 获取完整 URL String url = data.toString(); // 获取完整 URL
@@ -93,17 +93,19 @@ public class MainActivity extends AppCompatActivity implements IWinBoLLActivity
// 在界面显示 URL // 在界面显示 URL
//tvUrl.setText("接收到的 URL\n" + url); //tvUrl.setText("接收到的 URL\n" + url);
mWebFragment.loadUrl(url); //ToastUtils.show(String.format("url %s", url));
return url;
// 示例:打开系统浏览器访问该 URL // 示例:打开系统浏览器访问该 URL
// Intent browserIntent = new Intent(Intent.ACTION_VIEW, data); // Intent browserIntent = new Intent(Intent.ACTION_VIEW, data);
// startActivity(browserIntent); // startActivity(browserIntent);
} }
} }
return null;
} }
public static void postStatusBarMessage(String msg) { public static void postStatusBarMessage(String msg) {
if(_MainActivity != null) { if (_MainActivity != null) {
_MainActivity.mStatusBarView.postMessage(msg); _MainActivity.mStatusBarView.postMessage(msg);
} }
} }
@@ -111,13 +113,18 @@ public class MainActivity extends AppCompatActivity implements IWinBoLLActivity
@Override @Override
protected void onPostCreate(Bundle savedInstanceState) { protected void onPostCreate(Bundle savedInstanceState) {
super.onPostCreate(savedInstanceState); super.onPostCreate(savedInstanceState);
if (_mIsLoadedHomePage) { String intentUrl = getIntentUrl(getIntent());
//ToastUtils.show("重新加载当前页面"); if (intentUrl != null && !intentUrl.trim().equals("")) {
mWebFragment.reloadLastUrl(); mWebFragment.loadUrl(intentUrl);
} else { } else {
//ToastUtils.show("加载默认主页"); if (_mIsLoadedHomePage) {
mWebFragment.loadUrl(getApplicationContext().getString(R.string.app_homepage)); //ToastUtils.show("重新加载当前页面");
_mIsLoadedHomePage = true; mWebFragment.reloadLastUrl();
} else {
//ToastUtils.show("加载默认主页");
mWebFragment.loadUrl(getApplicationContext().getString(R.string.app_homepage));
_mIsLoadedHomePage = true;
}
} }
} }

View File

@@ -6,6 +6,7 @@ package cc.winboll.studio.webpagesources.common;
* @Describe 网站登录验证工具类 * @Describe 网站登录验证工具类
*/ */
import android.content.Context; import android.content.Context;
import cc.winboll.studio.libappbase.LogUtils;
import cc.winboll.studio.libappbase.dialogs.YesNoAlertDialog; import cc.winboll.studio.libappbase.dialogs.YesNoAlertDialog;
import cc.winboll.studio.webpagesources.models.AuthenticationBean; import cc.winboll.studio.webpagesources.models.AuthenticationBean;
import java.io.File; import java.io.File;
@@ -22,10 +23,11 @@ public class AuthenticationUtils {
AuthenticationUtils(Context context) { AuthenticationUtils(Context context) {
mContext = context; mContext = context;
File beanDir = new File(context.getDataDir(), TAG); File beanDir = new File(context.getFilesDir(), "home" + File.separator + TAG);
if (!beanDir.exists()) { if (!beanDir.exists()) {
beanDir.mkdirs(); beanDir.mkdirs();
} }
LogUtils.d(TAG, String.format("beanDir %s", beanDir.toString()));
_mBeanPath = beanDir.getPath() + "/" + AuthenticationBean.class.getName() + ".json"; _mBeanPath = beanDir.getPath() + "/" + AuthenticationBean.class.getName() + ".json";
mData = new ArrayList<AuthenticationBean>(); mData = new ArrayList<AuthenticationBean>();
AuthenticationBean.loadBeanListFromFile(_mBeanPath, mData, AuthenticationBean.class); AuthenticationBean.loadBeanListFromFile(_mBeanPath, mData, AuthenticationBean.class);

View File

@@ -37,6 +37,7 @@ import cc.winboll.studio.webpagesources.R;
import cc.winboll.studio.webpagesources.thread.LinkDownLoadThread; import cc.winboll.studio.webpagesources.thread.LinkDownLoadThread;
import cc.winboll.studio.webpagesources.util.UIUtil; import cc.winboll.studio.webpagesources.util.UIUtil;
import cc.winboll.studio.webpagesources.view.ItemLongClickedPopWindow; import cc.winboll.studio.webpagesources.view.ItemLongClickedPopWindow;
import com.hjq.toast.ToastUtils;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
@@ -309,7 +310,13 @@ public class BaseWebView extends WebView {
@Override @Override
public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) { public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
LogUtils.d(TAG, "onReceivedSslError 0\nerror : " + error.toString()); //SSL证书错误修复方法
//网站证书下载网站是https://www.ssleye.com/ssltool/certs_down.html
//使用该网站访问要获取证书的主机
//获取证书后导出证书到 res/raw/<标识名称>.cer
//再在res/xml/network_security_config.xml配置网站证书设置。
ToastUtils.show("SSL证书错误!");
LogUtils.d(TAG, "SSL证书错误! onReceivedSslError 0\nerror : " + error.toString());
} }
@Override @Override
@@ -381,18 +388,5 @@ public class BaseWebView extends WebView {
public void setOnPageFinished(IOnPageFinished iOnPageFinished) { public void setOnPageFinished(IOnPageFinished iOnPageFinished) {
mIOnPageFinished = iOnPageFinished; mIOnPageFinished = iOnPageFinished;
} }
public class JSConsole {
private Context mContext;
public JSConsole(Context context) {
this.mContext = context;
}
@JavascriptInterface
public void log(String message) {
LogUtils.d(TAG, message);
}
}
} }

View File

@@ -13,6 +13,7 @@ import android.view.ViewParent;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import androidx.fragment.app.Fragment; import androidx.fragment.app.Fragment;
import cc.winboll.studio.libaes.views.AButton; import cc.winboll.studio.libaes.views.AButton;
import cc.winboll.studio.libappbase.LogUtils;
import cc.winboll.studio.webpagesources.R; import cc.winboll.studio.webpagesources.R;
import cc.winboll.studio.webpagesources.common.BaseWebView; import cc.winboll.studio.webpagesources.common.BaseWebView;
import cc.winboll.studio.webpagesources.view.URLAddressView; import cc.winboll.studio.webpagesources.view.URLAddressView;
@@ -99,7 +100,9 @@ public class WebFragment extends Fragment {
} }
public void loadUrl(String szUrl) { public void loadUrl(String szUrl) {
mBaseWebView.loadUrl(szUrl); if(mBaseWebView != null) {
mBaseWebView.loadUrl(szUrl);
}
} }
public void reloadLastUrl() { public void reloadLastUrl() {

View File

@@ -0,0 +1,37 @@
-----BEGIN CERTIFICATE-----
MIIGZDCCBUygAwIBAgIMOwCrRmG0Wi0jBsKXMA0GCSqGSIb3DQEBCwUAMFUxCzAJ
BgNVBAYTAkJFMRkwFwYDVQQKExBHbG9iYWxTaWduIG52LXNhMSswKQYDVQQDEyJH
bG9iYWxTaWduIEdDQyBSNiBBbHBoYVNTTCBDQSAyMDIzMB4XDTI0MDkxNTA2NTY1
NVoXDTI1MTAxNzA2NTY1NFowGzEZMBcGA1UEAwwQKi5zdGF0aWNmaWxlLm9yZzCC
ASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALydYBhogMuljWzzVydKnNXd
1QgbSsTM72cf+bhEZT8achjVkiPgrekfXQEMaVcdSeicDjFpC/PmNQnJStWnCr4a
nybDu65PV2uk0eDpcGDDBeExf7O4I8i9C/yzm5nvhFQQrlr9iWK2pW+ytiUefsSA
Yq8r+e63UNafv2ShaeKx/APiD5CfD4e2fQJzQkodbPiReaZaG3tTj+gZw1iME1wF
3Fd1WFgn3E7d93iy4LR45073pt+W/qD899iOc+o6kic+xFG+UjsBsfwKmzYZO75A
qad3TxtNkwHM3LWxttyQbckOQRlLjEMN0hZ2GpJ36sHeC/WyVGsDogitvllJ+KUC
AwEAAaOCA2wwggNoMA4GA1UdDwEB/wQEAwIFoDAMBgNVHRMBAf8EAjAAMIGZBggr
BgEFBQcBAQSBjDCBiTBJBggrBgEFBQcwAoY9aHR0cDovL3NlY3VyZS5nbG9iYWxz
aWduLmNvbS9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vcNAQELBQADggEBAJaNrbJ5ArwZ
9oI2mu9I0pfZGhCFB3v6T8YTDNMnEq4JR0tngbrbrP5zbpbhNJwwvEA8uzbYClan
axEOf4f3besEyPwKAq8yZUqYDLSTNjT+f0xnVNxOBElA5r5zo18Pw0nqATdfrezC
U+CoejR8lk4RRvg0zPda8f+OhYP3ERbZ0Cm2YDJtVT59+Idyp2BbzCpsRJPLvjlt
yWKkfcx/41tbcdKhNZFM3xszCz8vfy23yLv8zotY00rCT3F+NwMh2Kuqg9p+htCE
/9SLNPLlBgkHK6wzQBTJoWWXKWTk3A1iPP/+MeBcN1OlKt/Zurbrka4DoEqRAyBn
v0FDEHbg0oU=
-----END CERTIFICATE-----

View File

@@ -4,14 +4,18 @@
<domain-config cleartextTrafficPermitted="true"> <domain-config cleartextTrafficPermitted="true">
<domain includeSubdomains="true">winboll.cc</domain> <domain includeSubdomains="true">winboll.cc</domain>
</domain-config> </domain-config>
<!-- 允许 http://10.8.0.250 的明文流量 -->
<!-- 允许 10.8.0.* 网段的明文流量IPv4 通配符) -->
<domain-config cleartextTrafficPermitted="true"> <domain-config cleartextTrafficPermitted="true">
<domain includeSubdomains="false">10.8.0.*</domain> <domain includeSubdomains="false">10.8.0.250</domain>
</domain-config> </domain-config>
<!-- 允许 192.168.*.* 网段的明文流量IPv4 通配符) -->
<domain-config cleartextTrafficPermitted="true"> <domain-config cleartextTrafficPermitted="true">
<domain includeSubdomains="false">192.168.*.*</domain> <domain includeSubdomains="false">8.217.250.205</domain>
</domain-config>
<domain-config>
<domain includeSubdomains="true">staticfile.org</domain>
<trust-anchors>
<certificates src="@raw/globalsign_ca" />
</trust-anchors>
</domain-config> </domain-config>
</network-security-config> </network-security-config>