Comments (6)
Is it possible for you to share the full input. Which drawable files were modified please?
from redex.
Of course , i could send the input and output through email , please check your mailbox .Thx.
I create a demo project ,and find the same issue,
the reason for content of xml file becomes "", i think it is due to r8 compiler ,when i set "shrinkResource " to "true", r8 make useless resources file's content to be "<x/">
but after redex, the reason to cause app crash ,i guess maybe is there any logic in redex to mixup xml files' content ?
it means that, after redex , the content of xml a and the content of xml b get swaped.
why i have the guess above, is that ,when i set "shrinkResources" to "false ", in output apk , "" not exists any more, but after redex , the final apk still can not run, it gets some error still in xml file , some layout xml file' content becomes the content of drawable file's content, the error info is like "can not find classs shape ".
In the demo project i sent you:
activity_main.xml content in origin apk:
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent">
<TextView android:id="@+id/tv_name" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Hello World!" app:layout_constraintBottom_toBottomOf="0" app:layout_constraintLeft_toLeftOf="0" app:layout_constraintRight_toRightOf="0" app:layout_constraintTop_toTopOf="0"/>
<TextView android:id="@+id/tv_name1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Hello World!" app:layout_constraintBottom_toBottomOf="@+id/tv_name" app:layout_constraintLeft_toLeftOf="0" app:layout_constraintRight_toRightOf="0" app:layout_constraintTop_toTopOf="0"/>
<TextView android:id="@+id/tv_name2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Hello World!" app:layout_constraintBottom_toBottomOf="@+id/tv_name1" app:layout_constraintLeft_toLeftOf="0" app:layout_constraintRight_toRightOf="0" app:layout_constraintTop_toTopOf="0"/>
<ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" app:layout_constraintStart_toStartOf="0" app:layout_constraintTop_toBottomOf="@+id/tv_name2"/>
</androidx.constraintlayout.widget.ConstraintLayout>
activity_main.xml content in apk after redex:
<?xml version="1.0" encoding="utf-8"?>
<x/>
when i run final apk ,get error:
FATAL EXCEPTION: main
Process: com.netease.cloudmusic.agptest, PID: 18388
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.netease.cloudmusic.agptest/com.netease.cloudmusic.bizlib.SecondActivity}: android.view.InflateException: Binary XML file line #1 in com.netease.cloudmusic.agptest:layout/activity_main: Binary XML file line #1 in com.netease.cloudmusic.agptest:layout/activity_main: Error inflating class x
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:4169)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4325)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:101)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2574)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:313)
at android.app.ActivityThread.main(ActivityThread.java:8757)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)
Caused by: android.view.InflateException: Binary XML file line #1 in com.netease.cloudmusic.agptest:layout/activity_main: Binary XML file line #1 in com.netease.cloudmusic.agptest:layout/activity_main: Error inflating class x
Caused by: android.view.InflateException: Binary XML file line #1 in com.netease.cloudmusic.agptest:layout/activity_main: Error inflating class x
Caused by: java.lang.ClassNotFoundException: android.view.x
from redex.
I debug the python part of redex, and find that when extract the apk , the activity_main.xml's content will become "",
the activity_main.xml's final name in apk's res folder is R5.xml.
But if i rename the origin apk to zip, and unzip the final, the activity_main.xml(R5.xml)'s content is still correct.
I use a mac to do this operation, so there should be a bug in python part when doing the extract operation.
from redex.
I debug the python part of redex, and find that when extract the apk , the activity_main.xml's content will become "",
the activity_main.xml's final name in apk's res folder is R5.xml.
It sounded like you were pretty close to locating the problem in code. If so would you mind sharing a code pointer? That should help us to carry forward on our side. Sorry for the delay.
from redex.
I debug the python part of redex, and find that when extract the apk , the activity_main.xml's content will become "",
the activity_main.xml's final name in apk's res folder is R5.xml.It sounded like you were pretty close to locating the problem in code. If so would you mind sharing a code pointer? That should help us to carry forward on our side. Sorry for the delay.
I figure out that it is because the file system i'm using on mac is case insensitive, i create a case sensitive partition , finally the xml content won't get messed up anymore.
from redex.
I'm glad that you figured it out. Closing for now.
from redex.
Related Issues (20)
- run autoreconf -ivf && ./configure && make failed HOT 3
- run autoreconf -ivf && ./configure && make failed HOT 5
- ExitCode::exception /redex/libredex/ControlFlow.h:1375 HOT 2
- run autoreconf -ivf && ./configure && make error on mac os HOT 2
- run IRTypeChecker (run_verifier) failed HOT 4
- run IRTypeChecker (run_verifier) failed #808 HOT 3
- Mac OS M1 Build failed. HOT 1
- run IRTypeChecker failed HOT 1
- run pass after apk become larger 2.7M
- Is there any advice to recover crash stack trace line number in android firebase platform after use "StripDebugInfoPass"? HOT 2
- make failed. HOT 2
- Evaluate Profile-Guided Optimization (PGO) and LLVM BOLT
- Sample Android Redex APK Crashing: android.view.InflateException: Error inflating class com.google.android.material.textfield.TextInputLayout HOT 3
- how to write a pass
- is there any plan support dex 39 HOT 1
- AAB release error: [DexMember = DexClass]: assertion `elems.size() == 1' failed HOT 1
- ZipManager did not unpack expected number of files; is this a case insensitive file system? Potentially conflicting files HOT 1
- UnicodeDecodeError: 'gbk' codec can't decode byte 0x80 in position 1374: illegal multibyte sequence HOT 1
- 037 for support_dex_version 35 HOT 1
- VirtualScope.cpp:893: void virt_scope::ClassScopes::build_interface_scopes(): assertion `!scopes.empty()' failed.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from redex.