SecureBrain / ruby_apk

analyzing android apk library for ruby
MIT License
83 stars 52 forks source link

crash occurs with some AndroidManifest.xml #3

Closed masatanish closed 11 years ago

masatanish commented 11 years ago

condition: AndrdoiManifest.xml has a text element in element like below.

<manifest xmlns:android='http://schemas.android.com/apk/res/android' android:versionCode='101' android:versionName='1.0.1-malware2' package='example.app.sample'>
    <uses-sdk android:minSdkVersion='10'/>
    <uses-permission android:name='android.permission.INTERNET'/>
    <uses-permission android:name='android.permission.WRITE_EXTERNAL_STORAGE'/>
    <application android:label='@0x7f040001' android:icon='@0x7f020000' android:debuggable='true'>
        <activity android:label='@0x7f040001' android:name='example.app.sample.SampleActivity'>
            <intent-filter>
                <action android:name='android.intent.action.MAIN'/>
                 Sample Text Element 
                <category android:name='android.intent.category.LAUNCHER'/>
            </intent-filter>
        </activity>
    </application>
</manifest>

You access Manifest::Component object with above xml, then crash occurs.

apk = Android::Apk.new('sample.apk')
apk.manifest.components.map {|c| c.name } # =>  crash!!