Skip to content
This repository has been archived by the owner on Oct 14, 2024. It is now read-only.

Commit

Permalink
修复部分已知问题
Browse files Browse the repository at this point in the history
  • Loading branch information
GangJust committed Jul 7, 2023
1 parent 092d415 commit 4b537eb
Show file tree
Hide file tree
Showing 24 changed files with 390 additions and 342 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ android {
applicationId "com.freegang.fplus"
minSdk 24
targetSdk 33
versionCode 34
versionName "1.1.4"
versionCode 35
versionName "1.1.5"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
Expand Down
6 changes: 6 additions & 0 deletions app/src/main/assets/update.log
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
v1.1.5
修复下载对话框不关闭
修复下载通知栏在UI线程下造成视频卡顿
修复部分机型开启清爽模式后长按弹窗不响应
修复部分其它已知问题

v1.1.4
增加禁用双击点赞
调整清爽模式逻辑
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/assets/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.1.4-34
1.1.5-35
56 changes: 34 additions & 22 deletions app/src/main/java/com/freegang/fplus/activity/DoHomeActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ class DoHomeActivity : ComponentActivity() {
)
Spacer(modifier = Modifier.padding(vertical = 2.dp))
Text(
text = "Integrated ${lspatchActive[0]} - ${lspatchActive[1]}",
text = "${lspatchActive[0]} ${lspatchActive[1]} - ${lspatchActive[2]}",
style = Themes.nowTypography.body2,
)
} else if (HookStatus.isExpModuleActive(this@DoHomeActivity)) {
Expand Down Expand Up @@ -449,8 +449,8 @@ class DoHomeActivity : ComponentActivity() {
)
}

//tg交流群
/*FCard(
//tg频道
FCard(
modifier = Modifier
.padding(vertical = 4.dp)
.clickable(
Expand All @@ -467,24 +467,24 @@ class DoHomeActivity : ComponentActivity() {
content = {
Icon(
painter = painterResource(id = R.drawable.ic_telegram),
contentDescription = "tg交流群",
contentDescription = "Telegram频道",
tint = Themes.nowColors.icon,
modifier = Modifier.size(24.dp)
)
Spacer(modifier = Modifier.padding(horizontal = 8.dp))
Column {
Text(
text = "tg交流群",
text = "Telegram频道",
style = Themes.nowTypography.body1,
)
Text(
text = "闲聊吹水,Bug反馈~",
text = "版本发布, Bug反馈~",
style = Themes.nowTypography.overline,
)
}
},
)
}*/
}

//打赏
/*FCard(
Expand Down Expand Up @@ -554,12 +554,21 @@ class DoHomeActivity : ComponentActivity() {
}

private fun toBrowse() {
startActivity(
Intent(
Intent.ACTION_VIEW,
Uri.parse("https://github.com/GangJust/FreedomPlus"),
try {
startActivity(
Intent(
Intent.ACTION_VIEW,
Uri.parse("https://github.com/GangJust/FreedomPlus"),
)
)
)
return
} catch (_: Exception) {

}

val manager = getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
manager.setPrimaryClip(ClipData.newPlainText("github link", "https://github.com/GangJust/FreedomPlus"))
showToast("未安装浏览器,链接已复制!")
}

private fun toEmail() {
Expand All @@ -570,24 +579,28 @@ class DoHomeActivity : ComponentActivity() {
Uri.parse("mailto:freegang555@gmail.com"),
)
)
} catch (e: Exception) {
val manager = getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
manager.setPrimaryClip(ClipData.newPlainText("feedback email", "freegang555@gmail.com"))
Toast.makeText(applicationContext, "未安装邮箱类App,邮箱已复制!", Toast.LENGTH_SHORT).show()
return
} catch (_: Exception) {
}

val manager = getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
manager.setPrimaryClip(ClipData.newPlainText("feedback email", "freegang555@gmail.com"))
Toast.makeText(applicationContext, "未安装邮箱类App,邮箱已复制!", Toast.LENGTH_SHORT).show()
}

private fun joinTgGroup() {
val uri = Uri.parse("tg群链接")
val uri = Uri.parse("https://t.me/FreedomPlugin")
try {
val telegramIntent = Intent(Intent.ACTION_VIEW, uri)
telegramIntent.setPackage("org.telegram.messenger")
startActivity(telegramIntent)
return
} catch (e: Exception) {
//e.printStackTrace()
} catch (_: Exception) {
}
showToast("未安装telegram")

val manager = getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
manager.setPrimaryClip(ClipData.newPlainText("telegram link", "https://t.me/FreedomPlugin"))
showToast("未安装telegram,链接已复制!")
}

private fun rewardByAlipay() {
Expand All @@ -599,8 +612,7 @@ class DoHomeActivity : ComponentActivity() {
)
)
return
} catch (e: Exception) {
//e.printStackTrace()
} catch (_: Exception) {
}
showToast("谢谢,你没有安装支付宝客户端")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,12 @@ class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
FreedomTheme(window = window) {
FreedomTheme(
window = window,
isImmersive = true,
isDark = false,
followSystem = false,
) {
FMessageDialog(
title = "Freedom+需要以下权限才能正常运行",
cancel = "取消",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.com.ss.android.ugc.common.component.fragment.ComponentFragment;
import com.ss.android.ugc.common.component.fragment.ComponentFragment;

public class AmeBaseFragment extends ComponentFragment {
@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package com.ss.android.ugc.aweme.familiar.feed.pinch.ui;

import android.content.Context;
import android.util.AttributeSet;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.widget.AppCompatImageView;

public class PinchPlayPauseView extends AppCompatImageView {
public PinchPlayPauseView(@NonNull Context context) {
super(context);
throw new RuntimeException("sub!");
}

public PinchPlayPauseView(@NonNull Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
throw new RuntimeException("sub!");
}

public PinchPlayPauseView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
throw new RuntimeException("sub!");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.ss.android.ugc.aweme.familiar.feed.pinch.ui;

import android.content.Context;
import android.util.AttributeSet;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.widget.AppCompatImageView;

public class PinchSpeedView extends AppCompatImageView {
public PinchSpeedView(@NonNull Context context) {
super(context);
throw new RuntimeException("sub!");
}

public PinchSpeedView(@NonNull Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
throw new RuntimeException("sub!");
}

public PinchSpeedView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
throw new RuntimeException("sub!");
}
}

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,21 @@
import com.ss.android.ugc.aweme.base.model.UrlModel;

public class VideoUrlModel extends UrlModel {
public float aspectRatio;
public String bitrateFormat;
public long cdnUrlExpired;
public int codecType;
public long createTime;
public double duration;
public Boolean hasDashBitrate;
public String mDashVideoId;
public String mDashVideoModelString;
public boolean mVr;
public String meta;
public String ratio;
public String ratioUri;
public String sourceId;

public VideoUrlModel() {
throw new RuntimeException("sub!");
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.com.ss.android.ugc.common.component.fragment;
package com.ss.android.ugc.common.component.fragment;

import com.bytedance.ies.uikit.base.AbsFragment;

Expand Down
1 change: 1 addition & 0 deletions core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,5 @@ dependencies {
implementation project(":ktutils")
implementation 'org.luckypray:DexKit:1.1.8'
implementation 'com.tencent:mmkv:1.3.0'
//implementation 'com.squareup.okhttp3:okhttp:4.8.0'
}
29 changes: 12 additions & 17 deletions core/src/main/java/com/freegang/douyin/HCommonPageFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ import android.widget.TextView
import com.freegang.base.BaseHook
import com.freegang.config.ConfigV1
import com.freegang.douyin.logic.SaveCommentLogic
import com.freegang.ktutils.display.KDisplayUtils
import com.freegang.ktutils.view.KViewUtils
import com.freegang.ktutils.view.traverse
import com.freegang.ktutils.view.findViewsByExact
import com.freegang.xpler.R
import com.freegang.xpler.core.KtXposedHelpers
import com.freegang.xpler.core.NoneHook
Expand All @@ -32,12 +33,11 @@ class HCommonPageFragment(lpparam: XC_LoadPackage.LoadPackageParam) : BaseHook<A
fun onViewCreatedAfter(param: XC_MethodHook.MethodHookParam, view: View, bundle: Bundle?) {
hookBlock(param) {
if (!config.isEmoji) return
rebuildTopBarView(thisObject, view as ViewGroup)
rebuildOtherView(view)
rebuildTopBarView(thisObject, view)
}
}

private fun rebuildTopBarView(thisObject: Any, view: ViewGroup) {
private fun rebuildTopBarView(thisObject: Any, view: View) {
launch {
delay(200L)

Expand All @@ -47,10 +47,9 @@ class HCommonPageFragment(lpparam: XC_LoadPackage.LoadPackageParam) : BaseHook<A
// awemeType 【134:评论区图片, 133|136:评论区视频, 0:主页视频详情, 68:主页图文详情, 13:私信视频/图文, 6000:私信图片】 by 25.1.0 至今
if (aweme.awemeType != 134 && aweme.awemeType != 133 && aweme.awemeType != 136) return@launch


val views = KViewUtils.findViewsByDesc(view, ImageView::class.java, "返回")
if (views.isEmpty()) return@launch
val backBtn = views.first()
val imageViews = KViewUtils.findViewsByDesc(view, ImageView::class.java, "返回")
if (imageViews.isEmpty()) return@launch
val backBtn = imageViews.first()

//清空旧视图
val viewGroup = backBtn.parent as ViewGroup
Expand All @@ -67,17 +66,13 @@ class HCommonPageFragment(lpparam: XC_LoadPackage.LoadPackageParam) : BaseHook<A
SaveCommentLogic(this@HCommonPageFragment, it.context, aweme)
}
viewGroup.addView(appbar)
}
}

private fun rebuildOtherView(view: ViewGroup) {
launch {
delay(200L)
view.traverse {
if (it is TextView && it.text.contains("我也发一张")) {
KViewUtils.hideAll(it.parent as ViewGroup)
}
//我也发一张
val textViews = view.findViewsByExact(TextView::class.java) {
"${it.text}".contains("我也发一张") || "${it.contentDescription}".contains("我也发一张")
}
if (textViews.isEmpty()) return@launch
binding.rightSpace.setPadding(0, 0, KDisplayUtils.dip2px(view.context, 128f), 0)
}
}
}
7 changes: 4 additions & 3 deletions core/src/main/java/com/freegang/douyin/HMainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class HMainActivity(lpparam: XC_LoadPackage.LoadPackageParam) : BaseHook<MainAct
"24.5.0", "24.6.0", "24.7.0", "24.8.0", "24.9.0",
"25.0.0", "25.1.0", "25.2.0", "25.3.0", "25.4.0",
"25.5.0", "25.6.0", "25.7.0", "25.8.0", "25.9.0",
"25.6.0",
"26.0.0",
)

@OnAfter("onCreate")
Expand Down Expand Up @@ -119,8 +119,9 @@ class HMainActivity(lpparam: XC_LoadPackage.LoadPackageParam) : BaseHook<MainAct
delay(500L)
val clazz = findClass("com.ss.android.ugc.aweme.homepage.ui.TopLeftFrameLayout") as Class<ViewGroup>
val view = KViewUtils.findViews(activity.contentView, clazz).firstOrNull() ?: return@launch
val firstOrNull =
view.children.firstOrNull() ?: view.findViewsByDesc(View::class.java, "侧边栏").firstOrNull() ?: return@launch
val firstOrNull = view.children.firstOrNull()
?: view.findViewsByDesc(View::class.java, "侧边栏").firstOrNull()
?: return@launch
val onClickListener = KViewUtils.getOnClickListener(firstOrNull)
firstOrNull.setOnClickListener {
onClickListener?.onClick(it)
Expand Down
Loading

0 comments on commit 4b537eb

Please sign in to comment.