1- using Xamarin . Android . Tools ;
2-
31namespace ApplicationUtility ;
42
53[ AspectReporter ( typeof ( PackageAPK ) ) ]
@@ -20,108 +18,69 @@ public ApplicationPackageReporter (ApplicationPackage package, MarkdownDocument
2018
2119 protected override void DoReport ( )
2220 {
23- WriteAspectDesc ( package . PackageFormat ) ;
2421 AddAspectDesc ( package . PackageFormat ) ;
2522
26- WriteSubsectionBanner ( "Generic Android application information" ) ;
2723 AddSection ( "Generic Android application information" ) ;
28-
29- WriteNativeArch ( package . Architectures ) ;
3024 AddNativeArchDesc ( package . Architectures ) ;
31-
32- WriteYesNo ( "Valid Android package" , package . ValidAndroidPackage ) ;
3325 AddYesNo ( "Valid Android package" , package . ValidAndroidPackage ) ;
34-
35- WriteItem ( "Package name" , ValueOrNone ( package . PackageName ) ) ;
3626 AddLabeledItem ( "Package name" , ValueOrNone ( package . PackageName ) ) ;
37-
38- WriteItem ( "Main activity" , ValueOrNone ( package . MainActivity ) ) ;
3927 AddLabeledItem ( "Main activity" , ValueOrNone ( package . MainActivity ) ) ;
40-
41- WriteItem ( "Minimum SDK version" , ValueOrNone ( package . MinSdkVersion ) ) ;
4228 AddLabeledItem ( "Minimum SDK version" , ValueOrNone ( package . MinSdkVersion ) ) ;
43-
44- WriteItem ( "Target SDK version" , ValueOrNone ( package . TargetSdkVersion ) ) ;
4529 AddLabeledItem ( "Target SDK version" , ValueOrNone ( package . TargetSdkVersion ) ) ;
46-
47- WriteYesNo ( "Signed" , package . Signed ) ;
4830 AddYesNo ( "Signed" , package . Signed ) ;
49-
50- WriteYesNo ( "Debuggable" , package . Debuggable ) ;
5131 AddYesNo ( "Debuggable" , package . Debuggable ) . AddNewline ( ) ;
5232
5333 if ( package . Permissions == null || package . Permissions . Count == 0 ) {
5434 AddText ( "No permissions specified" ) ;
55- WriteItem ( "Permissions" , "none" ) ;
5635 } else {
5736 AddText ( $ "Application requests the following { GetCountable ( Countable . Permission , package . Permissions . Count ) } :") ;
58- WriteLine ( LabelColor , "Permissions:" ) ;
5937
6038 ReportDoc . BeginList ( ) ;
6139 foreach ( string permission in package . Permissions ) {
6240 ReportDoc . AddListItem ( $ "{ permission } ", MarkdownTextStyle . Monospace ) ;
63-
64- Write ( LabelColor , " * " ) ;
65- WriteLine ( ValidValueColor , permission ) ;
6641 }
6742 ReportDoc . EndList ( ) ;
6843 }
6944
7045 AddSection ( "Shared libraries" , 2 ) ;
71-
7246 if ( package . SharedLibraries == null || package . SharedLibraries . Count == 0 ) {
7347 // Very unlikely...
74- WriteItem ( "Shared libraries" , "none" ) ;
7548 AddText ( "No shared libraries found in the package" ) ;
7649 } else {
7750 AddText ( $ "Application contains the following { GetCountable ( Countable . SharedLibrary , package . SharedLibraries . Count ) } :") ;
78- WriteLine ( LabelColor , "Shared libraries:" ) ;
7951
8052 ReportDoc . BeginList ( ) ;
8153 foreach ( SharedLibrary lib in package . SharedLibraries ) {
8254 ReportDoc . StartListItem ( $ "{ lib . Name } ", MarkdownTextStyle . Monospace ) ;
55+
56+ // Markdown renderer has a bug where it won't render the first item of the sub-list
57+ // properly if the item line ends with a formatting character (or whitespace)
58+ AddText ( ": " , addIndent : false ) ;
8359 ReportDoc . BeginList ( )
84- . AddListItem ( $ "Alignment: { lib . Alignment } ")
85- . AddListItem ( $ "Debug info: { YesNo ( lib . HasDebugInfo ) } ")
86- . AddListItem ( $ "Size: { lib . Size } ", appendLine : false )
60+ . AddLabeledListItem ( "Alignment" , $ " { lib . Alignment } ")
61+ . AddLabeledListItem ( "Debug info" , $ " { YesNo ( lib . HasDebugInfo ) } ")
62+ . AddLabeledListItem ( "Size" , $ " { lib . Size } ", appendLine : false )
8763 . EndList ( )
8864 . EndListItem ( ) ;
89-
90- Write ( LabelColor , " * " ) ;
91- WriteLine ( ValidValueColor , $ "{ lib . Name } ") ;
92- WriteLine ( LabelColor , $ " * Alignment: { lib . Alignment } ") ;
93- WriteLine ( LabelColor , $ " * Debug info: { YesNo ( lib . HasDebugInfo ) } ") ;
94- WriteLine ( LabelColor , $ " * Size: { lib . Size } ") ;
9565 }
9666 ReportDoc . AddNewline ( ) ;
9767 ReportDoc . EndList ( ) ;
9868 }
9969
100- WriteSubsectionBanner ( ".NET for Android application information" ) ;
10170 AddSection ( ".NET for Android application information" , 1 ) ;
102-
103- WriteItem ( "Runtime" , package . Runtime . ToString ( ) ) ;
10471 AddLabeledItem ( "Runtime" , package . Runtime . ToString ( ) ) ;
10572
10673 AddSection ( "Assembly stores" , 2 ) ;
107-
10874 if ( package . AssemblyStores == null || package . AssemblyStores . Count == 0 ) {
109- WriteItem ( "Assembly stores" , "none" ) ;
11075 AddText ( "No assembly stores found" ) ;
11176 } else {
11277 AddText ( $ "Application contains the following { GetCountable ( Countable . AssemblyStore , package . AssemblyStores . Count ) } :") ;
113- WriteLine ( LabelColor , "Assembly stores" ) ;
11478
11579 ReportDoc . BeginList ( ) ;
11680 foreach ( AssemblyStore store in package . AssemblyStores ) {
11781 ReportDoc . StartListItem ( $ "{ store . Architecture } ", MarkdownTextStyle . Monospace ) ;
11882 AddListItemText ( $ " ({ store . NumberOfAssemblies } { GetCountable ( Countable . Assembly , store . NumberOfAssemblies ) } )") ;
11983 ReportDoc . EndListItem ( ) ;
120-
121- var color = store . Architecture == AndroidTargetArch . None ? InvalidValueColor : ValidValueColor ;
122-
123- Write ( LabelColor , " * " ) ;
124- WriteLine ( color , $ "{ store . Architecture } ({ store . NumberOfAssemblies } { GetCountable ( Countable . Assembly , store . NumberOfAssemblies ) } )") ;
12584 }
12685 ReportDoc . EndList ( ) ;
12786 }
0 commit comments