Rabbit-R1/android (non root)/java/sources/com/google/zxing/client/result/ISBNResultParser.java

23 lines
723 B
Java
Raw Normal View History

2024-05-21 21:08:36 +00:00
package com.google.zxing.client.result;
import com.google.zxing.BarcodeFormat;
import com.google.zxing.Result;
/* loaded from: classes3.dex */
public final class ISBNResultParser extends ResultParser {
@Override // com.google.zxing.client.result.ResultParser
public ISBNParsedResult parse(Result result) {
if (result.getBarcodeFormat() != BarcodeFormat.EAN_13) {
return null;
}
String massagedText = getMassagedText(result);
if (massagedText.length() != 13) {
return null;
}
if (massagedText.startsWith("978") || massagedText.startsWith("979")) {
return new ISBNParsedResult(massagedText);
}
return null;
}
}