-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
1,776 additions
and
1,405 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
v1.2.7 | ||
增加视频下载自定义编码格式 | ||
恢复“分享->复制链接”,需手动开启功能 | ||
|
||
v1.2.6 | ||
增加下载弹窗文案复制选项 | ||
增加视频右侧控件自定义隐藏 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
core/src/main/java/io/github/fplus/core/hook/HDetailActivity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
package io.github.fplus.core.hook | ||
|
||
import android.app.Activity | ||
import com.freegang.ktutils.log.KLogCat | ||
import com.ss.android.ugc.aweme.detail.ui.DetailActivity | ||
import de.robv.android.xposed.XC_MethodHook | ||
import io.github.fplus.core.base.BaseHook | ||
import io.github.fplus.core.config.ConfigV1 | ||
import io.github.fplus.core.hook.logic.ClipboardLogic | ||
import io.github.fplus.core.hook.logic.DownloadLogic | ||
import io.github.xpler.core.entity.OnAfter | ||
import io.github.xpler.core.entity.OnBefore | ||
import io.github.xpler.core.hookBlockRunning | ||
import io.github.xpler.core.thisActivity | ||
|
||
class HDetailActivity : BaseHook<DetailActivity>() { | ||
companion object { | ||
const val TAG = "HDetailActivity" | ||
} | ||
|
||
private val config get() = ConfigV1.get() | ||
|
||
private val clipboardLogic = ClipboardLogic(this) | ||
|
||
@OnAfter("onResume") | ||
fun onResumeAfter(params: XC_MethodHook.MethodHookParam) { | ||
hookBlockRunning(params) { | ||
addClipboardListener(thisActivity as DetailActivity) | ||
}.onFailure { | ||
KLogCat.tagE(TAG, it) | ||
} | ||
} | ||
|
||
@OnBefore("onPause") | ||
fun onPauseBefore(params: XC_MethodHook.MethodHookParam) { | ||
hookBlockRunning(params) { | ||
removeClipboardListener(thisActivity) | ||
}.onFailure { | ||
KLogCat.tagE(TAG, it) | ||
} | ||
} | ||
|
||
private fun addClipboardListener(activity: Activity) { | ||
if (!config.isDownload) return | ||
if (!config.isCopyDownload) return | ||
|
||
clipboardLogic.addClipboardListener(activity) { clipData, firstText -> | ||
DownloadLogic( | ||
this@HDetailActivity, | ||
activity, | ||
HVideoViewHolder.aweme, | ||
) | ||
} | ||
} | ||
|
||
private fun removeClipboardListener(activity: Activity) { | ||
clipboardLogic.removeClipboardListener(activity) | ||
} | ||
} |
Oops, something went wrong.