伤处图片增加配置

This commit is contained in:
ningwenqiang 2024-11-05 16:06:27 +08:00
parent bd791dcc56
commit f5d1c6c2ab
4 changed files with 26 additions and 4 deletions

View File

@ -26,11 +26,11 @@ public abstract class AbsShareInterface {
TwitterResultReceiver receiver = new TwitterResultReceiver(); TwitterResultReceiver receiver = new TwitterResultReceiver();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { // API 33+
// Android 12 (API 33) 及以上版本 // Android 13 (API 33) 及以上版本使用导出标志
context.registerReceiver(receiver, filter, Context.RECEIVER_NOT_EXPORTED); context.registerReceiver(receiver, filter, Context.RECEIVER_NOT_EXPORTED);
} else { } else {
// Android 12 (API 33) 以下版本 // Android 12 (API 32) 以下版本
context.registerReceiver(receiver, filter); context.registerReceiver(receiver, filter);
} }
} }

View File

@ -104,6 +104,7 @@
</queries> </queries>
<application <application
android:networkSecurityConfig="@xml/network_security_config"
android:name="com.shayu.phonelive.AppContext" android:name="com.shayu.phonelive.AppContext"
android:allowBackup="true" android:allowBackup="true"
android:icon="@mipmap/ic_launcher" android:icon="@mipmap/ic_launcher"

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<domain-config cleartextTrafficPermitted="true">
<domain includeSubdomains="true">upload-z0.qiniup.com</domain>
</domain-config>
</network-security-config>

View File

@ -54,14 +54,29 @@ public class UploadQnImpl implements UploadStrategy {
public void complete(String key, ResponseInfo info, JSONObject response) { public void complete(String key, ResponseInfo info, JSONObject response) {
System.out.println("UploadQnImpl 上传-----ok----> " + info.isOK() + "--key---> " + "---response---> " + (response != null ? response.toString() : null)); System.out.println("UploadQnImpl 上传-----ok----> " + info.isOK() + "--key---> " + "---response---> " + (response != null ? response.toString() : null));
//L.e("UploadQnImpl 上传-----ok----> " + info.isOK() + "--key---> " + "---response---> " + (response != null ? response.toString() : null)); //L.e("UploadQnImpl 上传-----ok----> " + info.isOK() + "--key---> " + "---response---> " + (response != null ? response.toString() : null));
try { /* try {
assert response != null; assert response != null;
mList.get(mIndex).setRemoteAccessUrl(response.getString("key")); mList.get(mIndex).setRemoteAccessUrl(response.getString("key"));
} catch (JSONException e) { } catch (JSONException e) {
// throw new RuntimeException(e); // throw new RuntimeException(e);
L.e(e); L.e(e);
return; return;
}*/
if (response == null) {
// Handle the null case, e.g., log an error, throw a specific exception, etc.
L.e("Response is null");
return;
} }
try {
mList.get(mIndex).setRemoteAccessUrl(response.getString("key"));
} catch (JSONException e) {
L.e(e);
return;
}
if (mList == null || mList.size() == 0) { if (mList == null || mList.size() == 0) {
if (mUploadCallback != null) { if (mUploadCallback != null) {
mUploadCallback.onFinish(mList, false); mUploadCallback.onFinish(mList, false);