Giter Club home page Giter Club logo

oneplus-no-red-one's People

Contributors

chimpdw avatar cinit avatar freezyexp avatar zehuanli avatar

Stargazers

 avatar

oneplus-no-red-one's Issues

Quickfix for OS 14

this is probably not a complete patch, but it is enough for me as I do not use the Always On Display (AOD)

ClockStyleOp14.java:

package com.upbad.apps.opgo.plugin.systemui;

import android.content.Context;
import android.text.SpannableStringBuilder;
import android.text.TextUtils;
import android.widget.TextView;

import com.upbad.apps.opgo.plugin.IPlugin;

import de.robv.android.xposed.XC_MethodHook;
import de.robv.android.xposed.XposedHelpers;
import de.robv.android.xposed.callbacks.XC_LoadPackage;

import static com.upbad.apps.opgo.util.LogUtil.log;

public class ClockStyleOp14 implements IPlugin {
    @Override
    public void hook(XC_LoadPackage.LoadPackageParam lpparam, ClassLoader classLoader) {
        log("SystemUI hook() started");

        // in com.oplus.systemui.common.clock.OplusClockExImpl
        // found function: public boolean setTextWithRedOneStyle(@NotNull TextView textView, @NotNull CharSequence charSequence)
        XposedHelpers.findAndHookMethod("com.oplus.systemui.common.clock.OplusClockExImpl",
                classLoader,
                "setTextWithRedOneStyle",
                TextView.class,
                CharSequence.class,
                new XC_MethodHook() {
                    @Override
                    protected void beforeHookedMethod(MethodHookParam param) {
                        TextView textView = (TextView) param.args[0];
                        CharSequence text = (CharSequence) param.args[1];

                        if (textView == null) {
                            param.setResult(false);
                            log("OplusClockExImpl textview was null");
                            return;
                        }
                        if (text == null || TextUtils.isEmpty(text)) text = "time";

                        textView.setText(text);
                        param.setResult(false);
                    }
                });

        XposedHelpers.findAndHookMethod("com.oplus.keyguard.utils.KeyguardUtils",
                classLoader,
                "getSpannedHourString",
                Context.class,
                String.class,
                new XC_MethodHook() {
                    @Override
                    protected void beforeHookedMethod(MethodHookParam param) {
                        Context context = (Context) param.args[0];
                        String text = (String) param.args[1];

                        if (context == null || TextUtils.isEmpty(text)) {
                            text = "";
                        }
                        param.setResult(new SpannableStringBuilder(text.toString()));
                    }
                });

        log("SystemUI hook() ended");
    }
}

Unable to change color on OnePlus 10T with OOS14

Hello,

I tried to use the No-Red mod on my OnePlus 10T running OxygenOS 14 but was unable to change the color from red.

Steps I took:

  • Cloned the repository
  • Compiled the app in Android Studio into an APK
  • Installed the APK on my OnePlus 10T
  • Activated the mod in LSPosed version 1.9.2
  • Rebooted my phone

After rebooting, the color remained red across the system interface.

Let me know if I'm missing a step or something needs to be configured differently

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.