pull/423/head
gedoor 4 years ago
parent fe9c9b9cdd
commit ee33659c92
  1. 8
      app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeByJSonPath.kt

@ -36,9 +36,9 @@ class AnalyzeByJSonPath {
if (rules.size == 1) { if (rules.size == 1) {
if (!rule.contains("{$.")) { if (!rule.contains("{$.")) {
ctx?.let { ctx?.let {
try { result = try {
val ob = it.read<Any>(rule) val ob = it.read<Any>(rule)
result = if (ob is List<*>) { if (ob is List<*>) {
val builder = StringBuilder() val builder = StringBuilder()
for (o in ob) { for (o in ob) {
builder.append(o).append("\n") builder.append(o).append("\n")
@ -48,8 +48,8 @@ class AnalyzeByJSonPath {
ob.toString() ob.toString()
} }
} catch (ignored: Exception) { } catch (ignored: Exception) {
rule
} }
} }
return result return result
} else { } else {
@ -108,8 +108,8 @@ class AnalyzeByJSonPath {
result.add(obj.toString()) result.add(obj.toString())
} }
} catch (ignored: Exception) { } catch (ignored: Exception) {
result.add(rule)
} }
return result return result
} else { } else {
val matcher = jsonRulePattern.matcher(rule) val matcher = jsonRulePattern.matcher(rule)

Loading…
Cancel
Save