Exploit database

GH-14fb583d3d1bd2da10251bb1a37b93d6

gitchw/ghostlock-cve-2026-43499

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2026-43499

166 sources

Preferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source

Repository files25

Files from this repository share one source choice. Supporting files may cover other vulnerabilities.

workspace/decomp/HeyOTA/sources/com/heytap/wearable/support/widget/HeyHorizontalProgressBar.java

Java · 6,965 bytes
package com.heytap.wearable.support.widget;

import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.RectF;
import android.util.AttributeSet;
import android.view.View;
import com.heytap.wearable.R$dimen;
import com.heytap.wearable.R$styleable;

/* loaded from: classes.dex */
public class HeyHorizontalProgressBar extends View {
    private Paint mBackgroundPaint;
    private int mBarType;
    private Context mContext;
    private int mCurrentProgress;
    private int mHeight;
    private int mMaxProgress;
    private int mProgressBackgroundColor;
    private int mProgressBarHeight;
    private int mProgressColor;
    private Paint mProgressPaint;
    private RectF mProgressRectf;
    private int mWidth;

    public HeyHorizontalProgressBar(Context context) {
        this(context, null);
    }

    public HeyHorizontalProgressBar(Context context, AttributeSet attributeSet) {
        this(context, attributeSet, 0);
    }

    public HeyHorizontalProgressBar(Context context, AttributeSet attributeSet, int i) {
        super(context, attributeSet, i);
        if (attributeSet != null) {
            TypedArray obtainStyledAttributes = context.obtainStyledAttributes(attributeSet, R$styleable.HeyHorizontalProgressBar, i, 0);
            this.mProgressBackgroundColor = obtainStyledAttributes.getColor(R$styleable.HeyHorizontalProgressBar_backgroundBarColor, Color.parseColor("#FFFFFFFF"));
            this.mProgressColor = obtainStyledAttributes.getColor(R$styleable.HeyHorizontalProgressBar_progressBarColor, Color.parseColor("#4C65FF"));
            this.mMaxProgress = obtainStyledAttributes.getInt(R$styleable.HeyHorizontalProgressBar_maxProgress, 10);
            this.mCurrentProgress = obtainStyledAttributes.getInt(R$styleable.HeyHorizontalProgressBar_curProgress, 0);
            this.mBarType = obtainStyledAttributes.getInt(R$styleable.HeyHorizontalProgressBar_progressBarType, 0);
            obtainStyledAttributes.recycle();
        }
        this.mContext = context;
        init(context);
    }

    private void init(Context context) {
        Paint paint = new Paint();
        this.mBackgroundPaint = paint;
        paint.setStyle(Paint.Style.FILL);
        this.mBackgroundPaint.setStrokeWidth(this.mProgressBarHeight);
        this.mBackgroundPaint.setAntiAlias(true);
        this.mBackgroundPaint.setColor(this.mProgressBackgroundColor);
        Paint paint2 = new Paint();
        this.mProgressPaint = paint2;
        paint2.setStyle(Paint.Style.FILL);
        this.mProgressPaint.setStrokeWidth(this.mProgressBarHeight);
        this.mProgressPaint.setAntiAlias(true);
        this.mProgressPaint.setColor(this.mProgressColor);
        this.mProgressRectf = new RectF();
        setHeight(context);
    }

    private void setHeight(Context context) {
        int i = this.mBarType;
        if (i == 0) {
            this.mProgressBarHeight = (int) context.getResources().getDimension(R$dimen.hey_horizontal_normal_progress_bar_height_def);
            return;
        }
        if (i == 1) {
            if (this.mMaxProgress > 10) {
                this.mMaxProgress = 10;
            }
            int i2 = this.mCurrentProgress;
            int i3 = this.mMaxProgress;
            if (i2 > i3) {
                this.mCurrentProgress = i3;
            }
            this.mProgressBarHeight = (int) context.getResources().getDimension(R$dimen.hey_horizontal_normal_progress_bar_height_def);
            return;
        }
        this.mProgressBarHeight = (int) context.getResources().getDimension(R$dimen.hey_horizontal_normal_progress_bar_height_def);
    }

    @Override // android.view.View
    protected void onMeasure(int i, int i2) {
        super.onMeasure(i, i2);
        int measureWidth = measureWidth(i);
        this.mWidth = measureWidth;
        int i3 = this.mProgressBarHeight;
        this.mHeight = i3;
        setMeasuredDimension(measureWidth, i3);
    }

    private int measureWidth(int i) {
        int mode = View.MeasureSpec.getMode(i);
        int size = View.MeasureSpec.getSize(i);
        if (mode == Integer.MIN_VALUE) {
            return Math.min(getWidthByType(), size);
        }
        if (mode == 0 || mode == 1073741824) {
            return size;
        }
        return 168;
    }

    private int getWidthByType() {
        float dimension;
        int i = this.mBarType;
        if (i == 0) {
            dimension = this.mContext.getResources().getDimension(R$dimen.hey_horizontal_segment_progress_bar_width_def);
        } else {
            if (i != 1) {
                return 168;
            }
            dimension = this.mContext.getResources().getDimension(R$dimen.hey_horizontal_segment_progress_bar_width_def);
        }
        return (int) dimension;
    }

    @Override // android.view.View
    protected void onDraw(Canvas canvas) {
        super.onDraw(canvas);
        int i = this.mBarType;
        if (i == 0) {
            drawNormal(canvas);
        } else {
            if (i != 1) {
                return;
            }
            drawSegment(canvas);
        }
    }

    private void drawNormal(Canvas canvas) {
        this.mProgressRectf.left = getPaddingStart();
        this.mProgressRectf.top = ((this.mHeight - this.mProgressBarHeight) / 2.0f) + getPaddingTop();
        this.mProgressRectf.right = this.mWidth - getPaddingEnd();
        RectF rectF = this.mProgressRectf;
        rectF.bottom = rectF.top + this.mProgressBarHeight;
        canvas.drawRoundRect(rectF, 10.0f, 10.0f, this.mBackgroundPaint);
        RectF rectF2 = this.mProgressRectf;
        rectF2.right = (((this.mWidth - getPaddingStart()) - getPaddingEnd()) * (this.mCurrentProgress / this.mMaxProgress)) + getPaddingStart();
        canvas.drawRoundRect(rectF2, 10.0f, 10.0f, this.mProgressPaint);
    }

    private void drawSegment(Canvas canvas) {
        int paddingStart = (this.mWidth - getPaddingStart()) - getPaddingEnd();
        float f = (paddingStart - ((r1 - 1) * 4)) / this.mMaxProgress;
        this.mProgressRectf.left = getPaddingStart();
        this.mProgressRectf.top = ((this.mHeight - this.mProgressBarHeight) / 2.0f) + getPaddingTop();
        RectF rectF = this.mProgressRectf;
        rectF.right = 0.0f;
        rectF.bottom = rectF.top + this.mProgressBarHeight;
        for (int i = 0; i < this.mMaxProgress; i++) {
            if (i > 0) {
                RectF rectF2 = this.mProgressRectf;
                rectF2.left = rectF2.right + 4.0f;
            }
            RectF rectF3 = this.mProgressRectf;
            rectF3.right = rectF3.left + f;
            if (i < this.mCurrentProgress) {
                canvas.drawRoundRect(rectF3, 10.0f, 10.0f, this.mProgressPaint);
            } else {
                canvas.drawRoundRect(rectF3, 10.0f, 10.0f, this.mBackgroundPaint);
            }
        }
    }
}