Giter Club home page Giter Club logo

arsc-cli's People

Contributors

amhk avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

arsc-cli's Issues

Add simple benchmark tests

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}"

Fix some of pedantic clippy's warnings

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;

Move test-app.apk to the arsc crate

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.

Increase safety

Increase runtime checks before accessing data in the arsc bytes stream, e.g.

  • Verify more invariants for chunks, e.g. the Chunk::as_* methods should check ChunkHeader invariants.
  • Annotate each unsafe block with a comment as to why the block can be trusted.

Improve rustdoc

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 = [

Decode color values

All ValueType::IntColor* values are currently hard-coded to 0. Implement proper decoding.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.