Skip to content

baksmali analysis test fails on windows when building apktool #592

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

Closed
iBotPeaches opened this issue Mar 18, 2015 · 5 comments
Closed

baksmali analysis test fails on windows when building apktool #592

iBotPeaches opened this issue Mar 18, 2015 · 5 comments

Comments

@iBotPeaches
Copy link
Owner

Original issue 482 created by fx.schn on 2013-07-01T16:14:08.000Z:

What steps will reproduce the problem?

  1. build apktool beta 2 on windows

What is the expected output? What do you see instead?
The error output is something along the lines of:
:brut.apktool.smali:baksmali:test

org.jf.baksmali.AnalysisTest > LocalTest FAILED
junit.framework.ComparisonFailure at AnalysisTest.java:107

org.jf.baksmali.AnalysisTest > MultipleStartInstructionsTest FAILED
junit.framework.ComparisonFailure at AnalysisTest.java:107

org.jf.baksmali.AnalysisTest > ConstructorTest FAILED
junit.framework.ComparisonFailure at AnalysisTest.java:107

org.jf.baksmali.AnalysisTest > RegisterEqualityOnMergeTest FAILED
junit.framework.ComparisonFailure at AnalysisTest.java:107

org.jf.baksmali.AnalysisTest > UninitRefIdentityTest FAILED
junit.framework.ComparisonFailure at AnalysisTest.java:107

org.jf.baksmali.AnalysisTest > DuplicateTest FAILED
junit.framework.ComparisonFailure at AnalysisTest.java:107

6 tests completed, 6 failed
:brut.apktool.smali:baksmali:test FAILED

What version of the product are you using? On what operating system?
Apktool beta 2 from git branch wip-2.0_smali2_merge on Windows 7 x64.

Please provide any additional information below.
The error occurs in this line:
AnalysisTest.java:107 Assert.assertEquals(smaliContents, stringWriter.toString());

Both strings contain essentially the same data, except for the line breaks. smaliContents comes from String smaliContents = readResource(smaliPath) which is a file using unix style line breaks (\n) when pulled from git. However, the stringWriter generates Windows-Style Linebreaks (\r\n) which is why the Assertion fails.

@iBotPeaches
Copy link
Owner Author

Comment #1 originally posted by connor.tumbleson on 2013-07-01T16:31:34.000Z:

I don't think wip-2.0_smali2_merge is even build-able yet :)

Could you confirm if this issue occurs in regular smali2b5? https://code.google.com/p/smali/source/list?name=dexlib_redesign

I need to see if this is an apktool caused problem or smali, and won't be back near a Windows computer for a few days.

@iBotPeaches
Copy link
Owner Author

Comment #2 originally posted by [email protected] on 2013-09-14T21:00:42.000Z:

FYI: I've made an attempt to fix this issue, but don't have access to a windows system to test. The fix is in the dexlib_redesign branch. If someone wants to grab the source (make sure you get the dexlib_redesign branch) and try building on windows, it would be appreciated.

@iBotPeaches
Copy link
Owner Author

Comment #3 originally posted by evilfire2046 on 2013-10-31T14:47:47.000Z:

replace the 107 line with following

Assert.assertEquals(smaliContents.replace("\r", "").replace("\n", ""), stringWriter.toString().replace("\r", "").replace("\n", ""));

@iBotPeaches
Copy link
Owner Author

Comment #4 originally posted by [email protected] on 2013-11-08T19:14:39.000Z:

Hmm, I'd rather not just strip newlines entirely. For example, that would pass if the output didn't contain any newlines when it should.

@iBotPeaches
Copy link
Owner Author

Comment #5 originally posted by connor.tumbleson on 2013-12-17T21:53:18.000Z:

<empty>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant