修复无法接收分享的问题

This commit is contained in:
sonichy 2024-06-01 21:22:40 +08:00
parent a1ed816e1c
commit 1384aa0307
6 changed files with 16 additions and 11 deletions

BIN
app.apk

Binary file not shown.

View File

@ -2,7 +2,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.hty.browser"
android:versionCode="4"
android:versionName="4.38">
android:versionName="4.39">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <!-- 查询网络状态权限 -->

View File

@ -9,7 +9,7 @@ p { text-indent:2em; }
</style>
</head>
<body>
<h2 align=center><img src=logo.png><br>海天鹰浏览器 V4.37</h2>
<h2 align=center><img src=logo.png><br>海天鹰浏览器 V4.39</h2>
<p>内置扩展的浏览器。</p>
<p>扩展:链接关键字过滤,链接关键字高亮,图片自定义过滤,视频独立播放。</p>
<p>作者:海天鹰</p>
@ -24,6 +24,7 @@ p { text-indent:2em; }
<p><a href="https://www.jianshu.com/p/c9a18050a249" target="_blank">字符串转Bitmap</a></p>
<p><a href="https://blog.51cto.com/u_16175498/8811197" target="_blank">添加网址到桌面</a></p>
<h3>更新日志:</h3>
<h3>V4.39 (2024-06-01)</h3><ol><li>解决接收不到分享网址的问题。</li></ol>
<h3>V4.38 (2024-04-30)</h3><ol><li>增加添加网址到桌面。</li></ol>
<h3>V4.37 (2024-03-27)</h3><ol><li>修复保存网址规则前面有1个空格的问题。</li><li>增加点击规则查看详情。</li></ol>
<h3>V4.36 (2024-03-25)</h3><ol><li>增加添加网址到主页。</li></ol>

View File

@ -25,6 +25,7 @@ img { vertical-align:middle; }
<option value="https://cn.bing.com/search?q=%s">必应</option>
<option value="https://www.sogou.com/tx?query=%s">搜搜</option>
<option value="https://www.so.com/s?q=%s">360搜索</option>
<option value="https://www.sou.com/s?q=%s">360AI搜索</option>
</select>
<input type="text" id="text_search">
<button id="button_search">搜索</button>

View File

@ -142,7 +142,7 @@ public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
if (Build.VERSION.SDK_INT >= 23) {
//Log.e(Thread.currentThread().getStackTrace()[2] + "", "checkSelfPermission: " + checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE));
if (checkSelfPermission(Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED && checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED && checkSelfPermission(Manifest.permission.INSTALL_SHORTCUT) != PackageManager.PERMISSION_GRANTED) {
requestPermissions(PERMISSIONS, REQUEST_PERMISSION_CODE);
@ -1001,7 +1001,7 @@ public class MainActivity extends Activity {
webView.loadUrl(js);
break;
case 22:
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
if (Build.VERSION.SDK_INT >= 26) {
layout = new LinearLayout(MainActivity.this);
layout.setOrientation(LinearLayout.VERTICAL);
final EditText editText_title1 = new EditText(MainActivity.this);
@ -1316,8 +1316,10 @@ public class MainActivity extends Activity {
void newWindow(String surl) {
WebView webView = new WebView(MainActivity.this);
settingWebView(webView);
if (!surl.equals(""))
if (surl.contains("://"))
webView.loadUrl(surl);
else
webView.loadUrl("https://www.baidu.com/s?wd=" + surl);
webViewLayout.removeAllViews();
webViewLayout.addView(webView);
list_webView.add(webView);
@ -1330,7 +1332,7 @@ public class MainActivity extends Activity {
void settingWebView(WebView webView) {
registerForContextMenu(webView); // 注册菜单
webView.requestFocusFromTouch(); // 请求触摸焦点
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
if (Build.VERSION.SDK_INT >= 19) {
webView.setWebContentsDebuggingEnabled(true); // 允许调试
}
@ -1576,10 +1578,11 @@ public class MainActivity extends Activity {
}
void getDataFromIntent(Intent intent) {
//Log.e(Thread.currentThread().getStackTrace()[2] + "", "intent(" + intent + ")");
if (list_webView.size() != 0 && intent.hasCategory(Intent.CATEGORY_LAUNCHER)) return;
if (intent.getAction().equals(Intent.ACTION_VIEW)) {
urln = intent.getDataString();
String type = intent.getType();
if (type != null && type.startsWith("text/") && intent.getAction().equals(Intent.ACTION_SEND)) {
urln = intent.getStringExtra(Intent.EXTRA_TEXT);
if (urln.contains("\n"))
urln = urln.substring(urln.indexOf("\n") + 1);
newWindow(urln);
} else {
String surl = sharedPreferences.getString("homepage", "file:///android_asset/home.htm");

View File

@ -1 +1 @@
{4.38}
{4.39}