amhk / arsc-cli Goto Github PK
View Code? Open in Web Editor NEWLicense: Apache License 2.0
License: Apache License 2.0
Add benchmark tests. To compare performance against aapt2, use a script similar to
#!/bin/bash
set -eu
apk="$1"
hyperfine \
--prepare 'cargo build --release' \
--warmup 2 \
"./target/release/arsc -- ${apk}" \
"aapt2 dump resources --no-values ${apk}"
Go through and fix some of the many warnings found by clippy when the following settings are applied:
$ git diff
diff --git a/arsc/src/lib.rs b/arsc/src/lib.rs
index d158207845e..0e19de87dcf 100644
--- a/arsc/src/lib.rs
+++ b/arsc/src/lib.rs
@@ -1,3 +1,11 @@
+#![warn(
+ clippy::all,
+ clippy::restriction,
+ clippy::pedantic,
+ clippy::nursery,
+ clippy::cargo,
+ )]
+
mod chunks;
mod endianness;
mod error;
The public method Table::resid_iter returns a ResourceIterator, so make the ResourceIterator public as well.
Currently the arsc crate's unit tests refer to the test-app.apk which resides outside the crate. Make the arsc create self-contained by moving the test data inside it.
Explicitly wrap the u32 resource ID references used for e.g. StringPoolSpan.name.
Increase runtime checks before accessing data in the arsc bytes stream, e.g.
Reduce API complexity by always returning an iterator regardless of the chunk type. Chunks without children (StringPool, Spec, etc) should return an empty iterator.
ValueType::Dimension is currently hard-coded to 0. Implement proper decoding.
Add documentation, especially for the arsc crates public API and the ARSC file format. Add doc tests. Also disable rustdoc for the arsc binary to prevent confusion with the arsc library:
diff --git a/Cargo.toml b/Cargo.toml
index 79b5485eea4..79c1704fde7 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -8,6 +8,7 @@ edition = "2018"
bench = false
path = "src/main.rs"
name = "arsc"
+doc = false
[workspace]
members = [
ValueType::Fraction is currently hard-coded to 0. Implement proper decoding.
All ValueType::IntColor* values are currently hard-coded to 0. Implement proper decoding.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.