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

Last character of tag names is being left off #6

Open
jeremyblalock opened this issue Jan 10, 2018 · 4 comments
Open

Last character of tag names is being left off #6

jeremyblalock opened this issue Jan 10, 2018 · 4 comments

Comments

@jeremyblalock
Copy link

I just downloaded / built the source code, and there seem to be some major issues.

Built on macOS High Sierra using Java JDK v8u151
Extracting Instagram (com.instagram.android)

This is the behavior I'm seeing:

  • Last letter of tag names / properties are being left off
    • Could this be an OS issue or Java versioning issue with string termination? Don't know what would have changed here though...
  • Some tags are not properly formatted, and are missing a < or a > (happens at the first <TextView />)
  • Spacing is a bit whacky, though is relatively minor as that can easily be reformatted if the syntax can be fixed

Any thoughts how to fix this? (or if there's a newer alternative, that's fine too)

Here's the full output. The results were similar for several apps / layout files:

<?xml version="1.0" encoding="utf-8"?>
<
 LinearLayou
	xmlns:androi="*http://schemas.android.com/apk/res/androi"
	androi:
               orientatio="0"
	androi:i="@7F0B00D4"
	androi:
backgroun="@7F020033"
	androi:
               paddingLef="@7F0A0022"
	androi:
               paddingRigh="@7F0A0022"
	androi:
               layout_widt="-1"
layout_heigh="@7F0A001F"
	>
	<:com.instagram.common.ui.widget.imageview.CircularImageVie
		androi:layout_gravit=""
		androi:i="@7F0B00D5"
		styl="@7F0E0029"
		>
	</:com.instagram.common.ui.widget.imageview.CircularImageVie>
	<
         LinearLayou
		androi:gravit=""
		androi:
                       orientatio="1"
		androi:
                       layout_widt="-1"
layout_heigh="-1"ndroi:
		androi:layout_marginLef="@7F0A0023"
		androi:layout_marginRigh="@7F0A0023"
		>
		TextVie
			androi:	textStyl=""
			androi:	ellipsiz="3"
			androi:i="@7F0B00D6"
			androi:
                               layout_widt="-2"
layout_heigh="-2"       androi:
			androi:
singleLin="true"
			>
		<TextVie>
		TextVie
			androi:	textColo="@7F08005A"
			androi:	ellipsiz="3"
			androi:i="@7F0B00D7"
			androi:
                               layout_widt="-2"
layout_heigh="-2"       androi:
			androi:
singleLin="true"
			>
		<TextVie>
	</
          LinearLayou>
</
  LinearLayou>
@strazzere
Copy link
Member

This is definitely odd. I've just upgraded the gradle wrapper (which really shouldn't change anything, however it was old and needed for my machine) - can you try rebuilding and running it again? I've just done a fresh build and it worked fine for me on all manifests I've tried (approximately 10).

Can you post the files you're running it again? These tags are not always needed so while this 100% could be a bug, it could be a file which simply has this as an output.

[98%]diff@bebop:[~/repo/axmlprinter/instagram-test] $ shasum instagram-29-0-0-0-18.apk 
8d08d46ef8ed620224efd30a5093771e426dc1d2  instagram-29-0-0-0-18.apk
[98%]diff@bebop:[~/repo/axmlprinter/instagram-test] $ java -jar ../build/libs/axmlprinter-0.1.7.jar contents/AndroidManifest.xml 
<?xml version="1.0" encoding="utf-8"?>
<manifest
	xmlns:amazon="http://schemas.amazon.com/apk/res/android"
	xmlns:android="http://schemas.android.com/apk/res/android"
	manifest:versionCode="87084037"
	manifest:versionName="29.0.0.0.18"
	manifest:installLocation="0"
	package="com.instagram.android"
	>
	<uses-sdk
		manifest:minSdkVersion="16"
		manifest:targetSdkVersion="23"
		>
	</uses-sdk>
	<uses-permission
		manifest:name="android.permission.INTERNET"
		>
	</uses-permission>
	<uses-permission
		manifest:name="android.permission.ACCESS_NETWORK_STATE"
		>
	</uses-permission>
	<uses-permission
		manifest:name="android.permission.WAKE_LOCK"
		>
	</uses-permission>
	<uses-permission
		manifest:name="android.permission.GET_ACCOUNTS"
		>
	</uses-permission>
	<uses-permission
		manifest:name="android.permission.USE_CREDENTIALS"
		>
	</uses-permission>

@strazzere strazzere self-assigned this Jan 10, 2018
@jeremyblalock
Copy link
Author

jeremyblalock commented Jan 10, 2018

@strazzere The AndroidManifest.xml seems to work fine for me as well. However the layout files are where the problem is occurring. An example of a file with an error is res/layout/zoom_media.xml (uploaded below).

zoom_media.xml.zip

@jeremyblalock
Copy link
Author

Also tried with Kik (kik.android.apk) with similar results.

@strazzere
Copy link
Member

Ah yes, to parse these there will likely need to be more work done. Currently the AXMLprinter only targets the AndroidManifest. The other ASRC (?) compiled resources are of a very similar format, though I haven't actually needed to parse them myself so I didn't fully implement it in this project.

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

No branches or pull requests

2 participants