Skip to content

Commit 909db01

Browse files
upload source code
0 parents  commit 909db01

File tree

149 files changed

+9457
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

149 files changed

+9457
-0
lines changed

.gitignore

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Generated by MacOSX
2+
.DS_Store
3+
4+
# Generated by VIM
5+
.*.swp
6+
7+
# Generated by IntelliJ
8+
.idea/
9+
*.iml
10+
/*/*.iml
11+
/*/*/*.iml
12+
13+
# PluginDemo
14+
PluginDemo/.idea/
15+
PluginDemo/.gradle/
16+
PluginDemo/build/
17+
PluginDemo/*.iml
18+
PluginDemo/local.properties
19+
PluginDemo/host/
20+
21+
# Generated by Gradle
22+
.gradle
23+
build/
24+
gradle/
25+
gradlew
26+
gradlew.bat
27+
28+
# Generated by Eclipse
29+
.metadata
30+
.settings
31+
.project
32+
.classpath
33+
34+
# Files generated by Maven
35+
target/
36+
pom.xml.tag
37+
pom.xml.releaseBackup
38+
pom.xml.versionsBackup
39+
pom.xml.next
40+
release.properties
41+
dependency-reduced-pom.xml
42+
buildNumber.properties
43+
44+
local.properties

AndroidStub/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Android Framework Stub
2+
3+
该库主要是针对在 app 中无法直接调用 Android Framework 中很多隐藏的 API 而创造的一系列 stub 类用来欺骗编译器,从而避免了使用反射去调用造成性能损失

AndroidStub/build.gradle

+83
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
buildscript {
2+
System.properties['com.android.build.gradle.overrideVersionCheck'] = 'true'
3+
4+
repositories {
5+
mavenCentral()
6+
jcenter()
7+
}
8+
9+
dependencies {
10+
classpath 'com.android.tools.build:gradle:2.1.3'
11+
}
12+
}
13+
14+
allprojects {
15+
repositories {
16+
mavenCentral()
17+
jcenter()
18+
}
19+
}
20+
21+
group = 'com.didichuxing.foundation'
22+
version = '0.0.5'
23+
24+
apply plugin: 'com.android.library'
25+
26+
android {
27+
compileSdkVersion 23
28+
buildToolsVersion "23.0.3"
29+
30+
defaultConfig {
31+
minSdkVersion 15
32+
targetSdkVersion 15
33+
versionCode 1
34+
versionName "1.0"
35+
}
36+
buildTypes {
37+
release {
38+
minifyEnabled false
39+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
40+
}
41+
}
42+
43+
lintOptions {
44+
abortOnError false
45+
}
46+
}
47+
48+
android.libraryVariants.all { variant ->
49+
def jarTask = project.tasks.create("jar${variant.name.capitalize()}", Jar)
50+
jarTask.excludes = [
51+
'android/BuildConfig.class',
52+
'android/R.class'
53+
]
54+
jarTask.dependsOn variant.javaCompile
55+
jarTask.from variant.javaCompile.destinationDir
56+
artifacts.add('archives', jarTask)
57+
}
58+
59+
apply plugin: 'maven'
60+
61+
uploadArchives {
62+
repositories {
63+
mavenDeployer {
64+
pom.project {
65+
groupId project.group
66+
artifactId 'android-framework'
67+
version project.version
68+
description project.description ?: ''
69+
packaging 'jar'
70+
}
71+
repository(url: MAVEN_RELEASES_REPOSITORY_URL) {
72+
authentication(userName: MAVEN_USERNAME, password: MAVEN_PASSWORD)
73+
}
74+
snapshotRepository(url: MAVEN_SNAPSHOTS_REPOSITORY_URL) {
75+
authentication(userName: MAVEN_USERNAME, password: MAVEN_PASSWORD)
76+
}
77+
}
78+
}
79+
}
80+
81+
dependencies {
82+
compile 'com.android.support:support-annotations:22.2.0'
83+
}

AndroidStub/gradle.properties

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
MAVEN_RELEASES_REPOSITORY_URL=
2+
MAVEN_SNAPSHOTS_REPOSITORY_URL=
3+
MAVEN_USERNAME=test
4+
MAVEN_PASSWORD=test

AndroidStub/proguard-rules.pro

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Add project specific ProGuard rules here.
2+
# By default, the flags in this file are appended to flags specified
3+
# in /Users/johnson/Library/Android/sdk/tools/proguard/proguard-android.txt
4+
# You can edit the include path and order by changing the proguardFiles
5+
# directive in build.gradle.
6+
#
7+
# For more details, see
8+
# http://developer.android.com/guide/developing/tools/proguard.html
9+
10+
# Add any project specific keep options here:
11+
12+
# If your project uses WebView with JS, uncomment the following
13+
# and specify the fully qualified class name to the JavaScript interface
14+
# class:
15+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16+
# public *;
17+
#}
+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2+
package="android">
3+
4+
<application />
5+
6+
</manifest>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
package android.app;
2+
3+
import android.app.IApplicationThread;
4+
import android.app.IServiceConnection;
5+
import android.content.ComponentName;
6+
import android.content.Intent;
7+
import android.content.IIntentSender;
8+
import android.os.IBinder;
9+
import android.os.IInterface;
10+
11+
/**
12+
* @author johnsonlee
13+
*/
14+
interface IActivityManager {
15+
16+
ComponentName startService(in IApplicationThread caller, in Intent service, in String resolvedType, in String callingPackage, in int userId);
17+
18+
int stopService(in IApplicationThread caller, in Intent service, in String resolvedType, in int userId);
19+
20+
boolean stopServiceToken(in ComponentName className, in IBinder token, in int startId);
21+
22+
void setServiceForeground(in ComponentName className, in IBinder token, in int id, in Notification notification, in boolean keepNotification);
23+
24+
int bindService(in IApplicationThread caller, in IBinder token, in Intent service, in String resolvedType, in IServiceConnection connection, in int flags, in String callingPackage, in int userId);
25+
26+
boolean unbindService(in IServiceConnection connection);
27+
28+
void publishService(in IBinder token, in Intent intent, in IBinder service);
29+
30+
void unbindFinished(in IBinder token, in Intent service, in boolean doRebind);
31+
32+
IIntentSender getIntentSender(in int type, in String packageName, in IBinder token, in String resultWho, int requestCode, in Intent[] intents, in String[] resolvedTypes, in int flags, in Bundle options, in int userId);
33+
34+
void cancelIntentSender(in IIntentSender sender);
35+
36+
String getPackageForIntentSender(in IIntentSender sender);
37+
38+
int getUidForIntentSender(in IIntentSender sender);
39+
40+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package android.app;
2+
3+
interface IApplicationThread {
4+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
* Copyright 2007, The Android Open Source Project
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package android.app;
17+
import android.app.Notification;
18+
import android.content.ComponentName;
19+
import android.content.Intent;
20+
import android.net.Uri;
21+
import android.os.Bundle;
22+
23+
interface INotificationManager
24+
{
25+
void cancelAllNotifications(String pkg, int userId);
26+
void enqueueNotificationWithTag(String pkg, String opPkg, String tag, int id, in Notification notification, inout int[] idReceived, int userId);
27+
void cancelNotificationWithTag(String pkg, String tag, int id, int userId);
28+
void setNotificationsEnabledForPackage(String pkg, int uid, boolean enabled);
29+
boolean areNotificationsEnabledForPackage(String pkg, int uid);
30+
boolean areNotificationsEnabled(String pkg);
31+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/* //device/java/android/android/app/IServiceConnection.aidl
2+
**
3+
** Copyright 2007, The Android Open Source Project
4+
**
5+
** Licensed under the Apache License, Version 2.0 (the "License");
6+
** you may not use this file except in compliance with the License.
7+
** You may obtain a copy of the License at
8+
**
9+
** http://www.apache.org/licenses/LICENSE-2.0
10+
**
11+
** Unless required by applicable law or agreed to in writing, software
12+
** distributed under the License is distributed on an "AS IS" BASIS,
13+
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
** See the License for the specific language governing permissions and
15+
** limitations under the License.
16+
*/
17+
18+
package android.app;
19+
20+
import android.content.ComponentName;
21+
22+
/** @hide */
23+
oneway interface IServiceConnection {
24+
void connected(in ComponentName name, IBinder service);
25+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*
2+
* Copyright (C) 2006 The Android Open Source Project
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package android.content;
18+
19+
import android.content.Intent;
20+
import android.os.Bundle;
21+
22+
/**
23+
* System private API for dispatching intent broadcasts. This is given to the
24+
* activity manager as part of registering for an intent broadcasts, and is
25+
* called when it receives intents.
26+
*/
27+
oneway interface IIntentReceiver {
28+
void performReceive(in Intent intent, int resultCode, String data, in Bundle extras, boolean ordered, boolean sticky, int sendingUser);
29+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*
2+
* Copyright (C) 2006 The Android Open Source Project
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package android.content;
18+
19+
import android.content.IIntentReceiver;
20+
import android.content.Intent;
21+
import android.os.Bundle;
22+
23+
oneway interface IIntentSender {
24+
25+
void send(int code, in Intent intent, String resolvedType, IIntentReceiver finishedReceiver, String requiredPermission, in Bundle options);
26+
27+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package android.app;
2+
3+
import android.content.Intent;
4+
import android.os.Binder;
5+
import android.os.IBinder;
6+
7+
/**
8+
* @author johnsonlee
9+
*/
10+
public abstract class ActivityManagerNative extends Binder implements IActivityManager {
11+
12+
public static IActivityManager getDefault() {
13+
throw new RuntimeException("Stub!");
14+
}
15+
16+
public static boolean isSystemReady() {
17+
throw new RuntimeException("Stub!");
18+
}
19+
20+
public static void broadcastStickyIntent(final Intent intent, final String permission, final int userId) {
21+
throw new RuntimeException("Stub!");
22+
}
23+
24+
static public IActivityManager asInterface(IBinder obj) {
25+
throw new RuntimeException("Stub!");
26+
}
27+
28+
public ActivityManagerNative() {
29+
throw new RuntimeException("Stub!");
30+
}
31+
}

0 commit comments

Comments
 (0)