make K-9 Mail launch

This commit is contained in:
Julian Winkler
2024-12-13 16:25:07 +01:00
parent 17713781d0
commit 0e078894ce
14 changed files with 101 additions and 45 deletions

View File

@@ -538,11 +538,7 @@ public class Context extends Object {
@Override
public void run() {
try {
Class<? extends Activity> cls = Class.forName(intent_.getComponent().getClassName()).asSubclass(Activity.class);
Constructor<? extends Activity> constructor = cls.getConstructor();
Activity activity = constructor.newInstance();
activity.intent = intent_;
activity.getWindow().native_window = this_application.native_window;
Activity activity = Activity.internalCreateActivity(intent_.getComponent().getClassName(), this_application.native_window, intent_);
Activity.nativeStartActivity(activity);
} catch (Exception e) {
e.printStackTrace();

View File

@@ -5,6 +5,8 @@ import android.os.Bundle;
import android.os.Parcelable;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Set;
public class Intent implements Parcelable {
public static final String ACTION_MAIN = "android.intent.action.MAIN";
@@ -350,4 +352,16 @@ public class Intent implements Parcelable {
public Intent setClassName(Context packageContext, String className) {
return this;
}
public String resolveTypeIfNeeded(ContentResolver resolver) {
return type;
}
public Set<String> getCategories() {
return Collections.emptySet();
}
public byte[] getByteArrayExtra(String name) {
return extras.getByteArray(name);
}
}

View File

@@ -4,6 +4,9 @@ import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import android.net.Uri;
import java.util.Iterator;
public class IntentFilter {
@@ -64,4 +67,12 @@ public class IntentFilter {
public final Iterator<String> actionsIterator() {
return actions.iterator();
}
public boolean hasAction(String action) {
return actions.contains(action);
}
public int match(String action, String type, String scheme, Uri data, Set<String> categories, String logTag) {
return -1/*NO_MATCH_TYPE*/;
}
}

View File

@@ -1814,10 +1814,10 @@ public class PackageManager {
// TODO: we shouldn't just automatically grant these once we have bubblewrap set up
// for now, the app can access anything it wants, so no point telling it otherwise
case "android.permission.WRITE_EXTERNAL_STORAGE":
return PERMISSION_GRANTED;
case "android.permission.READ_EXTERNAL_STORAGE":
return PERMISSION_GRANTED;
case "com.google.android.c2dm.permission.SEND":
case "com.fsck.k9.DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION":
case "net.thunderbird.android.DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION":
return PERMISSION_GRANTED;
default:
System.out.println("PackageManager.checkPermission: >" + permName + "< not handled\n");

View File

@@ -1,8 +1,11 @@
package android.content.pm;
import android.content.IntentFilter;
public class ResolveInfo {
public ActivityInfo activityInfo = new ActivityInfo();
public ServiceInfo serviceInfo = new ServiceInfo();
public IntentFilter filter = new IntentFilter();
public static class DisplayNameComparator {

View File

@@ -1466,6 +1466,10 @@ public class Resources {
theme = mAssets.createTheme();
}
public Resources getResources() {
return Resources.this;
}
private final AssetManager mAssets;
}