Skip to content

Commit

Permalink
update frp to v0.39.1
Browse files Browse the repository at this point in the history
  • Loading branch information
mainfunx committed Feb 19, 2022
1 parent 4e2bd19 commit dd08d19
Show file tree
Hide file tree
Showing 34 changed files with 791 additions and 672 deletions.
1 change: 1 addition & 0 deletions .idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 19 additions & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 0 additions & 12 deletions .idea/runConfigurations.xml

This file was deleted.

1 change: 1 addition & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
### [frp](https://github.com/fatedier/frp) 是一个专注于内网穿透的高性能的反向代理应用,支持 TCP、UDP、HTTP、HTTPS 等多种协议。可以将内网服务以安全、便捷的方式通过具有公网 IP 节点的中转暴露到公网。

### 当前frp版本号0.35.1
### 当前frp版本号0.39.1

### [编译方法](https://github.com/FrpcCluster/frpc-Android/blob/master/Compile_zh.md)

### NDK version: 20.0.5594570

### [下载地址](https://www.pgyer.com/afrp)



24 changes: 15 additions & 9 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 29
buildToolsVersion "29.0.3"
compileSdkVersion 31

defaultConfig {
applicationId "com.car.frpc_android"
minSdkVersion 19
targetSdkVersion 29
versionCode 3
versionName "0.35.1.1"
targetSdkVersion 31
versionCode 4
versionName "0.39.1.1"
multiDexEnabled true

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand All @@ -22,8 +22,7 @@ android {
android.applicationVariants.all {
variant ->
variant.outputs.all {
def project = "${variant.applicationId}".split("\\.")[1]
outputFileName = "${project}-v${variant.versionName}.apk"
outputFileName = "frpc_adnroid-v${variant.versionName}.apk"
}
}

Expand Down Expand Up @@ -66,13 +65,20 @@ dependencies {
implementation 'com.squareup.retrofit2:adapter-rxjava2:2.6.2'
implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
implementation 'io.reactivex.rxjava2:rxjava:2.1.16'
implementation 'com.github.tbruyelle:rxpermissions:0.10.2'

implementation 'com.github.ahmadaghazadeh:CodeEditor:1.0.17'
implementation 'com.afollestad.material-dialogs:core:0.9.6.0'
implementation 'org.jetbrains:annotations:15.0'
implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:3.0.4'
implementation 'com.github.clans:fab:1.6.4'
implementation 'io.github.jeremyliao:live-event-bus-x:1.8.0'
implementation 'com.google.android.material:material:1.5.0'
implementation "androidx.multidex:multidex:2.0.1"

def room_version = "2.4.1"

implementation "androidx.room:room-runtime:$room_version"
annotationProcessor "androidx.room:room-compiler:$room_version"
implementation "androidx.room:room-rxjava2:$room_version"


}
Binary file modified app/libs/frpclib-sources.jar
Binary file not shown.
Binary file modified app/libs/frpclib.aar
Binary file not shown.
22 changes: 8 additions & 14 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@
package="com.car.frpc_android">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_LOGS" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />

<application
<application android:name="androidx.multidex.MultiDexApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
Expand All @@ -20,16 +18,15 @@
android:usesCleartextTraffic="true">
<activity
android:name=".ui.LogcatActivity"
android:label="@string/title_activity_main"
android:process="com.car.frpc_android.FrpcView" />
android:label="@string/title_activity_main" />
<activity
android:name=".ui.IniEditActivity"
android:label="@string/title_activity_main"
android:process="com.car.frpc_android.FrpcView" />
android:label="@string/title_activity_main" />
<activity
android:name=".ui.MainActivity"
android:launchMode="singleTop"
android:exported="true"
android:label="@string/title_activity_main"
android:process="com.car.frpc_android.FrpcView"
android:theme="@style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand All @@ -38,13 +35,10 @@
</intent-filter>
</activity>
<activity
android:label="@string/title_activity_main"
android:name=".ui.TemplateActivity"
android:process="com.car.frpc_android.FrpcView" />
android:label="@string/title_activity_main" />

<service
android:name=".FrpcService"
android:process="com.car.frpc_android.FrpcService" />
<service android:name=".FrpcService" />
</application>

</manifest>
56 changes: 56 additions & 0 deletions app/src/main/java/com/car/frpc_android/CommonUtils.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
package com.car.frpc_android;

import android.app.ActivityManager;
import android.content.Context;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.List;
import java.util.concurrent.TimeUnit;

import frpclib.Frpclib;
import io.reactivex.Completable;
import io.reactivex.Observable;
import io.reactivex.functions.Function;
import io.reactivex.functions.Predicate;

public class CommonUtils {


public static Completable waitService(String serviceName, Context context) {
return Completable.fromObservable(Observable.interval(0, 1, TimeUnit.SECONDS)
.takeUntil(aLong -> {
return isServiceRunning(serviceName, context);
})
);
}

public static boolean isServiceRunning(String serviceName, Context context) {
ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
List<ActivityManager.RunningServiceInfo> runningServices = am.getRunningServices(Integer.MAX_VALUE); //获取运行的服务,参数表示最多返回的数量
for (ActivityManager.RunningServiceInfo runningServiceInfo : runningServices) {
String className = runningServiceInfo.service.getClassName();
if (className.equals(serviceName)) {
return true;
}
}
return false;
}

public static Observable<String> getStringFromRaw(Context context, int rawName) {
return Observable.create(emitter -> {
BufferedReader reader = new BufferedReader(new InputStreamReader(context.getResources().openRawResource(rawName)));
String line;
StringBuilder result = new StringBuilder();
while ((line = reader.readLine()) != null) {
result.append(line).append("\n");
}
reader.close();
emitter.onNext(result.toString());
emitter.onComplete();
});

}


}
96 changes: 0 additions & 96 deletions app/src/main/java/com/car/frpc_android/Constants.java

This file was deleted.

Loading

0 comments on commit dd08d19

Please sign in to comment.