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

Commit

Permalink
fix #339
Browse files Browse the repository at this point in the history
  • Loading branch information
fuqiuluo committed Jul 16, 2024
1 parent 65ddca2 commit e2f27cb
Show file tree
Hide file tree
Showing 73 changed files with 1,433 additions and 1,523 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ android {
minSdk = 27
targetSdk = 34
versionCode = getVersionCode()
versionName = "1.0.9" + ".r${getGitCommitCount()}." + getVersionName()
versionName = "1.1.1.onebot" + ".r${getGitCommitCount()}." + getVersionName()

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/cpp/shamrock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@

extern "C"
JNIEXPORT jstring JNICALL
Java_moe_fuqiuluo_shamrock_xposed_hooks_PullConfig_testNativeLibrary(JNIEnv *env, jobject thiz) {
Java_moe_fuqiuluo_shamrock_xposed_hooks_PullConfig_00024Companion_testNativeLibrary(JNIEnv *env,
jobject thiz) {
return env->NewStringUTF("加载Shamrock库成功~");
}

Expand Down
15 changes: 12 additions & 3 deletions app/src/main/java/moe/fuqiuluo/shamrock/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.shadow
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.painter.Painter
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.LocalView
import androidx.compose.ui.res.painterResource
Expand All @@ -64,6 +63,7 @@ import androidx.compose.ui.unit.sp
import androidx.core.view.WindowCompat
import com.google.accompanist.systemuicontroller.rememberSystemUiController
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import moe.fuqiuluo.shamrock.ui.app.AppRuntime
import moe.fuqiuluo.shamrock.ui.app.Logger
Expand All @@ -79,14 +79,23 @@ import moe.fuqiuluo.shamrock.ui.theme.RANDOM_SUB_TITLE
import moe.fuqiuluo.shamrock.ui.theme.RANDOM_TITLE
import moe.fuqiuluo.shamrock.ui.theme.ShamrockTheme
import moe.fuqiuluo.shamrock.ui.tools.NoIndication
import moe.fuqiuluo.shamrock.ui.tools.ShamrockTab
import moe.fuqiuluo.shamrock.ui.tools.ShamrockTabV2
import moe.fuqiuluo.shamrock.ui.tools.getShamrockVersion

class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

setContent {
LaunchedEffect(Unit) {
while (true) {
delay(5_000) // Delay in milliseconds
broadcastToModule {
putExtra("__cmd", "switch_status")
}
}
}

CompositionLocalProvider(
LocalIndication provides NoIndication
) {
Expand Down Expand Up @@ -336,7 +345,7 @@ private fun AnimatedTab(
}
}

ShamrockTab(
ShamrockTabV2(
selected = curSelected,
onClick = {
scope.launch {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ abstract class ModuleHandler {
}
}
putExtra("__hash", callbackId)
putExtra("__cmd", cmd)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class MultifunctionalProvider: ContentProvider() {

inline fun Context.broadcastToModule(intentBuilder: Intent.() -> Unit) {
val intent = Intent()
intent.action = "moe.fuqiuluo.xqbot.dynamic"
intent.action = "moe.fuqiuluo.onebot.dynamic"
intent.intentBuilder()
sendBroadcast(intent)
}
10 changes: 5 additions & 5 deletions app/src/main/java/moe/fuqiuluo/shamrock/ui/tools/tabs.kt
Original file line number Diff line number Diff line change
Expand Up @@ -242,13 +242,13 @@ private fun Placeable.PlacementScope.placeTextAndIcon(
}

@Composable
fun ShamrockTab(
fun ShamrockTabV2(
selected: Boolean,
onClick: () -> Unit,
modifier: Modifier = Modifier,
enabled: Boolean = true,
text: @Composable (() -> Unit)? = null,
icon: @Composable (() -> Unit)? = null,
text: (@Composable (() -> Unit))? = null,
icon: (@Composable (() -> Unit))? = null,
selectedContentColor: Color = GlobalColor.TabSelected,
unselectedContentColor: Color = selectedContentColor,
indication: Indication? = rememberRipple(bounded = true, color = selectedContentColor),
Expand All @@ -262,7 +262,7 @@ fun ShamrockTab(
ProvideTextStyle(style, content = text)
}
}
ShamrockTab(
ShamrockTabV2(
selected,
onClick,
modifier,
Expand All @@ -277,7 +277,7 @@ fun ShamrockTab(
}

@Composable
fun ShamrockTab(
fun ShamrockTabV2(
selected: Boolean,
onClick: () -> Unit,
modifier: Modifier = Modifier,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ data class DeleteReq(

@Serializable
data class DownloadRkeyReq(
@ProtoNumber(1) val types: List<Int>
@ProtoNumber(1) val types: List<Int>,
@ProtoNumber(2) val downloadType: Int
)

@Serializable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ data class DownloadRkeyRsp(

@Serializable
data class RKeyInfo(
@ProtoNumber(1) val rkey: String?,
@ProtoNumber(1) val rkey: String,
@ProtoNumber(2) val rkeyTtlSec: ULong?,
@ProtoNumber(3) val storeId: UInt = 0u,
@ProtoNumber(4) val rkeyCreateTime: UInt?,
@ProtoNumber(4) val type: UInt?,
@ProtoNumber(4) val type: UInt,
)

@Serializable
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
package com.tencent.mobileqq.data.troop;

import org.jetbrains.annotations.NotNull;

public class TroopMemberNickInfo {
@NotNull
public final String getAutoRemark() {
return null;
}

@NotNull
public final String getColorNick() {
return null;
}

public final int getColorNickId() {
return 0;
}

@NotNull
public final String getFriendNick() {
return null;
}

@NotNull
public final String getHBShowName() {
return null;
}

@NotNull
public final String getRemarkFromFriend() {
return null;
}

@NotNull
public final String getRemarkFromFriendV2() {
return null;
}

@NotNull
public final String getShowName() {
return null;
}

@NotNull
public final String getTroopNick() {
return null;
}

@NotNull
public final String getTroopUin() {
return null;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.tencent.mobileqq.msf.sdk;

import com.tencent.qphone.base.remote.FromServiceMsg;
import com.tencent.qphone.base.remote.ToServiceMsg;

public class MsfMessagePair {
public FromServiceMsg fromServiceMsg;
public String sendProcess;
public ToServiceMsg toServiceMsg;

public MsfMessagePair(String str, ToServiceMsg toServiceMsg, FromServiceMsg fromServiceMsg) {

}

public MsfMessagePair(ToServiceMsg toServiceMsg, FromServiceMsg fromServiceMsg) {

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
package com.tencent.qqnt.troopmemberlist;

import androidx.lifecycle.LifecycleOwner;

import com.tencent.mobileqq.data.troop.TroopMemberInfo;
import com.tencent.mobileqq.data.troop.TroopMemberNickInfo;
import com.tencent.mobileqq.qroute.QRouteApi;

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.List;
import java.util.Map;

import kotlin.Deprecated;
import kotlin.Unit;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.functions.Function2;

public interface ITroopMemberListRepoApi extends QRouteApi {
//void fetchGagTroopMemberInfo(@Nullable String str, @Nullable LifecycleOwner lifecycleOwner, boolean z, @NotNull String str2, @Nullable f fVar);

//void fetchTroopMemberInfo(@Nullable String str, @Nullable String str2, boolean z, @Nullable LifecycleOwner lifecycleOwner, @NotNull String str3, @Nullable g gVar);

//void fetchTroopMemberInfoWithExtInfo(@Nullable String str, @Nullable String str2, boolean z, @Nullable LifecycleOwner lifecycleOwner, @NotNull String str3, @Nullable g gVar);

//void fetchTroopMemberList(@Nullable String str, @Nullable LifecycleOwner lifecycleOwner, boolean z, @NotNull String str2, @Nullable f fVar);

//void fetchTroopMemberListWithExtInfo(@Nullable String str, @Nullable LifecycleOwner lifecycleOwner, boolean z, @NotNull String str2, @Nullable f fVar);



void fetchTroopMemberName(@Nullable String str, @Nullable String str2, @Nullable LifecycleOwner lifecycleOwner, @NotNull String str3, @Nullable Function1<? super TroopMemberNickInfo, Unit> cb);

void fetchTroopMemberName(@Nullable String str, @Nullable String str2, @NotNull String str3, @Nullable Function1<? super TroopMemberNickInfo, Unit> cb);



void fetchTroopMemberUid(@Nullable String str, @NotNull Function2<? super Boolean, ? super String, Unit> function2);

void fetchTroopMemberUid(@NotNull List<String> list, @NotNull Function2<? super Boolean, ? super Map<String, String>, Unit> function2);

void fetchTroopMemberUin(@Nullable String str, @NotNull Function2<? super Boolean, ? super String, Unit> function2);

void fetchTroopMemberUin(@NotNull List<String> list, @NotNull Function2<? super Boolean, ? super Map<String, String>, Unit> function2);

//void fetchTroopMemberUinListInfo(@Nullable String str, @Nullable List<String> list, boolean z, @Nullable LifecycleOwner lifecycleOwner, @NotNull String str2, @Nullable f fVar);

//void fetchTroopMemberUinListInfoWithExtInfo(@Nullable String str, @Nullable List<String> list, boolean z, @Nullable LifecycleOwner lifecycleOwner, @NotNull String str2, @Nullable f fVar);

//@Nullable
//TroopMemberInfo getTroopMemberFromCacheOrFetchAsync(@Nullable String str, @Nullable String str2, @Nullable LifecycleOwner lifecycleOwner, @NotNull String str3, @Nullable g gVar);

int getTroopMemberInfoDBVersion();

@Deprecated(message = "兼容旧逻辑,过渡用,新逻辑不要使用")
@Nullable
TroopMemberInfo getTroopMemberInfoSync(@Nullable String groupId, @Nullable String userId, @Nullable LifecycleOwner lifecycleOwner, @NotNull String from);

//@Deprecated(message = "兼容旧逻辑,过渡用,新逻辑不要使用")
//@Nullable
//TroopMemberInfo getTroopMemberInfoSync(@Nullable String str, @Nullable String str2, @Nullable LifecycleOwner lifecycleOwner, @NotNull String str3, long j);

//@Deprecated(message = "兼容旧逻辑,过渡用,新逻辑不要使用")
//@Nullable
//TroopMemberInfo getTroopMemberWithExtFromCacheOrFetchAsync(@Nullable String str, @Nullable String str2, @Nullable LifecycleOwner lifecycleOwner, @NotNull String str3, @Nullable g gVar);

//@Deprecated(message = "兼容旧逻辑,过渡用,新逻辑不要使用")
//@Nullable
//TroopMemberInfo getTroopMemberWithExtInfoSync(@Nullable String str, @Nullable String str2, @Nullable LifecycleOwner lifecycleOwner, @NotNull String str3);

boolean isTroopMemberInfoDBInited(@NotNull String str);

//void preLoadTroopMemberUinListInfo(@Nullable String str, @Nullable List<String> list, boolean z, @Nullable LifecycleOwner lifecycleOwner, @NotNull String str2, @Nullable f fVar);
}
Loading

0 comments on commit e2f27cb

Please sign in to comment.