update:2020.12.25
fix:新后台对接完成 add:
This commit is contained in:
@@ -4,16 +4,23 @@ import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
|
||||
import com.info.sn.network.HTTPInterface;
|
||||
import com.info.sn.utils.ApkUtils;
|
||||
|
||||
public class APKinstallReceiver extends BroadcastReceiver {
|
||||
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
// TODO: This method is called when the BroadcastReceiver is receiving
|
||||
// an Intent broadcast.
|
||||
|
||||
if (intent.getAction().equals(Intent.ACTION_PACKAGE_ADDED) || intent.getAction().equals(Intent.ACTION_PACKAGE_REPLACED)) {
|
||||
String action = intent.getAction();
|
||||
if (action.equals(Intent.ACTION_PACKAGE_ADDED) || action.equals(Intent.ACTION_PACKAGE_REPLACED)) {
|
||||
String packageName = intent.getDataString().replace("package:", "");
|
||||
|
||||
int code = ApkUtils.getAppVersionCode(context,packageName);
|
||||
HTTPInterface.SendAppInstall(packageName,code ,1);
|
||||
} else if (action.equals(Intent.ACTION_PACKAGE_REMOVED)) {
|
||||
String packageName = intent.getDataString().replace("package:", "");
|
||||
HTTPInterface.SendAppInstall(packageName,0 ,2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user