You've already forked android_translation_layer
mirror of
https://gitlab.com/android_translation_layer/android_translation_layer.git
synced 2025-10-27 11:48:10 -07:00
stub some APIs for Flappy Bird, mostly webview related
This commit is contained in:
@@ -8,6 +8,7 @@ import android.os.Bundle;
|
||||
|
||||
import android.widget.TextView;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
@@ -169,6 +170,10 @@ public class Activity extends Context {
|
||||
});*/
|
||||
}
|
||||
|
||||
public void setContentView(View view, ViewGroup.LayoutParams layoutParams) {
|
||||
setContentView(view);
|
||||
}
|
||||
|
||||
public void setContentView(View view) {
|
||||
window.setContentView(view);
|
||||
}
|
||||
|
||||
@@ -1383,8 +1383,12 @@ public class PackageManager {
|
||||
* @see #GET_UNINSTALLED_PACKAGES
|
||||
*/
|
||||
public PackageInfo getPackageInfo(String packageName, int flags) throws NameNotFoundException {
|
||||
return new PackageInfo();
|
||||
}
|
||||
PackageInfo packageInfo = new PackageInfo();
|
||||
if ((flags & GET_SIGNATURES) == GET_SIGNATURES) {
|
||||
packageInfo.signatures = new Signature[0];
|
||||
}
|
||||
return packageInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Map from the current package names in use on the device to whatever
|
||||
|
||||
27
src/api-impl/android/gesture/GestureOverlayView.java
Normal file
27
src/api-impl/android/gesture/GestureOverlayView.java
Normal file
@@ -0,0 +1,27 @@
|
||||
package android.gesture;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
public class GestureOverlayView extends ViewGroup {
|
||||
|
||||
public GestureOverlayView(Context context) {
|
||||
}
|
||||
|
||||
public void setGestureStrokeType(int type) {
|
||||
}
|
||||
|
||||
public void setEventsInterceptionEnabled(boolean enabled) {
|
||||
}
|
||||
|
||||
public void setGestureVisible(boolean enabled) {
|
||||
}
|
||||
|
||||
public void addOnGesturePerformedListener(OnGesturePerformedListener listener) {
|
||||
}
|
||||
|
||||
public interface OnGesturePerformedListener {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
10
src/api-impl/android/gesture/GestureStore.java
Normal file
10
src/api-impl/android/gesture/GestureStore.java
Normal file
@@ -0,0 +1,10 @@
|
||||
package android.gesture;
|
||||
|
||||
import java.io.InputStream;
|
||||
|
||||
public class GestureStore {
|
||||
|
||||
public void load(InputStream inputStream) {
|
||||
}
|
||||
|
||||
}
|
||||
@@ -119,7 +119,7 @@ public final class Trace {
|
||||
* synchronized, and sEnabledTags is volatile (prevents word tearing).
|
||||
*/
|
||||
private static long cacheEnabledTags() {
|
||||
long tags = nativeGetEnabledTags();
|
||||
long tags = 0;
|
||||
sEnabledTags = tags;
|
||||
return tags;
|
||||
}
|
||||
|
||||
@@ -1621,7 +1621,9 @@ public final class MotionEvent extends InputEvent {
|
||||
}
|
||||
|
||||
MotionEvent ev = obtain();
|
||||
ev.mNativePtr = nativeCopy(ev.mNativePtr, other.mNativePtr, true /*keepHistory*/);
|
||||
ev.action = other.action;
|
||||
ev.coord_x = other.coord_x;
|
||||
ev.coord_y = other.coord_y;
|
||||
return ev;
|
||||
}
|
||||
|
||||
|
||||
@@ -872,4 +872,7 @@ public class View extends Object {
|
||||
public Context getContext() {
|
||||
return this.context;
|
||||
}
|
||||
|
||||
public void refreshDrawableState() {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,6 +66,16 @@ public class ViewGroup extends View implements ViewParent, ViewManager {
|
||||
// TODO: actually implement this (might make sense to implement it in the subclasses instead), when applicable
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number of children in the group.
|
||||
*
|
||||
* @return a positive integer representing the number of children in
|
||||
* the group
|
||||
*/
|
||||
public int getChildCount() {
|
||||
return children.size();
|
||||
}
|
||||
|
||||
public static class LayoutParams {
|
||||
public static final int FILL_PARENT = -1;
|
||||
public static final int MATCH_PARENT = -1;
|
||||
@@ -98,4 +108,19 @@ public class ViewGroup extends View implements ViewParent, ViewManager {
|
||||
*/
|
||||
// public LayoutAnimationController.AnimationParameters layoutAnimationParameters;
|
||||
}
|
||||
|
||||
public static class MarginLayoutParams extends ViewGroup.LayoutParams{
|
||||
|
||||
public MarginLayoutParams() {
|
||||
super();
|
||||
}
|
||||
|
||||
public MarginLayoutParams(int width, int height) {
|
||||
super(width, height);
|
||||
}
|
||||
|
||||
public MarginLayoutParams(int width, int height, float weight) {
|
||||
super(width, height, weight);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,4 +39,8 @@ public class Window {
|
||||
public void takeInputQueue(InputQueue.Callback callback) {
|
||||
take_input_queue(native_window, callback, new InputQueue());
|
||||
}
|
||||
|
||||
public boolean requestFeature(int featureId) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
29
src/api-impl/android/webkit/DownloadListener.java
Normal file
29
src/api-impl/android/webkit/DownloadListener.java
Normal file
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Copyright (C) 2007 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package android.webkit;
|
||||
public interface DownloadListener {
|
||||
/**
|
||||
* Notify the host application that a file should be downloaded
|
||||
* @param url The full url to the content that should be downloaded
|
||||
* @param userAgent the user agent to be used for the download.
|
||||
* @param contentDisposition Content-disposition http header, if
|
||||
* present.
|
||||
* @param mimetype The mimetype of the content reported by the server
|
||||
* @param contentLength The file size reported by the server
|
||||
*/
|
||||
public void onDownloadStart(String url, String userAgent,
|
||||
String contentDisposition, String mimetype, long contentLength);
|
||||
}
|
||||
@@ -4,4 +4,16 @@ public class WebSettings {
|
||||
public String getUserAgentString() {
|
||||
return "FUCK YOU";
|
||||
}
|
||||
|
||||
public void setUserAgentString(String userAgentString) {
|
||||
}
|
||||
|
||||
public void setSupportMultipleWindows(boolean supportMultipleWindows) {
|
||||
}
|
||||
|
||||
public void setJavaScriptEnabled(boolean javaScriptEnabled) {
|
||||
}
|
||||
|
||||
public void setSavePassword(boolean savePassword) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,24 @@
|
||||
package android.webkit;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.View;
|
||||
|
||||
// the only reason we need to implement this is that some app developers are such scumbags that they try to use this for tracking purposes
|
||||
public class WebView {
|
||||
public class WebView extends View {
|
||||
public WebView (Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
public WebSettings getSettings() {
|
||||
return new WebSettings();
|
||||
}
|
||||
|
||||
public void setDownloadListener(DownloadListener downloadListener) {
|
||||
}
|
||||
|
||||
public void setScrollBarStyle(int scrollBarStyle) {
|
||||
}
|
||||
|
||||
public void setWebViewClient(WebViewClient webViewClient) {
|
||||
}
|
||||
}
|
||||
|
||||
4
src/api-impl/android/webkit/WebViewClient.java
Normal file
4
src/api-impl/android/webkit/WebViewClient.java
Normal file
@@ -0,0 +1,4 @@
|
||||
package android.webkit;
|
||||
|
||||
public class WebViewClient {
|
||||
}
|
||||
@@ -31,7 +31,7 @@ public class FrameLayout extends ViewGroup {
|
||||
addView(child, index, null);
|
||||
}
|
||||
|
||||
public static class LayoutParams extends ViewGroup.LayoutParams {
|
||||
public static class LayoutParams extends ViewGroup.MarginLayoutParams {
|
||||
public LayoutParams(int width, int height) {
|
||||
super(width, height);
|
||||
}
|
||||
|
||||
@@ -38,6 +38,10 @@ public class RelativeLayout extends ViewGroup {
|
||||
super(width, height, weight);
|
||||
}
|
||||
|
||||
public LayoutParams(ViewGroup.MarginLayoutParams source) {
|
||||
super(source.width, source.height, source.weight);
|
||||
}
|
||||
|
||||
public void addRule(int verb) {}
|
||||
public void addRule(int verb, int anchor) {}
|
||||
}
|
||||
|
||||
@@ -76,6 +76,8 @@ hax_jar = jar('hax', [
|
||||
'android/database/sqlite/SQLiteOpenHelper.java',
|
||||
'android/database/sqlite/SQLiteProgram.java',
|
||||
'android/database/sqlite/SQLiteQuery.java',
|
||||
'android/gesture/GestureOverlayView.java',
|
||||
'android/gesture/GestureStore.java',
|
||||
'android/graphics/BitmapFactory.java',
|
||||
'android/graphics/Bitmap.java',
|
||||
'android/graphics/Canvas.java',
|
||||
@@ -204,8 +206,10 @@ hax_jar = jar('hax', [
|
||||
'android/view/Window.java',
|
||||
'android/view/WindowManagerImpl.java',
|
||||
'android/view/WindowManager.java',
|
||||
'android/webkit/DownloadListener.java',
|
||||
'android/webkit/WebSettings.java',
|
||||
'android/webkit/WebView.java',
|
||||
'android/webkit/WebViewClient.java',
|
||||
'android/widget/EditText.java',
|
||||
'android/widget/FrameLayout.java',
|
||||
'android/widget/ImageView.java',
|
||||
|
||||
Reference in New Issue
Block a user