Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enhance: make mapping by params initialization optional (android deobfuscation) #823

Merged
merged 3 commits into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

**Internal**
viglia marked this conversation as resolved.
Show resolved Hide resolved

**Fixes**

**Features**

- Make mapping by params initialization optional ([#823](https://github.com/getsentry/symbolic/pull/823))

## 12.7.1

**Internal**
Expand Down
46 changes: 23 additions & 23 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions py/symbolic/proguard.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,14 @@ class ProguardMapper(RustObject):
__dealloc_func__ = lib.symbolic_proguardmapper_free

@classmethod
def open(cls, path: str) -> ProguardMapper:
def open(cls, path: str, initialize_param_mapping: bool = False) -> ProguardMapper:
"""Constructs a mapping file from a path."""
return cls._from_objptr(
rustcall(lib.symbolic_proguardmapper_open, encode_path(path))
rustcall(
lib.symbolic_proguardmapper_open,
encode_path(path),
initialize_param_mapping,
)
)

@property
Expand Down
2 changes: 1 addition & 1 deletion symbolic-cabi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ publish = false
crate-type = ["cdylib"]

[dependencies]
proguard = { version = "5.3.0", features = ["uuid"] }
proguard = { version = "5.4.0", features = ["uuid"] }
sourcemap = "7.0.0"
symbolic = { version = "12.7.1", path = "../symbolic", features = ["cfi", "debuginfo", "sourcemapcache", "symcache"] }
tempfile = "3.4.0"
3 changes: 2 additions & 1 deletion symbolic-cabi/include/symbolic.h
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,8 @@ struct SymbolicStr symbolic_normalize_debug_id(const struct SymbolicStr *debug_i
/**
* Creates a proguard mapping view from a path.
*/
struct SymbolicProguardMapper *symbolic_proguardmapper_open(const char *path);
struct SymbolicProguardMapper *symbolic_proguardmapper_open(const char *path,
bool initialize_param_mapping);

/**
* Frees a proguard mapping view.
Expand Down
9 changes: 7 additions & 2 deletions symbolic-cabi/src/proguard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,18 @@ impl ForeignObject for SymbolicProguardMapper {
ffi_fn! {
/// Creates a proguard mapping view from a path.
unsafe fn symbolic_proguardmapper_open(
path: *const c_char
path: *const c_char,
initialize_param_mapping: bool
) -> Result<*mut SymbolicProguardMapper> {
let byteview = ByteView::open(CStr::from_ptr(path).to_str()?)?;

let inner = SelfCell::new(byteview, |data| {
let mapping = ProguardMapping::new(&*data);
let mapper = ProguardMapper::new(mapping.clone());
let mapper = if !initialize_param_mapping {
ProguardMapper::new(mapping.clone())
} else {
ProguardMapper::new_with_param_mapping(mapping.clone(), initialize_param_mapping)
};
Inner { mapping, mapper }
});

Expand Down
Loading