github.com/F4RD1N/gomobile@v1.0.1/cmd/gomobile/binary_xml_test.go (about)

     1  // Copyright 2015 The Go Authors.  All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package main
     6  
     7  import (
     8  	"archive/zip"
     9  	"bytes"
    10  	"flag"
    11  	"fmt"
    12  	"io/ioutil"
    13  	"log"
    14  	"os"
    15  	"os/exec"
    16  	"path/filepath"
    17  	"testing"
    18  )
    19  
    20  var dump = flag.Bool("dump", false, "dump junk.bin binary output")
    21  
    22  var (
    23  	origSortPool = sortPool
    24  	origSortAttr = sortAttr
    25  )
    26  
    27  func TestBinaryXML(t *testing.T) {
    28  	sortPool, sortAttr = sortToMatchTest, sortAttrToMatchTest
    29  	defer func() { sortPool, sortAttr = origSortPool, origSortAttr }()
    30  
    31  	bin, err := binaryXML(bytes.NewBufferString(fmt.Sprintf(input, "")))
    32  	if err != nil {
    33  		t.Fatal(err)
    34  	}
    35  	if *dump {
    36  		if err := ioutil.WriteFile("junk.bin", bin, 0660); err != nil {
    37  			t.Fatal(err)
    38  		}
    39  	}
    40  
    41  	if exec.Command("which", "aapt").Run() != nil {
    42  		t.Skip("command aapt not found, skipping")
    43  	}
    44  
    45  	apiPath, err := androidAPIPath()
    46  	if err != nil {
    47  		t.Fatal(err)
    48  	}
    49  	androidJar := filepath.Join(apiPath, "android.jar")
    50  
    51  	tmpdir, err := ioutil.TempDir("", "gomobile-test-")
    52  	if err != nil {
    53  		t.Fatal(err)
    54  	}
    55  	defer os.RemoveAll(tmpdir)
    56  
    57  	buf := new(bytes.Buffer)
    58  	zw := zip.NewWriter(buf)
    59  	zf, err := zw.Create("AndroidManifest.xml")
    60  	if err != nil {
    61  		t.Fatal(err)
    62  	}
    63  	if _, err := zf.Write(bin); err != nil {
    64  		t.Fatal(err)
    65  	}
    66  	if err := zw.Close(); err != nil {
    67  		t.Fatal(err)
    68  	}
    69  
    70  	mblapk := filepath.Join(tmpdir, "mbl.apk")
    71  	if err := ioutil.WriteFile(mblapk, buf.Bytes(), 0755); err != nil {
    72  		t.Fatal(err)
    73  	}
    74  
    75  	got, err := exec.Command("aapt", "d", "xmltree", mblapk, "AndroidManifest.xml").Output()
    76  	if err != nil {
    77  		t.Fatal(err)
    78  	}
    79  
    80  	manifest := filepath.Join(tmpdir, "AndroidManifest.xml")
    81  	inp := fmt.Sprintf(input, "<uses-sdk android:minSdkVersion=\"15\" />")
    82  	if err := ioutil.WriteFile(manifest, []byte(inp), 0755); err != nil {
    83  		t.Fatal(err)
    84  	}
    85  
    86  	sdkapk := filepath.Join(tmpdir, "sdk.apk")
    87  	if _, err := exec.Command("aapt", "p", "-M", manifest, "-I", androidJar, "-F", sdkapk).Output(); err != nil {
    88  		t.Fatal(err)
    89  	}
    90  
    91  	sdkout, err := exec.Command("aapt", "d", "xmltree", sdkapk, "AndroidManifest.xml").Output()
    92  	if err != nil {
    93  		t.Fatal(err)
    94  	}
    95  	if *dump {
    96  		b, err := ioutil.ReadFile(sdkapk)
    97  		if err != nil {
    98  			t.Fatal(err)
    99  		}
   100  		if err := ioutil.WriteFile("junk.sdk.apk", b, 0755); err != nil {
   101  			t.Fatal(err)
   102  		}
   103  	}
   104  
   105  	// manifests contain platformBuildVersionCode and platformBuildVersionName
   106  	// which are not present in gomobile output.
   107  	var fo [][]byte
   108  	for _, line := range bytes.Split(sdkout, []byte{'\n'}) {
   109  		if bytes.Contains(line, []byte("platformBuildVersionCode")) || bytes.Contains(line, []byte("platformBuildVersionName")) {
   110  			continue
   111  		}
   112  		fo = append(fo, line)
   113  	}
   114  	want := bytes.Join(fo, []byte{'\n'})
   115  
   116  	if !bytes.Equal(want, got) {
   117  		t.Fatalf("output does not match\nWANT\n%s\nGOT\n%s\n", want, got)
   118  	}
   119  }
   120  
   121  // The output of the Android encoder seems to be arbitrary. So for testing,
   122  // we sort the string pool order to match the output we have seen.
   123  func sortToMatchTest(p *binStringPool) {
   124  	var names = []string{
   125  		"versionCode",
   126  		"versionName",
   127  		"minSdkVersion",
   128  		"theme",
   129  		"label",
   130  		"hasCode",
   131  		"debuggable",
   132  		"name",
   133  		"screenOrientation",
   134  		"configChanges",
   135  		"value",
   136  		"android",
   137  		"http://schemas.android.com/apk/res/android",
   138  		"",
   139  		"package",
   140  		"manifest",
   141  		"com.zentus.balloon",
   142  		"1.0",
   143  		"uses-sdk",
   144  		"application",
   145  		"Balloon世界",
   146  		"activity",
   147  		"android.app.NativeActivity",
   148  		"Balloon",
   149  		"meta-data",
   150  		"android.app.lib_name",
   151  		"balloon",
   152  		"intent-filter",
   153  		"\there is some text\n",
   154  		"action",
   155  		"android.intent.action.MAIN",
   156  		"category",
   157  		"android.intent.category.LAUNCHER",
   158  	}
   159  
   160  	s := make([]*bstring, 0)
   161  	m := make(map[string]*bstring)
   162  
   163  	for _, str := range names {
   164  		bstr := p.m[str]
   165  		if bstr == nil {
   166  			log.Printf("missing %q", str)
   167  			continue
   168  		}
   169  		bstr.ind = uint32(len(s))
   170  		s = append(s, bstr)
   171  		m[str] = bstr
   172  		delete(p.m, str)
   173  	}
   174  	// add unexpected strings
   175  	for str, bstr := range p.m {
   176  		log.Printf("unexpected %q", str)
   177  		bstr.ind = uint32(len(s))
   178  		s = append(s, bstr)
   179  	}
   180  	p.s = s
   181  	p.m = m
   182  }
   183  
   184  func sortAttrToMatchTest(e *binStartElement, p *binStringPool) {
   185  	order := []string{
   186  		"versionCode",
   187  		"versionName",
   188  		"versionPackage",
   189  
   190  		"theme",
   191  		"label",
   192  		"name",
   193  		"screenOrientation",
   194  		"configChanges",
   195  	}
   196  	ordered := make([]*binAttr, len(order))
   197  
   198  outer:
   199  	for i, n := range order {
   200  		for j, a := range e.attr {
   201  			if a != nil && a.name.str == n {
   202  				ordered[i] = a
   203  				e.attr[j] = nil
   204  				continue outer
   205  			}
   206  		}
   207  	}
   208  	var attr []*binAttr
   209  	for _, a := range ordered {
   210  		if a != nil {
   211  			attr = append(attr, a)
   212  		}
   213  	}
   214  	for _, a := range e.attr {
   215  		if a != nil {
   216  			attr = append(attr, a)
   217  		}
   218  	}
   219  	e.attr = attr
   220  }
   221  
   222  // Hexdump of output generated by the Android SDK's ant build system.
   223  // Annotated after studying Android source code.
   224  var output = []byte{
   225  	/* 0000 */ 0x03, 0x00, 0x08, 0x00, //  chunk header XML
   226  	/* 0004 */ 0x78, 0x07, 0x00, 0x00, //  chunk size 1912
   227  
   228  	/* 0008 */ 0x01, 0x00, 0x1c, 0x00, //  chunk header STRING_POOL
   229  	/* 000c */ 0x00, 0x04, 0x00, 0x00, //  chunk size 1024
   230  	/* 0010 */ 0x1f, 0x00, 0x00, 0x00, //  string count 31
   231  	/* 0014 */ 0x00, 0x00, 0x00, 0x00, //  style count 0
   232  	/* 0018 */ 0x00, 0x00, 0x00, 0x00, //  flags (none set means UTF-16)
   233  	/* 001c */ 0x98, 0x00, 0x00, 0x00, //  strings_start 0x98+0x08 = 0xa0
   234  	/* 0020 */ 0x00, 0x00, 0x00, 0x00, //  styles_start (none)
   235  	/* 0024 */ 0x00, 0x00, 0x00, 0x00, //  string offset [0x00] (from strings_start)
   236  	/* 0028 */ 0x1a, 0x00, 0x00, 0x00, //  string offset [0x01]
   237  	/* 002c */ 0x34, 0x00, 0x00, 0x00, //  string offset [0x02]
   238  	/* 0030 */ 0x52, 0x00, 0x00, 0x00, //  string offset [0x03]
   239  	/* 0034 */ 0x60, 0x00, 0x00, 0x00, //  string offset [0x04]
   240  	/* 0038 */ 0x72, 0x00, 0x00, 0x00, //  string offset [0x05]
   241  	/* 003c */ 0x8a, 0x00, 0x00, 0x00, //  string offset [0x06]
   242  	/* 0040 */ 0x96, 0x00, 0x00, 0x00, //  string offset [0x07]
   243  	/* 0044 */ 0xb4, 0x00, 0x00, 0x00, //  string offset [0x08]
   244  	/* 0048 */ 0xc2, 0x00, 0x00, 0x00, //  string offset [0x09]
   245  	/* 004c */ 0xd4, 0x00, 0x00, 0x00, //  string offset [0x0a]
   246  	/* 0050 */ 0x2c, 0x01, 0x00, 0x00, //  string offset [0x0b]
   247  	/* 0054 */ 0x30, 0x01, 0x00, 0x00, //  string offset [0x0c]
   248  	/* 0058 */ 0x42, 0x01, 0x00, 0x00, //  string offset [0x0d]
   249  	/* 005c */ 0x56, 0x01, 0x00, 0x00, //  string offset [0x0e]
   250  	/* 0060 */ 0x7e, 0x01, 0x00, 0x00, //  string offset [0x0f]
   251  	/* 0064 */ 0x88, 0x01, 0x00, 0x00, //  string offset [0x10]
   252  	/* 0068 */ 0x9c, 0x01, 0x00, 0x00, //  string offset [0x11]
   253  	/* 006c */ 0xb6, 0x01, 0x00, 0x00, //  string offset [0x12]
   254  	/* 0070 */ 0xcc, 0x01, 0x00, 0x00, //  string offset [0x13]
   255  	/* 0074 */ 0xe0, 0x01, 0x00, 0x00, //  string offset [0x14]
   256  	/* 0078 */ 0x18, 0x02, 0x00, 0x00, //  string offset [0x15]
   257  	/* 007c */ 0x2a, 0x02, 0x00, 0x00, //  string offset [0x16]
   258  	/* 0080 */ 0x40, 0x02, 0x00, 0x00, //  string offset [0x17]
   259  	/* 0084 */ 0x6c, 0x02, 0x00, 0x00, //  string offset [0x18]
   260  	/* 0088 */ 0x7e, 0x02, 0x00, 0x00, //  string offset [0x19]
   261  	/* 008c */ 0x9c, 0x02, 0x00, 0x00, //  string offset [0x1a]
   262  	/* 0090 */ 0xc6, 0x02, 0x00, 0x00, //  string offset [0x1b]
   263  	/* 0094 */ 0xd6, 0x02, 0x00, 0x00, //  string offset [0x1c]
   264  	/* 0098 */ 0x0e, 0x03, 0x00, 0x00, //  string offset [0x1d]
   265  	/* 009c */ 0x22, 0x03, 0x00, 0x00, //  string offset [0x1e]
   266  	/* 00a0 */ 0x0b, 0x00, 0x76, 0x00, //  [0x00] len=11 value="versionCode"
   267  	/* 00a4 */ 0x65, 0x00, 0x72, 0x00,
   268  	/* 00a8 */ 0x73, 0x00, 0x69, 0x00,
   269  	/* 00ac */ 0x6f, 0x00, 0x6e, 0x00,
   270  	/* 00b0 */ 0x43, 0x00, 0x6f, 0x00,
   271  	/* 00b4 */ 0x64, 0x00, 0x65, 0x00,
   272  	/* 00b8 */ 0x00, 0x00,
   273  	/* 00ba */ 0x0b, 0x00, //  [0x01] len=11 value="versionName"
   274  	/* 00bc */ 0x76, 0x00, 0x65, 0x00,
   275  	/* 00c0 */ 0x72, 0x00, 0x73, 0x00,
   276  	/* 00c4 */ 0x69, 0x00, 0x6f, 0x00,
   277  	/* 00c8 */ 0x6e, 0x00, 0x4e, 0x00,
   278  	/* 00cc */ 0x61, 0x00, 0x6d, 0x00,
   279  	/* 00d0 */ 0x65, 0x00, 0x00, 0x00,
   280  	/* 00d4 */ 0x0d, 0x00, 0x6d, 0x00, //  [0x02] len=13 value="minSdkVersion"
   281  	/* 00d8 */ 0x69, 0x00, 0x6e, 0x00,
   282  	/* 00dc */ 0x53, 0x00, 0x64, 0x00,
   283  	/* 00e0 */ 0x6b, 0x00, 0x56, 0x00,
   284  	/* 00e4 */ 0x65, 0x00, 0x72, 0x00,
   285  	/* 00e8 */ 0x73, 0x00, 0x69, 0x00,
   286  	/* 00ec */ 0x6f, 0x00, 0x6e, 0x00,
   287  	/* 00f0 */ 0x00, 0x00,
   288  	/* 00f2 */ 0x05, 0x00, //  [0x03] len=5 value="label"
   289  	/* 00f4 */ 0x6c, 0x00, 0x61, 0x00,
   290  	/* 00f8 */ 0x62, 0x00, 0x65, 0x00,
   291  	/* 00fc */ 0x6c, 0x00, 0x00, 0x00,
   292  	/* 0100 */ 0x07, 0x00, 0x68, 0x00, //  [0x04] len=7 value="hasCode"
   293  	/* 0104 */ 0x61, 0x00, 0x73, 0x00,
   294  	/* 0108 */ 0x43, 0x00, 0x6f, 0x00,
   295  	/* 010c */ 0x64, 0x00, 0x65, 0x00,
   296  	/* 0110 */ 0x00, 0x00,
   297  	/* 0112 */ 0x0a, 0x00, //  [0x05] len=10 value="debuggable"
   298  	/* 0114 */ 0x64, 0x00, 0x65, 0x00,
   299  	/* 0118 */ 0x62, 0x00, 0x75, 0x00,
   300  	/* 011c */ 0x67, 0x00, 0x67, 0x00,
   301  	/* 0120 */ 0x61, 0x00, 0x62, 0x00,
   302  	/* 0124 */ 0x6c, 0x00, 0x65, 0x00,
   303  	/* 0128 */ 0x00, 0x00,
   304  	/* 012a */ 0x04, 0x00, //  [0x06] len=4 value="name"
   305  	/* 012c */ 0x6e, 0x00, 0x61, 0x00,
   306  	/* 0130 */ 0x6d, 0x00, 0x65, 0x00,
   307  	/* 0134 */ 0x00, 0x00,
   308  	/* 0136 */ 0x0d, 0x00, //  [0x07] len=13 value="configChanges"
   309  	/* 0138 */ 0x63, 0x00, 0x6f, 0x00,
   310  	/* 013c */ 0x6e, 0x00, 0x66, 0x00,
   311  	/* 0140 */ 0x69, 0x00, 0x67, 0x00,
   312  	/* 0144 */ 0x43, 0x00, 0x68, 0x00,
   313  	/* 0148 */ 0x61, 0x00, 0x6e, 0x00,
   314  	/* 014c */ 0x67, 0x00, 0x65, 0x00,
   315  	/* 0150 */ 0x73, 0x00, 0x00, 0x00,
   316  	/* 0154 */ 0x05, 0x00, 0x76, 0x00, //  [0x08] len=5 value="value"
   317  	/* 0158 */ 0x61, 0x00, 0x6c, 0x00,
   318  	/* 015c */ 0x75, 0x00, 0x65, 0x00,
   319  	/* 0160 */ 0x00, 0x00,
   320  	/* 0162 */ 0x07, 0x00, //  [0x09] len=7 value="android"
   321  	/* 0164 */ 0x61, 0x00, 0x6e, 0x00,
   322  	/* 0168 */ 0x64, 0x00, 0x72, 0x00,
   323  	/* 016c */ 0x6f, 0x00, 0x69, 0x00,
   324  	/* 0170 */ 0x64, 0x00, 0x00, 0x00,
   325  	/* 0174 */ 0x2a, 0x00, 0x68, 0x00, //  [0x0a] len=42 value="http://schemas.android.com/apk/res/android"
   326  	/* 0178 */ 0x74, 0x00, 0x74, 0x00,
   327  	/* 017c */ 0x70, 0x00, 0x3a, 0x00,
   328  	/* 0180 */ 0x2f, 0x00, 0x2f, 0x00,
   329  	/* 0184 */ 0x73, 0x00, 0x63, 0x00,
   330  	/* 0188 */ 0x68, 0x00, 0x65, 0x00,
   331  	/* 018c */ 0x6d, 0x00, 0x61, 0x00,
   332  	/* 0190 */ 0x73, 0x00, 0x2e, 0x00,
   333  	/* 0194 */ 0x61, 0x00, 0x6e, 0x00,
   334  	/* 0198 */ 0x64, 0x00, 0x72, 0x00,
   335  	/* 019c */ 0x6f, 0x00, 0x69, 0x00,
   336  	/* 01a0 */ 0x64, 0x00, 0x2e, 0x00,
   337  	/* 01a4 */ 0x63, 0x00, 0x6f, 0x00,
   338  	/* 01a8 */ 0x6d, 0x00, 0x2f, 0x00,
   339  	/* 01ac */ 0x61, 0x00, 0x70, 0x00,
   340  	/* 01b0 */ 0x6b, 0x00, 0x2f, 0x00,
   341  	/* 01b4 */ 0x72, 0x00, 0x65, 0x00,
   342  	/* 01b8 */ 0x73, 0x00, 0x2f, 0x00,
   343  	/* 01bc */ 0x61, 0x00, 0x6e, 0x00,
   344  	/* 01c0 */ 0x64, 0x00, 0x72, 0x00,
   345  	/* 01c4 */ 0x6f, 0x00, 0x69, 0x00,
   346  	/* 01c8 */ 0x64, 0x00, 0x00, 0x00,
   347  	/* 01cc */ 0x00, 0x00, 0x00, 0x00, //  [0x0b] len=0 (sigh)
   348  	/* 01d0 */ 0x07, 0x00, 0x70, 0x00, //  [0x0c] len=7 value="package"
   349  	/* 01d4 */ 0x61, 0x00, 0x63, 0x00,
   350  	/* 01d8 */ 0x6b, 0x00, 0x61, 0x00,
   351  	/* 01dc */ 0x67, 0x00, 0x65, 0x00,
   352  	/* 01e0 */ 0x00, 0x00,
   353  	/* 01e2 */ 0x08, 0x00, //  [0x0d] len=8 value="manifest"
   354  	/* 01e4 */ 0x6d, 0x00, 0x61, 0x00,
   355  	/* 01e8 */ 0x6e, 0x00, 0x69, 0x00,
   356  	/* 01ec */ 0x66, 0x00, 0x65, 0x00,
   357  	/* 01f0 */ 0x73, 0x00, 0x74, 0x00,
   358  	/* 01f4 */ 0x00, 0x00,
   359  	/* 01f6 */ 0x12, 0x00, //  [0x0e] len=12 value="com.zentus.balloon"
   360  	/* 01f8 */ 0x63, 0x00, 0x6f, 0x00,
   361  	/* 01fc */ 0x6d, 0x00, 0x2e, 0x00,
   362  	/* 0200 */ 0x7a, 0x00, 0x65, 0x00,
   363  	/* 0204 */ 0x6e, 0x00, 0x74, 0x00,
   364  	/* 0208 */ 0x75, 0x00, 0x73, 0x00,
   365  	/* 020c */ 0x2e, 0x00, 0x62, 0x00,
   366  	/* 0210 */ 0x61, 0x00, 0x6c, 0x00,
   367  	/* 0214 */ 0x6c, 0x00, 0x6f, 0x00,
   368  	/* 0218 */ 0x6f, 0x00, 0x6e, 0x00,
   369  	/* 021c */ 0x00, 0x00,
   370  	/* 021e */ 0x03, 0x00, //  [0x0f] len=3 value="1.0"
   371  	/* 0220 */ 0x31, 0x00, 0x2e, 0x00,
   372  	/* 0224 */ 0x30, 0x00, 0x00, 0x00,
   373  	/* 0228 */ 0x08, 0x00, 0x75, 0x00, //  [0x10] len=8 value="uses-sdk"
   374  	/* 022c */ 0x73, 0x00, 0x65, 0x00,
   375  	/* 0230 */ 0x73, 0x00, 0x2d, 0x00,
   376  	/* 0234 */ 0x73, 0x00, 0x64, 0x00,
   377  	/* 0238 */ 0x6b, 0x00, 0x00, 0x00,
   378  	/* 023c */ 0x0b, 0x00, 0x61, 0x00, //  [0x11] len=11 value="application"
   379  	/* 0240 */ 0x70, 0x00, 0x70, 0x00,
   380  	/* 0244 */ 0x6c, 0x00, 0x69, 0x00,
   381  	/* 0248 */ 0x63, 0x00, 0x61, 0x00,
   382  	/* 024c */ 0x74, 0x00, 0x69, 0x00,
   383  	/* 0250 */ 0x6f, 0x00, 0x6e, 0x00,
   384  	/* 0254 */ 0x00, 0x00,
   385  	/* 0256 */ 0x09, 0x00, //  [0x12] len=9 value="Balloon世界" (UTF16-LE, 0x4e16 is "16 4e", etc)
   386  	/* 0258 */ 0x42, 0x00, 0x61, 0x00,
   387  	/* 025c */ 0x6c, 0x00, 0x6c, 0x00,
   388  	/* 0260 */ 0x6f, 0x00, 0x6f, 0x00,
   389  	/* 0264 */ 0x6e, 0x00, 0x16, 0x4e,
   390  	/* 0268 */ 0x4c, 0x75, 0x00, 0x00,
   391  	/* 026c */ 0x08, 0x00, 0x61, 0x00, //  [0x13] len=8 value="activity"
   392  	/* 0270 */ 0x63, 0x00, 0x74, 0x00,
   393  	/* 0274 */ 0x69, 0x00, 0x76, 0x00,
   394  	/* 0278 */ 0x69, 0x00, 0x74, 0x00,
   395  	/* 027c */ 0x79, 0x00, 0x00, 0x00,
   396  	/* 0280 */ 0x1a, 0x00, 0x61, 0x00, //  [0x14] len=26 value="android.app.NativeActivity"
   397  	/* 0284 */ 0x6e, 0x00, 0x64, 0x00,
   398  	/* 0288 */ 0x72, 0x00, 0x6f, 0x00,
   399  	/* 028c */ 0x69, 0x00, 0x64, 0x00,
   400  	/* 0290 */ 0x2e, 0x00, 0x61, 0x00,
   401  	/* 0294 */ 0x70, 0x00, 0x70, 0x00,
   402  	/* 0298 */ 0x2e, 0x00, 0x4e, 0x00,
   403  	/* 029c */ 0x61, 0x00, 0x74, 0x00,
   404  	/* 02a0 */ 0x69, 0x00, 0x76, 0x00,
   405  	/* 02a4 */ 0x65, 0x00, 0x41, 0x00,
   406  	/* 02a8 */ 0x63, 0x00, 0x74, 0x00,
   407  	/* 02ac */ 0x69, 0x00, 0x76, 0x00,
   408  	/* 02b0 */ 0x69, 0x00, 0x74, 0x00,
   409  	/* 02b4 */ 0x79, 0x00, 0x00, 0x00,
   410  	/* 02b8 */ 0x07, 0x00, 0x42, 0x00, //  [0x15] len=7 value="Balloon"
   411  	/* 02bc */ 0x61, 0x00, 0x6c, 0x00,
   412  	/* 02c0 */ 0x6c, 0x00, 0x6f, 0x00,
   413  	/* 02c4 */ 0x6f, 0x00, 0x6e, 0x00,
   414  	/* 02c8 */ 0x00, 0x00,
   415  	/* 02ca */ 0x09, 0x00, //  [0x16] len=9 value="meta-data"
   416  	/* 02cc */ 0x6d, 0x00, 0x65, 0x00,
   417  	/* 02d0 */ 0x74, 0x00, 0x61, 0x00,
   418  	/* 02d4 */ 0x2d, 0x00, 0x64, 0x00,
   419  	/* 02d8 */ 0x61, 0x00, 0x74, 0x00,
   420  	/* 02dc */ 0x61, 0x00, 0x00, 0x00,
   421  	/* 02e0 */ 0x14, 0x00, 0x61, 0x00, //  [0x17] len=20 value="android.app.lib_name"
   422  	/* 02e4 */ 0x6e, 0x00, 0x64, 0x00,
   423  	/* 02e8 */ 0x72, 0x00, 0x6f, 0x00,
   424  	/* 02ec */ 0x69, 0x00, 0x64, 0x00,
   425  	/* 02f0 */ 0x2e, 0x00, 0x61, 0x00,
   426  	/* 02f4 */ 0x70, 0x00, 0x70, 0x00,
   427  	/* 02f8 */ 0x2e, 0x00, 0x6c, 0x00,
   428  	/* 02fc */ 0x69, 0x00, 0x62, 0x00,
   429  	/* 0300 */ 0x5f, 0x00, 0x6e, 0x00,
   430  	/* 0304 */ 0x61, 0x00, 0x6d, 0x00,
   431  	/* 0308 */ 0x65, 0x00, 0x00, 0x00,
   432  	/* 030c */ 0x07, 0x00, 0x62, 0x00, //  [0x18] len=7 value="balloon"
   433  	/* 0310 */ 0x61, 0x00, 0x6c, 0x00,
   434  	/* 0314 */ 0x6c, 0x00, 0x6f, 0x00,
   435  	/* 0318 */ 0x6f, 0x00, 0x6e, 0x00,
   436  	/* 031c */ 0x00, 0x00,
   437  	/* 031e */ 0x0d, 0x00, //  [0x19] len=13 value="intent-filter"
   438  	/* 0320 */ 0x69, 0x00, 0x6e, 0x00,
   439  	/* 0324 */ 0x74, 0x00, 0x65, 0x00,
   440  	/* 0328 */ 0x6e, 0x00, 0x74, 0x00,
   441  	/* 032c */ 0x2d, 0x00, 0x66, 0x00,
   442  	/* 0330 */ 0x69, 0x00, 0x6c, 0x00,
   443  	/* 0334 */ 0x74, 0x00, 0x65, 0x00,
   444  	/* 0338 */ 0x72, 0x00, 0x00, 0x00,
   445  	/* 033c */ 0x13, 0x00, 0x09, 0x00, //  [0x1a] len=19 value="\there is some text\n"
   446  	/* 0340 */ 0x68, 0x00, 0x65, 0x00,
   447  	/* 0344 */ 0x72, 0x00, 0x65, 0x00,
   448  	/* 0348 */ 0x20, 0x00, 0x69, 0x00,
   449  	/* 034c */ 0x73, 0x00, 0x20, 0x00,
   450  	/* 0350 */ 0x73, 0x00, 0x6f, 0x00,
   451  	/* 0354 */ 0x6d, 0x00, 0x65, 0x00,
   452  	/* 0358 */ 0x20, 0x00, 0x74, 0x00,
   453  	/* 035c */ 0x65, 0x00, 0x78, 0x00,
   454  	/* 0360 */ 0x74, 0x00, 0x0a, 0x00,
   455  	/* 0364 */ 0x00, 0x00,
   456  	/* 0366 */ 0x06, 0x00, //  [0x1b] len=6 value="action"
   457  	/* 0368 */ 0x61, 0x00, 0x63, 0x00,
   458  	/* 036c */ 0x74, 0x00, 0x69, 0x00,
   459  	/* 0370 */ 0x6f, 0x00, 0x6e, 0x00,
   460  	/* 0374 */ 0x00, 0x00,
   461  	/* 0376 */ 0x1a, 0x00, //  [0x1c] len=26 value="android.intent.action.MAIN"
   462  	/* 0378 */ 0x61, 0x00, 0x6e, 0x00,
   463  	/* 037c */ 0x64, 0x00, 0x72, 0x00,
   464  	/* 0380 */ 0x6f, 0x00, 0x69, 0x00,
   465  	/* 0384 */ 0x64, 0x00, 0x2e, 0x00,
   466  	/* 0388 */ 0x69, 0x00, 0x6e, 0x00,
   467  	/* 038c */ 0x74, 0x00, 0x65, 0x00,
   468  	/* 0390 */ 0x6e, 0x00, 0x74, 0x00,
   469  	/* 0394 */ 0x2e, 0x00, 0x61, 0x00,
   470  	/* 0398 */ 0x63, 0x00, 0x74, 0x00,
   471  	/* 039c */ 0x69, 0x00, 0x6f, 0x00,
   472  	/* 03a0 */ 0x6e, 0x00, 0x2e, 0x00,
   473  	/* 03a4 */ 0x4d, 0x00, 0x41, 0x00,
   474  	/* 03a8 */ 0x49, 0x00, 0x4e, 0x00,
   475  	/* 03ac */ 0x00, 0x00,
   476  	/* 03ae */ 0x08, 0x00, //  [0x1d] len=8 value="category"
   477  	/* 03b0 */ 0x63, 0x00, 0x61, 0x00,
   478  	/* 03b4 */ 0x74, 0x00, 0x65, 0x00,
   479  	/* 03b8 */ 0x67, 0x00, 0x6f, 0x00,
   480  	/* 03bc */ 0x72, 0x00, 0x79, 0x00,
   481  	/* 03c0 */ 0x00, 0x00,
   482  	/* 03c2 */ 0x20, 0x00, //  [0x1e] len=32 value="android.intent.category.LAUNCHER"
   483  	/* 03c4 */ 0x61, 0x00, 0x6e, 0x00,
   484  	/* 03c8 */ 0x64, 0x00, 0x72, 0x00,
   485  	/* 03cc */ 0x6f, 0x00, 0x69, 0x00,
   486  	/* 03d0 */ 0x64, 0x00, 0x2e, 0x00,
   487  	/* 03d4 */ 0x69, 0x00, 0x6e, 0x00,
   488  	/* 03d8 */ 0x74, 0x00, 0x65, 0x00,
   489  	/* 03dc */ 0x6e, 0x00, 0x74, 0x00,
   490  	/* 03e0 */ 0x2e, 0x00, 0x63, 0x00,
   491  	/* 03e4 */ 0x61, 0x00, 0x74, 0x00,
   492  	/* 03e8 */ 0x65, 0x00, 0x67, 0x00,
   493  	/* 03ec */ 0x6f, 0x00, 0x72, 0x00,
   494  	/* 03f0 */ 0x79, 0x00, 0x2e, 0x00,
   495  	/* 03f4 */ 0x4c, 0x00, 0x41, 0x00,
   496  	/* 03f8 */ 0x55, 0x00, 0x4e, 0x00,
   497  	/* 03fc */ 0x43, 0x00, 0x48, 0x00,
   498  	/* 0400 */ 0x45, 0x00, 0x52, 0x00,
   499  	/* 0404 */ 0x00, 0x00,
   500  	/* 0406 */ 0x00, 0x00,
   501  	// End of STRING_POOL.
   502  
   503  	/* 0408 */ 0x80, 0x01, 0x08, 0x00, // chunk header XML_RESOURCE_MAP
   504  	/* 040c */ 0x2c, 0x00, 0x00, 0x00, // chunk size 44
   505  	/* 0410 */ 0x1b, 0x02, 0x01, 0x01, // 0x0101021b = versionCode
   506  	/* 0414 */ 0x1c, 0x02, 0x01, 0x01, // 0x0101021c = versionName
   507  	/* 0418 */ 0x0c, 0x02, 0x01, 0x01, // 0x0101020c = minSdkVersion
   508  	/* 041c */ 0x01, 0x00, 0x01, 0x01, // 0x01010001 = label
   509  	/* 0420 */ 0x0c, 0x00, 0x01, 0x01, // 0x0101000c = hasCode
   510  	/* 0424 */ 0x0f, 0x00, 0x01, 0x01, // 0x0101000f = debuggable
   511  	/* 0428 */ 0x03, 0x00, 0x01, 0x01, // 0x01010003 = name
   512  	/* 042c */ 0x1f, 0x00, 0x01, 0x01, // 0x0101001f = configChanges
   513  	/* 0430 */ 0x24, 0x00, 0x01, 0x01, // 0x01010024 = value
   514  
   515  	/* 0434 */ 0x00, 0x01, 0x10, 0x00, // chunk header XML_START_NAMESPACE
   516  	/* 0438 */ 0x18, 0x00, 0x00, 0x00, // chunk size 24
   517  	/* 043c */ 0x07, 0x00, 0x00, 0x00, // line number
   518  	/* 0440 */ 0xff, 0xff, 0xff, 0xff, // comment string reference
   519  	/* 0444 */ 0x09, 0x00, 0x00, 0x00, // prefix [0x09]="android"
   520  	/* 0448 */ 0x0a, 0x00, 0x00, 0x00, // url [0x0a]="http://schemas..."
   521  
   522  	// Start XML_START_ELEMENT
   523  	/* 044c */ 0x02, 0x01, 0x10, 0x00, // chunk header XML_START_ELEMENT
   524  	/* 0450 */ 0x60, 0x00, 0x00, 0x00, // chunk size 96
   525  	/* 0454 */ 0x07, 0x00, 0x00, 0x00, // line number
   526  	/* 0458 */ 0xff, 0xff, 0xff, 0xff, // comment ref
   527  	/* 045c */ 0xff, 0xff, 0xff, 0xff, // ns (start ResXMLTree_attrExt)
   528  	/* 0460 */ 0x0d, 0x00, 0x00, 0x00, // name [0x0d]="manifest"
   529  	/* 0464 */ 0x14, 0x00, // attribute start
   530  	/* 0466 */ 0x14, 0x00, // attribute size
   531  	/* 0468 */ 0x03, 0x00, // attribute count
   532  	/* 046a */ 0x00, 0x00, // ID index    (1-based, 0 means none)
   533  	/* 046c */ 0x00, 0x00, // class index (1-based, 0 means none)
   534  	/* 046e */ 0x00, 0x00, // style index (1-based, 0 means none)
   535  	// ResXMLTree_attribute[0]
   536  	/* 0470 */ 0x0a, 0x00, 0x00, 0x00, // ns [0x0a]="http://schemas..."
   537  	/* 0474 */ 0x00, 0x00, 0x00, 0x00, // name [0x00]=="versionCode"
   538  	/* 0478 */ 0xff, 0xff, 0xff, 0xff, // rawValue
   539  	/* 047c */ 0x08, 0x00, // Res_value size
   540  	/* 047e */ 0x00, // Res_value padding
   541  	/* 047f */ 0x10, // Res_value dataType (INT_DEC)
   542  	/* 0480 */ 0x01, 0x00, 0x00, 0x00, // Res_value data
   543  	// ResXMLTree_attribute[1]
   544  	/* 0484 */ 0x0a, 0x00, 0x00, 0x00, // ns [0x0a]="http://schemas..."
   545  	/* 0488 */ 0x01, 0x00, 0x00, 0x00, // name [0x01]="versionName"
   546  	/* 048c */ 0x0f, 0x00, 0x00, 0x00, // rawValue
   547  	/* 0490 */ 0x08, 0x00, // Res_value size
   548  	/* 0492 */ 0x00, // Res_value padding
   549  	/* 0493 */ 0x03, // Res_value dataType (STRING)
   550  	/* 0494 */ 0x0f, 0x00, 0x00, 0x00, // Res_value data [0x0f]="1.0"
   551  	// ResXMLTree_attribute[2]
   552  	/* 0498 */ 0xff, 0xff, 0xff, 0xff, // ns none
   553  	/* 049c */ 0x0c, 0x00, 0x00, 0x00, // name [0x0c]="package"
   554  	/* 04a0 */ 0x0e, 0x00, 0x00, 0x00, // rawValue
   555  	/* 04a4 */ 0x08, 0x00, // Res_value size
   556  	/* 04a6 */ 0x00, // Res_value padding
   557  	/* 04a7 */ 0x03, // Res_value dataType (STRING)
   558  	/* 04a8 */ 0x0e, 0x00, 0x00, 0x00, // Res_value data [0x0e]="com.zentus..."
   559  	// End XML_START_ELEMENT
   560  
   561  	// Start XML_START_ELEMENT
   562  	/* 04ac */ 0x02, 0x01, 0x10, 0x00, // chunk header XML_START_ELEMENT
   563  	/* 04b0 */ 0x38, 0x00, 0x00, 0x00, // chunk size 56
   564  	/* 04b4 */ 0x0d, 0x00, 0x00, 0x00, // line number
   565  	/* 04b8 */ 0xff, 0xff, 0xff, 0xff, // comment
   566  	/* 04bc */ 0xff, 0xff, 0xff, 0xff, // ns
   567  	/* 04c0 */ 0x10, 0x00, 0x00, 0x00, // name [0x10]="uses-sdk"
   568  	/* 04c4 */ 0x14, 0x00, 0x14, 0x00, // attribute start + size
   569  	/* 04c8 */ 0x01, 0x00, // atrribute count
   570  	/* 04ca */ 0x00, 0x00, // ID index
   571  	/* 04cc */ 0x00, 0x00, 0x00, 0x00, // class index + style index
   572  	// ResXMLTree_attribute[0]
   573  	/* 04d0 */ 0x0a, 0x00, 0x00, 0x00, // ns [0x0a]="http://schemas..."
   574  	/* 04d4 */ 0x02, 0x00, 0x00, 0x00, // name [0x02]="minSdkVersion"
   575  	/* 04d8 */ 0xff, 0xff, 0xff, 0xff, // rawValue
   576  	/* 04dc */ 0x08, 0x00, 0x00, 0x10, // size+padding+type (INT_DEC)
   577  	/* 04e0 */ 0x09, 0x00, 0x00, 0x00,
   578  	// End XML_START_ELEMENT
   579  
   580  	// Start XML_END_ELEMENT
   581  	/* 04e4 */ 0x03, 0x01, 0x10, 0x00, // chunk header XML_END_ELEMENT
   582  	/* 04e8 */ 0x18, 0x00, 0x00, 0x00, // chunk size 24
   583  	/* 04ec */ 0x0d, 0x00, 0x00, 0x00, // line number
   584  	/* 04f0 */ 0xff, 0xff, 0xff, 0xff, // comment
   585  	/* 04f4 */ 0xff, 0xff, 0xff, 0xff, // ns
   586  	/* 04f8 */ 0x10, 0x00, 0x00, 0x00, // name [0x10]="uses-sdk"
   587  	// End XML_END_ELEMENT
   588  
   589  	// Start XML_START_ELEMENT
   590  	/* 04fc */ 0x02, 0x01, 0x10, 0x00, // chunk header XML_START_ELEMENT
   591  	/* 0500 */ 0x60, 0x00, 0x00, 0x00, // chunk size 96
   592  	/* 0504 */ 0x0e, 0x00, 0x00, 0x00, // line number
   593  	/* 0508 */ 0xff, 0xff, 0xff, 0xff, // comment
   594  	/* 050c */ 0xff, 0xff, 0xff, 0xff, // ns
   595  	/* 0510 */ 0x11, 0x00, 0x00, 0x00, // name [0x11]="application"
   596  	/* 0514 */ 0x14, 0x00, 0x14, 0x00, // attribute start + size
   597  	/* 0518 */ 0x03, 0x00, 0x00, 0x00, // attribute count + ID index
   598  	/* 051c */ 0x00, 0x00, 0x00, 0x00, // class index + style index
   599  	// ResXMLTree_attribute[0]
   600  	/* 0520 */ 0x0a, 0x00, 0x00, 0x00, // ns [0x0a]="http://schemas..."
   601  	/* 0524 */ 0x03, 0x00, 0x00, 0x00, // name [0x03]="label"
   602  	/* 0528 */ 0x12, 0x00, 0x00, 0x00, // rawValue
   603  	/* 052c */ 0x08, 0x00, 0x00, 0x03, // size+padding+type (STRING)
   604  	/* 0530 */ 0x12, 0x00, 0x00, 0x00, // [0x12]="Balloon世界"
   605  	// ResXMLTree_attribute[1]
   606  	/* 0534 */ 0x0a, 0x00, 0x00, 0x00, // ns [0x0a]="http://schemas..."
   607  	/* 0538 */ 0x04, 0x00, 0x00, 0x00, // name [0x04]="hasCode"
   608  	/* 053c */ 0xff, 0xff, 0xff, 0xff, // rawValue
   609  	/* 0540 */ 0x08, 0x00, 0x00, 0x12, // size+padding+type (BOOLEAN)
   610  	/* 0544 */ 0x00, 0x00, 0x00, 0x00, // false
   611  	// ResXMLTree_attribute[2]
   612  	/* 0548 */ 0x0a, 0x00, 0x00, 0x00,
   613  	/* 054c */ 0x05, 0x00, 0x00, 0x00, // name=[0x05]="debuggable"
   614  	/* 0550 */ 0xff, 0xff, 0xff, 0xff, // rawValue
   615  	/* 0554 */ 0x08, 0x00, 0x00, 0x12, // size+padding+type (BOOLEAN)
   616  	/* 0558 */ 0xff, 0xff, 0xff, 0xff, // true
   617  	// End XML_START_ELEMENT
   618  
   619  	// Start XML_START_ELEMENT
   620  	/* 055c */ 0x02, 0x01, 0x10, 0x00, // chunk header XML_START_ELEMENT
   621  	/* 0560 */ 0x60, 0x00, 0x00, 0x00, // chunk size 96
   622  	/* 0564 */ 0x0f, 0x00, 0x00, 0x00, // line number
   623  	/* 0568 */ 0xff, 0xff, 0xff, 0xff, // comment ref
   624  	/* 056c */ 0xff, 0xff, 0xff, 0xff, // ns
   625  	/* 0570 */ 0x13, 0x00, 0x00, 0x00, // name [0x13]="activity"
   626  	/* 0574 */ 0x14, 0x00, 0x14, 0x00, // attribute start + size
   627  	/* 0578 */ 0x03, 0x00, 0x00, 0x00, // atrribute count + ID index
   628  	/* 057c */ 0x00, 0x00, 0x00, 0x00, // class index + style index
   629  	// ResXMLTree_attribute[0]
   630  	/* 0580 */ 0x0a, 0x00, 0x00, 0x00, // ns [0x0a]="http://schemas..."
   631  	/* 0584 */ 0x03, 0x00, 0x00, 0x00, // name [0x03]="label"
   632  	/* 0588 */ 0x15, 0x00, 0x00, 0x00, // rawValue
   633  	/* 058c */ 0x08, 0x00, 0x00, 0x03, // size+padding+type (STRING)
   634  	/* 0590 */ 0x15, 0x00, 0x00, 0x00, // [0x15]="Balloon"
   635  	// ResXMLTree_attribute[1]
   636  	/* 0594 */ 0x0a, 0x00, 0x00, 0x00, // ns [0x0a]="http://schemas..."
   637  	/* 0598 */ 0x06, 0x00, 0x00, 0x00, // name [0x06]="name"
   638  	/* 059c */ 0x14, 0x00, 0x00, 0x00, // rawValue
   639  	/* 05a0 */ 0x08, 0x00, 0x00, 0x03, // size+padding+type (STRING)
   640  	/* 05a4 */ 0x14, 0x00, 0x00, 0x00, // [0x14]="android.app.NativeActivity"
   641  	// ResXMLTree_attribute[2]
   642  	/* 05a8 */ 0x0a, 0x00, 0x00, 0x00,
   643  	/* 05ac */ 0x07, 0x00, 0x00, 0x00, // name [0x07]="configChanges"
   644  	/* 05b0 */ 0xff, 0xff, 0xff, 0xff, // rawValue
   645  	/* 05b4 */ 0x08, 0x00, 0x00, 0x11, // size+padding+type (INT_HEX)
   646  	/* 05b8 */ 0xa0, 0x00, 0x00, 0x00, // orientation|keyboardHidden (0x80|0x0020=0xa0)
   647  	// End XML_START_ELEMENT
   648  
   649  	// Start XML_START_ELEMENT
   650  	/* 05bc */ 0x02, 0x01, 0x10, 0x00, // chunk header XML_START_ELEMENT
   651  	/* 05c0 */ 0x4c, 0x00, 0x00, 0x00, // chunk size 76
   652  	/* 05c4 */ 0x12, 0x00, 0x00, 0x00, // line number
   653  	/* 05c8 */ 0xff, 0xff, 0xff, 0xff, // comment ref
   654  	/* 05cc */ 0xff, 0xff, 0xff, 0xff, // ns
   655  	/* 05d0 */ 0x16, 0x00, 0x00, 0x00, // name [0x16]="meta-data"
   656  	/* 05d4 */ 0x14, 0x00, 0x14, 0x00, // atrribute start + size
   657  	/* 05d8 */ 0x02, 0x00, 0x00, 0x00, // attribute count + ID index
   658  	/* 05dc */ 0x00, 0x00, 0x00, 0x00, // class+style index
   659  	// ResXMLTree_attribute[0]
   660  	/* 05e0 */ 0x0a, 0x00, 0x00, 0x00, // ns [0x0a]="http://schemas..."
   661  	/* 05e4 */ 0x06, 0x00, 0x00, 0x00, // name [0x06]="name"
   662  	/* 05e8 */ 0x17, 0x00, 0x00, 0x00, // rawValue
   663  	/* 05ec */ 0x08, 0x00, 0x00, 0x03, // size + padding + type (STRING)
   664  	/* 05f0 */ 0x17, 0x00, 0x00, 0x00, // [0x17]="android.app.lib_name"
   665  	// ResXMLTree_attribute[1]
   666  	/* 05f4 */ 0x0a, 0x00, 0x00, 0x00, // ns [0x0a]="http://schemas..."
   667  	/* 05f8 */ 0x08, 0x00, 0x00, 0x00,
   668  	/* 05fc */ 0x18, 0x00, 0x00, 0x00,
   669  	/* 0600 */ 0x08, 0x00, 0x00, 0x03, // size + padding + type (STRING)
   670  	/* 0604 */ 0x18, 0x00, 0x00, 0x00, // [0x18]="balloon"
   671  	// End XML_START_ELEMENT
   672  
   673  	// Start XML_END_ELEMENT
   674  	/* 0608 */ 0x03, 0x01, 0x10, 0x00, // chunk header XML_END_ELEMENT
   675  	/* 060c */ 0x18, 0x00, 0x00, 0x00, // chunk size 24
   676  	/* 0610 */ 0x12, 0x00, 0x00, 0x00, // line-number
   677  	/* 0614 */ 0xff, 0xff, 0xff, 0xff,
   678  	/* 0618 */ 0xff, 0xff, 0xff, 0xff,
   679  	/* 061c */ 0x16, 0x00, 0x00, 0x00, // name [0x16]="meta-data"
   680  	// End XML_END_ELEMENT
   681  
   682  	// Start XML_START_ELEMENT
   683  	/* 0620 */ 0x02, 0x01, 0x10, 0x00, // chunk header XML_START_ELEMENT
   684  	/* 0624 */ 0x24, 0x00, 0x00, 0x00, // chunk size 36
   685  	/* 0628 */ 0x13, 0x00, 0x00, 0x00, // line number
   686  	/* 062c */ 0xff, 0xff, 0xff, 0xff, // comment
   687  	/* 0630 */ 0xff, 0xff, 0xff, 0xff, // ns
   688  	/* 0634 */ 0x19, 0x00, 0x00, 0x00, // name [0x19]="intent-filter"
   689  	/* 0638 */ 0x14, 0x00, 0x14, 0x00, // attribute start + size
   690  	/* 063c */ 0x00, 0x00, 0x00, 0x00, // attribute count + ID index
   691  	/* 0640 */ 0x00, 0x00, 0x00, 0x00, // class index + style index
   692  	// End XML_START_ELEMENT
   693  
   694  	// Start XML_CDATA
   695  	/* 0644 */ 0x04, 0x01, 0x10, 0x00, // chunk header XML_CDATA
   696  	/* 0648 */ 0x1c, 0x00, 0x00, 0x00, // chunk size 28
   697  	/* 064c */ 0x13, 0x00, 0x00, 0x00, // line number
   698  	/* 0650 */ 0xff, 0xff, 0xff, 0xff, // comment
   699  	/* 0654 */ 0x1a, 0x00, 0x00, 0x00, // data [0x1a]="\there is some text\n"
   700  	/* 0658 */ 0x08, 0x00, 0x00, 0x00,
   701  	/* 065c */ 0x00, 0x00, 0x00, 0x00,
   702  	// End XML_CDATA
   703  
   704  	// Start XML_START_ELEMENT
   705  	/* 0660 */ 0x02, 0x01, 0x10, 0x00,
   706  	/* 0664 */ 0x38, 0x00, 0x00, 0x00,
   707  	/* 0668 */ 0x15, 0x00, 0x00, 0x00,
   708  	/* 066c */ 0xff, 0xff, 0xff, 0xff,
   709  	/* 0670 */ 0xff, 0xff, 0xff, 0xff,
   710  	/* 0674 */ 0x1b, 0x00, 0x00, 0x00,
   711  	/* 0678 */ 0x14, 0x00, 0x14, 0x00,
   712  	/* 067c */ 0x01, 0x00, 0x00, 0x00,
   713  	/* 0680 */ 0x00, 0x00, 0x00, 0x00,
   714  	/* 0684 */ 0x0a, 0x00, 0x00, 0x00,
   715  	/* 0688 */ 0x06, 0x00, 0x00, 0x00,
   716  	/* 068c */ 0x1c, 0x00, 0x00, 0x00,
   717  	/* 0690 */ 0x08, 0x00, 0x00, 0x03,
   718  	/* 0694 */ 0x1c, 0x00, 0x00, 0x00,
   719  	// End XML_START_ELEMENT
   720  
   721  	// Start XML_END_ELEMENT
   722  	/* 0698 */ 0x03, 0x01, 0x10, 0x00,
   723  	/* 069c */ 0x18, 0x00, 0x00, 0x00,
   724  	/* 06a0 */ 0x15, 0x00, 0x00, 0x00, // line number
   725  	/* 06a4 */ 0xff, 0xff, 0xff, 0xff,
   726  	/* 06a8 */ 0xff, 0xff, 0xff, 0xff,
   727  	/* 06ac */ 0x1b, 0x00, 0x00, 0x00, // [0x1b]="action"
   728  	// End XML_END_ELEMENT
   729  
   730  	// Start XML_START_ELEMENT
   731  	/* 06b0 */ 0x02, 0x01, 0x10, 0x00,
   732  	/* 06b4 */ 0x38, 0x00, 0x00, 0x00,
   733  	/* 06b8 */ 0x16, 0x00, 0x00, 0x00,
   734  	/* 06bc */ 0xff, 0xff, 0xff, 0xff,
   735  	/* 06c0 */ 0xff, 0xff, 0xff, 0xff,
   736  	/* 06c4 */ 0x1d, 0x00, 0x00, 0x00,
   737  	/* 06c8 */ 0x14, 0x00, 0x14, 0x00,
   738  	/* 06cc */ 0x01, 0x00, 0x00, 0x00,
   739  	/* 06d0 */ 0x00, 0x00, 0x00, 0x00,
   740  	/* 06d4 */ 0x0a, 0x00, 0x00, 0x00,
   741  	/* 06d8 */ 0x06, 0x00, 0x00, 0x00,
   742  	/* 06dc */ 0x1e, 0x00, 0x00, 0x00,
   743  	/* 06e0 */ 0x08, 0x00, 0x00, 0x03,
   744  	/* 06e4 */ 0x1e, 0x00, 0x00, 0x00,
   745  	// End XML_START_ELEMENT
   746  
   747  	// Start XML_END_ELEMENT
   748  	/* 06e8 */ 0x03, 0x01, 0x10, 0x00,
   749  	/* 06ec */ 0x18, 0x00, 0x00, 0x00,
   750  	/* 06f0 */ 0x16, 0x00, 0x00, 0x00, // line number
   751  	/* 06f4 */ 0xff, 0xff, 0xff, 0xff,
   752  	/* 06f8 */ 0xff, 0xff, 0xff, 0xff,
   753  	/* 06fc */ 0x1d, 0x00, 0x00, 0x00, // name [0x1d]="category"
   754  	// End XML_END_ELEMENT
   755  
   756  	// Start XML_END_ELEMENT
   757  	/* 0700 */ 0x03, 0x01, 0x10, 0x00, // chunk header XML_END_ELEMENT
   758  	/* 0704 */ 0x18, 0x00, 0x00, 0x00, // chunk size 24
   759  	/* 0708 */ 0x17, 0x00, 0x00, 0x00, // line number
   760  	/* 070c */ 0xff, 0xff, 0xff, 0xff, // comment
   761  	/* 0710 */ 0xff, 0xff, 0xff, 0xff, // ns
   762  	/* 0714 */ 0x19, 0x00, 0x00, 0x00, // name [0x19]="intent-filter"
   763  	// End XML_END_ELEMENT
   764  
   765  	// Start XML_END_ELEMENT
   766  	/* 0718 */ 0x03, 0x01, 0x10, 0x00,
   767  	/* 071c */ 0x18, 0x00, 0x00, 0x00,
   768  	/* 0720 */ 0x18, 0x00, 0x00, 0x00, // line number
   769  	/* 0724 */ 0xff, 0xff, 0xff, 0xff,
   770  	/* 0728 */ 0xff, 0xff, 0xff, 0xff,
   771  	/* 072c */ 0x13, 0x00, 0x00, 0x00, // name [0x13]="activity"
   772  	// End XML_END_ELEMENT
   773  
   774  	// Start XML_END_ELEMENT
   775  	/* 0730 */ 0x03, 0x01, 0x10, 0x00,
   776  	/* 0734 */ 0x18, 0x00, 0x00, 0x00,
   777  	/* 0738 */ 0x19, 0x00, 0x00, 0x00,
   778  	/* 073c */ 0xff, 0xff, 0xff, 0xff,
   779  	/* 0740 */ 0xff, 0xff, 0xff, 0xff,
   780  	/* 0744 */ 0x11, 0x00, 0x00, 0x00, // name [0x11]="application"
   781  	// End XML_END_ELEMENT
   782  
   783  	// Start XML_END_ELEMENT
   784  	/* 0748 */ 0x03, 0x01, 0x10, 0x00,
   785  	/* 074c */ 0x18, 0x00, 0x00, 0x00,
   786  	/* 0750 */ 0x1a, 0x00, 0x00, 0x00, // line number
   787  	/* 0754 */ 0xff, 0xff, 0xff, 0xff,
   788  	/* 0758 */ 0xff, 0xff, 0xff, 0xff,
   789  	/* 075c */ 0x0d, 0x00, 0x00, 0x00, // name [0x0d]="manifest"
   790  	// End XML_END_ELEMENT
   791  
   792  	/* 0760 */ 0x01, 0x01, 0x10, 0x00, // chunk header XML_END_NAMESPACE
   793  	/* 0764 */ 0x18, 0x00, 0x00, 0x00, // chunk size 24
   794  	/* 0768 */ 0x1a, 0x00, 0x00, 0x00, // line number
   795  	/* 076c */ 0xff, 0xff, 0xff, 0xff, // comment
   796  	/* 0770 */ 0x09, 0x00, 0x00, 0x00, // prefix [0x09]="android"
   797  	/* 0774 */ 0x0a, 0x00, 0x00, 0x00, // url
   798  }
   799  
   800  const input = `<?xml version="1.0" encoding="utf-8"?>
   801  <!--
   802  Copyright 2014 The Go Authors. All rights reserved.
   803  Use of this source code is governed by a BSD-style
   804  license that can be found in the LICENSE file.
   805  -->
   806  <manifest
   807  	xmlns:android="http://schemas.android.com/apk/res/android"
   808  	package="com.zentus.balloon"
   809  	android:versionCode="1"
   810  	android:versionName="1.0">
   811  
   812  	%s
   813  	<application android:label="Balloon世界" android:hasCode="false" android:debuggable="true">
   814  	<activity android:name="android.app.NativeActivity"
   815  		android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
   816  		android:label="Balloon"
   817  		android:screenOrientation="portrait"
   818  		android:configChanges="orientation|keyboardHidden">
   819  		<meta-data android:name="android.app.lib_name" android:value="balloon" />
   820  		<intent-filter>
   821  			here is some text
   822  			<action android:name="android.intent.action.MAIN" />
   823  			<category android:name="android.intent.category.LAUNCHER" />
   824  		</intent-filter>
   825  	</activity>
   826  	</application>
   827  </manifest>`