Skip to content

Commit bc5b9a8

Browse files
committed
Removed reading from META-INF files
* This was not reliable after some additional testing on a device
1 parent b7a5c08 commit bc5b9a8

File tree

1 file changed

+1
-13
lines changed
  • OneSignalSDK/onesignal/src/main/java/com/onesignal

1 file changed

+1
-13
lines changed

OneSignalSDK/onesignal/src/main/java/com/onesignal/OSUtils.java

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -150,11 +150,10 @@ private static boolean hasJobIntentService() {
150150
}
151151

152152
private Integer checkAndroidSupportLibrary(Context context) {
153-
String version = getAndroidSupporVersionFromMetaFile();
154153
boolean hasWakefulBroadcastReceiver = hasWakefulBroadcastReceiver();
155154
boolean hasNotificationManagerCompat = hasNotificationManagerCompat();
156155

157-
if (version == null && !hasWakefulBroadcastReceiver && !hasNotificationManagerCompat) {
156+
if (!hasWakefulBroadcastReceiver && !hasNotificationManagerCompat) {
158157
OneSignal.Log(OneSignal.LOG_LEVEL.FATAL, "Could not find the Android Support Library. Please make sure it has been correctly added to your project.");
159158
return UserState.PUSH_STATUS_MISSING_ANDROID_SUPPORT_LIBRARY;
160159
}
@@ -178,17 +177,6 @@ && getTargetSdkVersion(context) >= Build.VERSION_CODES.O) {
178177
return null;
179178
}
180179

181-
private static String getAndroidSupporVersionFromMetaFile() {
182-
InputStream inputStream = Object.class.getClassLoader().getResourceAsStream("META-INF/com.android.support_support-v4.version");
183-
if (inputStream == null)
184-
return null;
185-
186-
Scanner scanner = new Scanner(inputStream, "UTF-8");
187-
String version = scanner.useDelimiter("\\A").hasNext() ? scanner.next() : null;
188-
scanner.close();
189-
return version;
190-
}
191-
192180
int getDeviceType() {
193181
try {
194182
// Class only available on the FireOS and only when the following is in the AndroidManifest.xml.

0 commit comments

Comments
 (0)