Skip to content
This repository was archived by the owner on May 4, 2023. It is now read-only.

Commit 037a0b9

Browse files
authored
Merge branch 'Fox2Code:master' into master
2 parents da6d0ac + 1c3894e commit 037a0b9

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

app/src/main/java/com/fox2code/mmm/installer/InstallerActivity.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,13 +164,17 @@ protected void onCreate(Bundle savedInstanceState) {
164164
Files.fixJavaZipHax(rawModule);
165165
boolean noPatch = false;
166166
boolean isModule = false;
167+
boolean isAnyKernel = false;
167168
errMessage = "File is not a valid zip file";
168169
try (ZipInputStream zipInputStream = new ZipInputStream(
169170
new ByteArrayInputStream(rawModule))) {
170171
ZipEntry zipEntry;
171172
while ((zipEntry = zipInputStream.getNextEntry()) != null) {
172173
String entryName = zipEntry.getName();
173-
if (entryName.equals("module.prop")) {
174+
if (entryName.equals("anykernel.sh")) {
175+
isAnyKernel = true;
176+
break;
177+
} else if (entryName.equals("module.prop")) {
174178
noPatch = true;
175179
isModule = true;
176180
break;
@@ -180,7 +184,8 @@ protected void onCreate(Bundle savedInstanceState) {
180184
}
181185
}
182186
if (!isModule) {
183-
this.setInstallStateFinished(false,
187+
this.setInstallStateFinished(false, isAnyKernel ?
188+
"! AnyKernel modules can only be installed on recovery" :
184189
"! File is not a valid magisk module", "");
185190
return;
186191
}

app/src/main/java/com/fox2code/mmm/utils/PropUtils.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -249,9 +249,7 @@ public static void readProperties(ModuleInfo moduleInfo, InputStream inputStream
249249
if (readIdSec && local) {
250250
// Using the name for module id is not really appropriate, so beautify it a bit
251251
moduleInfo.name = makeNameFromId(moduleInfo.id);
252-
} else if (local) { // Allow local module to not declare ids
253-
invalid = true;
254-
} else {
252+
} else if (!local) { // Allow local modules to not declare ids
255253
throw new IOException("Didn't read module id at least once!");
256254
}
257255
}

0 commit comments

Comments
 (0)