NoPssDrm/app/src/main/java/com/psmreborn/nopsmdrm/Helper.java
2024-04-21 01:57:35 +12:00

35 lines
1009 B
Java

package com.psmreborn.nopsmdrm;
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import java.text.SimpleDateFormat;
import java.util.Date;
public class Helper {
private static Context ctx;
public static void setContext(Context context){
ctx = context;
}
public static boolean isPsmInstalled(){
try {
ctx.getPackageManager().getApplicationInfo("com.playstation.psstore", 0);
} catch (PackageManager.NameNotFoundException e) {
return false;
}
return true;
}
public static ApplicationInfo getPsmApp() throws PackageManager.NameNotFoundException {
ApplicationInfo pkg = ctx.getPackageManager().getApplicationInfo("com.playstation.psstore", 0);
return pkg;
}
public static String getDateTime(){
String formattedDate = new SimpleDateFormat("MM_dd_yyyy_HH_mm_ss").format(new Date());
return formattedDate;
}
}