fix: Remove update checker, INSTALL_PACKAGES, and SYSTEM_ALERT_WINDOW permissions to clear Play Protect flags
This commit is contained in:
1 parent
e1a91a335b
commit
314b3f99c6
5 files changed
+4
-104
No files matched your search
@@ -2,8 +2,6 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
|
||||
|
||||
<uses-feature
|
||||
android:name="android.hardware.touchscreen"
|
||||
android:required="false" />
|
||||
@@ -96,15 +94,6 @@
|
||||
</intent-filter>
|
||||
</service>
|
||||
|
||||
<provider
|
||||
android:name="androidx.core.content.FileProvider"
|
||||
android:authorities="${applicationId}.fileprovider"
|
||||
android:exported="false"
|
||||
android:grantUriPermissions="true">
|
||||
<meta-data
|
||||
android:name="android.support.FILE_PROVIDER_PATHS"
|
||||
android:resource="@xml/file_paths" />
|
||||
</provider>
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
@@ -36,7 +36,6 @@ public class MainActivity extends AppCompatActivity implements ImageView.OnClick
|
||||
ImageView.OnFocusChangeListener {
|
||||
public static final int REQUEST_MEDIA_PROJECTION = 1;
|
||||
private static final int REQUEST_NOTIFICATION_PERMISSION = 2;
|
||||
private static final int REQUEST_OVERLAY_PERMISSION = 3;
|
||||
private static final String TAG = "DEBUG";
|
||||
private boolean mRecorderRunning = false;
|
||||
private static MediaProjectionManager mMediaProjectionManager;
|
||||
@@ -66,8 +65,7 @@ public class MainActivity extends AppCompatActivity implements ImageView.OnClick
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_main);
|
||||
|
||||
// Check for updates
|
||||
checkForUpdates();
|
||||
// Remove update check logic
|
||||
mMediaProjectionManager = (MediaProjectionManager)
|
||||
getSystemService(Context.MEDIA_PROJECTION_SERVICE);
|
||||
|
||||
@@ -100,8 +98,6 @@ public class MainActivity extends AppCompatActivity implements ImageView.OnClick
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
// Check for updates when app returns to foreground
|
||||
checkForUpdates();
|
||||
}
|
||||
|
||||
private void requestNotificationPermission() {
|
||||
@@ -118,9 +114,6 @@ public class MainActivity extends AppCompatActivity implements ImageView.OnClick
|
||||
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
// Check for updates when user clicks play
|
||||
checkForUpdates();
|
||||
|
||||
if (!mRecorderRunning) {
|
||||
requestScreenCapture();
|
||||
} else {
|
||||
@@ -130,13 +123,6 @@ public class MainActivity extends AppCompatActivity implements ImageView.OnClick
|
||||
}
|
||||
|
||||
private void requestScreenCapture() {
|
||||
// Check overlay permission on first attempt
|
||||
if (mPermissionDeniedCount == 0 && !PermissionHelper.canDrawOverlays(this)) {
|
||||
Log.d(TAG, "Requesting overlay permission first");
|
||||
PermissionHelper.requestOverlayPermission(this, REQUEST_OVERLAY_PERMISSION);
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
Intent captureIntent = mMediaProjectionManager.createScreenCaptureIntent();
|
||||
startActivityForResult(captureIntent, REQUEST_MEDIA_PROJECTION);
|
||||
@@ -182,10 +168,6 @@ public class MainActivity extends AppCompatActivity implements ImageView.OnClick
|
||||
startScreenRecorder(resultCode, (Intent) data.clone());
|
||||
mRecorderRunning = true;
|
||||
}
|
||||
if (requestCode == REQUEST_OVERLAY_PERMISSION) {
|
||||
// Small delay before requesting capture - helps on some devices
|
||||
getWindow().getDecorView().postDelayed(this::requestScreenCapture, 500);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -260,42 +242,6 @@ public class MainActivity extends AppCompatActivity implements ImageView.OnClick
|
||||
}
|
||||
}
|
||||
|
||||
private void checkForUpdates() {
|
||||
new Thread(() -> {
|
||||
try {
|
||||
Log.d(TAG, "Checking for updates...");
|
||||
|
||||
com.hyperion.grabber.common.util.UpdateChecker checker =
|
||||
new com.hyperion.grabber.common.util.UpdateChecker(this);
|
||||
com.hyperion.grabber.common.util.GithubRelease release = checker.checkForUpdates();
|
||||
|
||||
if (release != null) {
|
||||
Log.d(TAG, "Update found: " + release.getTagName());
|
||||
runOnUiThread(() -> showUpdateDialog(release));
|
||||
} else {
|
||||
Log.d(TAG, "No updates available");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "Error checking for updates", e);
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
|
||||
private void showUpdateDialog(com.hyperion.grabber.common.util.GithubRelease release) {
|
||||
UpdateDialog dialog = new UpdateDialog(this);
|
||||
dialog.show(release,
|
||||
() -> {
|
||||
com.hyperion.grabber.common.util.UpdateManager manager =
|
||||
new com.hyperion.grabber.common.util.UpdateManager(getApplicationContext());
|
||||
manager.downloadAndInstall(release.getDownloadUrl(), release.getTagName(), success -> {
|
||||
return kotlin.Unit.INSTANCE;
|
||||
});
|
||||
return kotlin.Unit.INSTANCE;
|
||||
},
|
||||
() -> kotlin.Unit.INSTANCE
|
||||
);
|
||||
}
|
||||
|
||||
private boolean isServiceRunning() {
|
||||
ActivityManager manager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
|
||||
assert manager != null;
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<paths>
|
||||
<external-path name="downloads" path="Download/" />
|
||||
<external-files-path name="external_files" path="." />
|
||||
<cache-path name="cache" path="." />
|
||||
</paths>
|
||||
Reference in new issue
Block a user