File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed
src/main/java/com/reandroid Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -82,10 +82,17 @@ public void scanMainDirectory(File mainDirectory) throws IOException {
8282 public void scanResourcesDirectory (File resourcesDirectory ) throws IOException {
8383 try {
8484 scanResourceFiles (resourcesDirectory );
85+ ensureEmptyTable ();
8586 } catch (XmlPullParserException ex ) {
8687 throw new IOException (ex );
8788 }
8889 }
90+ private void ensureEmptyTable () {
91+ TableBlock tableBlock = this .getTableBlock ();
92+ if (tableBlock .initializeAsEmpty ()) {
93+ logMessage ("Using <NULL> resource table" );
94+ }
95+ }
8996 private void scanResourceFiles (File resourcesDirectory ) throws IOException , XmlPullParserException {
9097 List <File > pubXmlFileList = ApkUtil .listPublicXmlFiles (resourcesDirectory );
9198 if (pubXmlFileList .size () == 0 ){
Original file line number Diff line number Diff line change @@ -530,6 +530,14 @@ public boolean isEmpty(){
530530 }
531531 return true ;
532532 }
533+ public boolean initializeAsEmpty () {
534+ if (isEmpty ()) {
535+ setNull (true );
536+ setCurrentPackage (pickOrEmptyPackage ());
537+ return true ;
538+ }
539+ return false ;
540+ }
533541 public boolean isMultiPackage () {
534542 return size () > 1 ;
535543 }
@@ -845,8 +853,7 @@ public static TableBlock load(InputStream inputStream) throws IOException{
845853 }
846854 public static TableBlock createEmpty () {
847855 TableBlock tableBlock = new TableBlock ();
848- tableBlock .pickOrEmptyPackage ();
849- tableBlock .setNull (true );
856+ tableBlock .initializeAsEmpty ();
850857 return tableBlock ;
851858 }
852859
You can’t perform that action at this time.
0 commit comments