修复了无法下载模组的问题
This commit is contained in:
parent
2d49c2822a
commit
46eeda943a
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -125,7 +125,8 @@ class WebModInfoActivity : BaseActivity<ActivityWebModInfoBinding>() {
|
|||
val icon = t.data.icon
|
||||
if (icon != null && icon.isNotBlank()) {
|
||||
Glide.with(this@WebModInfoActivity)
|
||||
.load(ServerConfiguration.getRealLink(icon)).apply(GlobalMethod.getRequestOptions())
|
||||
.load(ServerConfiguration.getRealLink(icon))
|
||||
.apply(GlobalMethod.getRequestOptions())
|
||||
.into(viewBinding.iconView)
|
||||
}
|
||||
title = t.data.name
|
||||
|
@ -148,7 +149,8 @@ class WebModInfoActivity : BaseActivity<ActivityWebModInfoBinding>() {
|
|||
) {
|
||||
if (data != null && holder != null) {
|
||||
Glide.with(this@WebModInfoActivity)
|
||||
.load(ServerConfiguration.getRealLink(data)).apply(GlobalMethod.getRequestOptions())
|
||||
.load(ServerConfiguration.getRealLink(data))
|
||||
.apply(GlobalMethod.getRequestOptions())
|
||||
.into(holder.imageView)
|
||||
}
|
||||
}
|
||||
|
@ -331,12 +333,15 @@ class WebModInfoActivity : BaseActivity<ActivityWebModInfoBinding>() {
|
|||
* @param fileLink String
|
||||
*/
|
||||
fun downloadWork(fileLink: String) {
|
||||
GlobalMethod.requestStoragePermissions(this) {
|
||||
if (it) {
|
||||
viewBinding.button.setText(R.string.installation_ing)
|
||||
val loadFileLayoutBinding = LoadFileLayoutBinding.inflate(layoutInflater)
|
||||
loadFileLayoutBinding.LinearProgressIndicator.max = 100
|
||||
var progress = 0
|
||||
val materialDialog = MaterialDialog(this).show {
|
||||
title(R.string.downlod).customView(view = loadFileLayoutBinding.root).cancelable(false)
|
||||
title(R.string.downlod).customView(view = loadFileLayoutBinding.root)
|
||||
.cancelable(false)
|
||||
.positiveButton(R.string.dialog_close)
|
||||
}
|
||||
|
||||
|
@ -375,7 +380,8 @@ class WebModInfoActivity : BaseActivity<ActivityWebModInfoBinding>() {
|
|||
}
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -419,7 +425,8 @@ class WebModInfoActivity : BaseActivity<ActivityWebModInfoBinding>() {
|
|||
val icon = t.data.headIcon
|
||||
if (icon != null) {
|
||||
Glide.with(this@WebModInfoActivity)
|
||||
.load(ServerConfiguration.getRealLink(icon)).apply(GlobalMethod.getRequestOptions(true))
|
||||
.load(ServerConfiguration.getRealLink(icon))
|
||||
.apply(GlobalMethod.getRequestOptions(true))
|
||||
.into(viewBinding.headIconView)
|
||||
}
|
||||
viewBinding.userNameView.text = t.data.userName
|
||||
|
|
|
@ -35,7 +35,7 @@ class CompileLogAdapter(val context: Context, analysisResults: MutableList<Analy
|
|||
position: Int
|
||||
) {
|
||||
// viewBinding.logInfoView.movementMethod = LinkMovementMethod.getInstance()
|
||||
viewBinding.logInfoView.text = data.text
|
||||
viewBinding.logInfoView.text = data.errorInfo
|
||||
if (data.icon == null) {
|
||||
viewBinding.imageView.isVisible = false
|
||||
} else {
|
||||
|
|
|
@ -210,7 +210,7 @@ class ModActionAdapter(
|
|||
compileConfiguration.getAnalysisResult()
|
||||
.forEach {
|
||||
if (it.errorType == CompileConfiguration.ErrorType.Warning) {
|
||||
warningList.add(it.text)
|
||||
warningList.add("【" + it.lineData + "】" + it.errorInfo)
|
||||
}
|
||||
}
|
||||
FileOperator.writeFile(
|
||||
|
@ -231,7 +231,7 @@ class ModActionAdapter(
|
|||
compileConfiguration.getAnalysisResult()
|
||||
.forEach {
|
||||
if (it.errorType == CompileConfiguration.ErrorType.Error) {
|
||||
errorList.add(it.text)
|
||||
errorList.add("【" + it.lineData + "】" + it.errorInfo)
|
||||
}
|
||||
}
|
||||
FileOperator.writeFile(
|
||||
|
|
|
@ -135,6 +135,11 @@ class ModFragment : BaseFragment<ModFragmentBinding>() {
|
|||
) {
|
||||
executorService.submit {
|
||||
val targetFile = modClass.modFile
|
||||
val errorFolder =
|
||||
File(AppSettings.dataRootDirectory + "/modErrorReport/" + modClass.modName)
|
||||
if (errorFolder.exists()) {
|
||||
FileOperator.delete_files(errorFolder)
|
||||
}
|
||||
val dataBasePath = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
requireActivity().applicationContext.dataDir.absolutePath + "/databases/"
|
||||
} else {
|
||||
|
|
|
@ -13,7 +13,8 @@ import com.coldmint.rust.core.dataBean.CompileConfiguration
|
|||
* @constructor
|
||||
*/
|
||||
data class AnalysisResult(
|
||||
val text: String,
|
||||
val lineData: String,
|
||||
val errorInfo: String,
|
||||
var icon: Drawable? = null,
|
||||
var function: ((View) -> Unit)? = null,
|
||||
val errorType: CompileConfiguration.ErrorType
|
||||
|
|
|
@ -33,8 +33,10 @@ data class CompileConfiguration(
|
|||
private val arrayList: ArrayList<AnalysisResult> = ArrayList(),
|
||||
private val errorIcon: Drawable? = context.getDrawable(R.drawable.error),
|
||||
private val warningIcon: Drawable? = context.getDrawable(R.drawable.warning),
|
||||
private val lineData: StringBuilder = StringBuilder(),
|
||||
//错误记录映射记录表()
|
||||
private var errorRecordMap: HashMap<CodeIndex, ErrorRecord>? = null
|
||||
private
|
||||
var errorRecordMap: HashMap<CodeIndex, ErrorRecord>? = null
|
||||
) {
|
||||
|
||||
|
||||
|
@ -54,9 +56,12 @@ data class CompileConfiguration(
|
|||
when (codeBlockType) {
|
||||
CodeBlockType.Key -> {
|
||||
keyBuilder.append(string)
|
||||
lineData.append(string)
|
||||
lineData.append(':')
|
||||
}
|
||||
CodeBlockType.Value -> {
|
||||
valueBuilder.append(string)
|
||||
lineData.append(string)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -74,6 +79,14 @@ data class CompileConfiguration(
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取行内容
|
||||
* @return String
|
||||
*/
|
||||
fun getLineData(): String {
|
||||
return lineData.toString()
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取Value
|
||||
|
@ -123,7 +136,7 @@ data class CompileConfiguration(
|
|||
val info: String,
|
||||
var function: ((View) -> Unit)? = null,
|
||||
val errorType: ErrorType = ErrorType.Warning,
|
||||
var verifyFunction: ((CompileConfiguration) -> Boolean)? = null
|
||||
var verifyFunction: ((CompileConfiguration) -> Boolean)? = null,
|
||||
)
|
||||
|
||||
|
||||
|
@ -180,6 +193,7 @@ data class CompileConfiguration(
|
|||
if (!canAddError) {
|
||||
arrayList.add(
|
||||
AnalysisResult(
|
||||
getLineData(),
|
||||
"程序错误:未经许可的方法被调用。$errorRecord",
|
||||
errorIcon, errorType = ErrorType.General
|
||||
)
|
||||
|
@ -192,7 +206,11 @@ data class CompileConfiguration(
|
|||
line + 1
|
||||
)
|
||||
val analysisResult =
|
||||
AnalysisResult(location + errorRecord.info, errorType = errorRecord.errorType)
|
||||
AnalysisResult(
|
||||
getLineData(),
|
||||
location + errorRecord.info,
|
||||
errorType = errorRecord.errorType
|
||||
)
|
||||
analysisResult.function = errorRecord.function
|
||||
when (errorRecord.errorType) {
|
||||
ErrorType.Error -> {
|
||||
|
@ -218,7 +236,7 @@ data class CompileConfiguration(
|
|||
* @param string String
|
||||
*/
|
||||
fun addInfo(string: String) {
|
||||
val analysisResult = AnalysisResult(string, errorType = ErrorType.General)
|
||||
val analysisResult = AnalysisResult(getLineData(), string, errorType = ErrorType.General)
|
||||
arrayList.add(analysisResult)
|
||||
}
|
||||
|
||||
|
@ -247,6 +265,7 @@ data class CompileConfiguration(
|
|||
codeBlockType = CodeBlockType.Key
|
||||
keyBuilder.clear()
|
||||
valueBuilder.clear()
|
||||
lineData.clear()
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.coldmint.rust.core.web
|
|||
|
||||
import android.os.Handler
|
||||
import android.os.Looper
|
||||
import android.util.Log
|
||||
import com.coldmint.rust.core.dataBean.ApiResponse
|
||||
import com.coldmint.rust.core.dataBean.OrderDataBean
|
||||
import com.coldmint.rust.core.dataBean.OrderListDataBean
|
||||
|
@ -59,6 +60,7 @@ class ActivationApp private constructor() {
|
|||
override fun onResponse(call: Call, response: Response) {
|
||||
try {
|
||||
val data = response.body!!.string()
|
||||
Log.d("确认订单", data)
|
||||
val finalApiResponse =
|
||||
gson.fromJson(data, ApiResponse::class.java)
|
||||
handler.post {
|
||||
|
|
Loading…
Reference in New Issue
Block a user