Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import com.android.tools.build.bundletool.model.BundleModule;
import com.android.tools.build.bundletool.model.ModuleEntry;
import com.android.tools.build.bundletool.model.exceptions.InvalidBundleException;
import com.android.tools.build.bundletool.model.version.BundleToolVersion;
import com.google.common.collect.ImmutableList;
import com.google.common.hash.Hashing;
import com.google.common.io.ByteSource;
Expand All @@ -51,8 +52,13 @@ public static CodeTransparency createCodeTransparencyMetadata(AppBundle bundle)
CodeTransparency.newBuilder()
.setVersion(CodeTransparencyVersion.getCurrentVersion())
.addAllCodeRelatedFile(codeRelatedFiles);

if (bundle.getStoreArchive().orElse(true)) {
if (BundleToolVersion.getCurrentVersion().compareTo(bundle.getVersion()) <= 0) {
throw InvalidBundleException.builder()
.withUserMessage("This bundletool version is lower than the one that is used to build the app bundle. " +
"Please use a bundletool with version >= " + bundle.getVersion())
.build();
}
codeTransparencyBuilder.addCodeRelatedFile(createArchivedCodeRelatedFile(bundle));
}

Expand Down