1010import java .io .InputStreamReader ;
1111import java .nio .charset .StandardCharsets ;
1212import java .util .HashMap ;
13+ import java .util .Locale ;
1314
1415public class PropUtils {
1516 private static final HashMap <String , String > moduleSupportsFallbacks = new HashMap <>();
@@ -24,7 +25,8 @@ public class PropUtils {
2425 moduleSupportsFallbacks .put ("aospill" , "https://t.me/PannekoX" );
2526 moduleSupportsFallbacks .put ("quickstepswitcher" , "https://t.me/QuickstepSwitcherSupport" );
2627 moduleSupportsFallbacks .put ("riru_edxposed" , "https://t.me/EdXposed" );
27- moduleSupportsFallbacks .put ("riru_lsposed" , "https://github.com/LSPosed/LSPosed/issues/" );
28+ moduleSupportsFallbacks .put ("riru_lsposed" , "https://github.com/LSPosed/LSPosed/issues" );
29+ moduleSupportsFallbacks .put ("substratum" , "https://github.com/substratum/substratum/issues" );
2830 // Config are application installed by modules that allow them to be configured
2931 moduleConfigsFallbacks .put ("quickstepswitcher" , "xyz.paphonb.quickstepswitcher" );
3032 moduleConfigsFallbacks .put ("riru_edxposed" , "org.meowcat.edxposed.manager" );
@@ -44,7 +46,7 @@ public class PropUtils {
4446 }
4547
4648 public static void readProperties (ModuleInfo moduleInfo , String file ) throws IOException {
47- boolean readId = false , readVersionCode = false ;
49+ boolean readId = false , readIdSec = false , readVersionCode = false ;
4850 try (BufferedReader bufferedReader = new BufferedReader (
4951 new InputStreamReader (SuFileInputStream .open (file ), StandardCharsets .UTF_8 ))) {
5052 String line ;
@@ -63,7 +65,12 @@ public static void readProperties(ModuleInfo moduleInfo, String file) throws IOE
6365 }
6466 break ;
6567 case "name" :
68+ if (readIdSec && !moduleInfo .id .equals (value ))
69+ throw new IOException ("Duplicate module name!" );
6670 moduleInfo .name = value ;
71+ if (moduleInfo .id .equals (value )) {
72+ readIdSec = true ;
73+ }
6774 break ;
6875 case "version" :
6976 moduleInfo .version = value ;
@@ -124,7 +131,13 @@ public static void readProperties(ModuleInfo moduleInfo, String file) throws IOE
124131 }
125132 }
126133 if (!readId ) {
127- throw new IOException ("Didn't read module id at least once!" );
134+ if (readIdSec ) {
135+ // Using the name for module id is not really appropriate, so beautify it a bit
136+ moduleInfo .name = moduleInfo .id .substring (0 , 1 ).toUpperCase (Locale .ROOT ) +
137+ moduleInfo .id .substring (1 ).replace ('_' , ' ' );
138+ } else {
139+ throw new IOException ("Didn't read module id at least once!" );
140+ }
128141 }
129142 if (!readVersionCode ) {
130143 throw new IOException ("Didn't read module versionCode at least once!" );
0 commit comments