Hi team, I’ve found the strange behavior here whic...
# chucker
e
Hi team, I’ve found the strange behavior here which seems to be unrelated 😅. I applied Chucker to my project which has the
ContextWrapper
to wrap the Resources for mostly the string. My codes on that are like:
Copy code
// BaseActivity.java
    @Override
    protected void attachBaseContext(Context newBase) {
        // ResourcesContextWrapper extends from ContextWrapper
        resourcesContextWrapper = ResourcesContextWrapper.wrap(newBase);
        super.attachBaseContext(resourcesContextWrapper);
    }
...
...
...

// In ResourcesContextWrapper.java

    private ResourcesWrapper resourcesWrapper;
    
    @Override
    public Resources getResources() {
        return resourcesWrapper == null ? super.getResources() : resourcesWrapper;
    }
By this code above, when I call:
Copy code
getContext().getResources()
it will return me
ResourcesWrapper
Without Chucker or with Chucker-No-op, the wrapper works fine. Calling
getResources()
returns me
ResourcesWrapper
which is what I need but with Chucker, it keep returning me the default system Resources instead. I’ve tried couple times and still get the same result so I just want to know if it really is unrelated 😅 or somebody has faced this before. Apart from what I mentioned above, every Chucker’s features work fine. Please suggest 🙏
r
let's create a RepRex (Reproducable Example)?
to check whether the issue due to Chucker or not
e
Looks like the issue is actually from the appCompat 😅 . My project still be using the old version 1.0.0 and chucker is using 1.2.0
😂 1
g
Here you go. You can block the transitive dependency from Chucker if you wish.