<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.brayan.app"\>
\<application
android:allowBackup="true"
android:label="Brayan"
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
android:theme="@style/Theme.Brayan"\>
\<activity android:name=".MainActivity"
android:exported="true"\>
\<intent-filter\>
\<action android:name="android.intent.action.MAIN"/\>
\<category android:name="android.intent.category.LAUNCHER"/\>
\</intent-filter\>
\</activity\>
\</applicati\<?xml version="1.0" encoding="utf-8"?\>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:background="@color/background"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="16dp"\>
\<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"\>
\<TextView
android:text="Brayan"
android:textSize="24sp"
android:textStyle="bold"
android:textColor="@color/accent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/\>
\<TextView
android:text="Escolha o modelo do celular"
android:layout_marginTop="12dp"
android:textColor="@color/textMuted"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/\>
\<Spinner
android:id="@+id/spinnerModel"
android:layout_width="match_parent"
android:layout_height="wrap_content"/\>
\<TextView
android:text="Modo"
android:layout_marginTop="12dp"
android:textColor="@color/textMuted"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/\>
\<Spinner
android:id="@+id/spinnerMode"
android:layout_width="match_parent"
android:layout_height="wrap_content"/\>
\<TextView
android:text="Variação (IA)"
android:layout_marginTop="12dp"
android:textColor="@color/textMuted"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/\>
\<SeekBar
android:id="@+id/seekVariation"
android:max="100"
android:progress="18"
android:layout_width="match_parent"
android:layout_height="wrap_content"/\>
\<TextView
android:id="@+id/tvVariation"
android:text="Variação: 18%"
android:layout_marginTop="4dp"
android:textColor="@color/textMuted"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/\>
\<TextView
android:text="DPI sugerido (editar se quiser)"
android:layout_marginTop="12dp"
android:textColor="@color/textMuted"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/\>
\<EditText
android:id="@+id/etDpi"
android:inputType="number"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="540"/\>
\<TextView
android:text="Botão de tiro (%)"
android:layout_marginTop="12dp"
android:textColor="@color/textMuted"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/\>
\<EditText
android:id="@+id/etBtn"
android:inputType="number"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="42"/\>
\<Button
android:id="@+id/btnGenerate"
android:text="Gerar Sensi"
android:layout_marginTop="14dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"/\>
\<TextView
android:id="@+id/tvResult"
android:text="Resultado aparecerá aqui"
android:layout_marginTop="12dp"
android:textColor="@color/textPrimary"
android:background="@color/resultBg"
android:padding="12dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"/\>
\<LinearLayout
android:layout_marginTop="10dp"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"\>
\<Button android:id="@+id/btnCopy" android:text="Copiar" android:layout_weight="1" android:layout_width="0dp" android:layout_height="wrap_content"/\>
\<Button android:id="@+id/btnExport" android:text="Exportar .txt" android:layout_marginLeft="8dp" android:layout_weight="1" android:layout_width="0dp" android:layout_height="wrap_content"/\>
\</LinearLayout\>
\<Button
android:id="@+id/btnOpenDisplay"
android:text="Abrir Configurações de Tela"
android:layout_marginTop="12dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"/\>
\<TextView
android:id="@+id/tvAdbCommand"
android:textColor="@color/accent"
android:layout_marginTop="10dp"
android:text="Comando ADB: —"
android:layout_width="match_parent"
android:layout_height="wrap_content"/\>
\<TextView
android:text="Obs: somente sugerimos DPI. Aplicar DPI via ADB requer PC e pode afetar a interface."
android:layout_marginTop="8dp"
android:textColor="@color/textM\<resources\>
\<color name="background"\>#071025\</color\>
\<color name="accent"\>#FFD54F\</color\>
\<color name="textMuted"\>#9FB0C8\</color\>
\<color name="textPrimary"\>#EAF2FF\</color\>
\<color name="resultBg"\>#0F1720\</color\>
</resopackage com.brayan.app
import android.content.ClipData
import android.content.ClipboardManager
import android.content.Context
import android.content.Intent
import android.os.Bundle
import android.provider.Settings
import android.util.DisplayMetrics
import android.widget.*
import androidx.appcompat.app.AppCompatActivity
import java.io.File
import java.io.FileOutputStream
import kotlin.math.max
import kotlin.math.min
import kotlin.random.Random
class MainActivity : AppCompatActivity() {
data class Preset(val modelKey:String, val modelName:String, val geral:Int, val red:Int, val m2x:Int, val m4x:Int, val awm:Int, val dpi:Int)
// presets por modelo (exemplos atualizados)
private val modelPresets = listOf(
Preset("galaxy_a03","Samsung Galaxy A03",95,88,82,77,45,540),
Preset("galaxy_a12","Samsung Galaxy A12",96,89,83,78,46,548),
Preset("redmi_note10","Xiaomi Redmi Note 10",97,90,84,80,46,548),
Preset("moto_g_power","Motorola Moto G Power",94,87,80,76,44,520),
Preset("xiaomi_mi11","Xiaomi Mi 11",100,94,88,84,50,600),
Preset("pixel_5","Google Pixel 5",98,92,86,82,48,560)
)
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
val spinnerModel: Spinner = findViewById(R.id.spinnerModel)
val spinnerMode: Spinner = findViewById(R.id.spinnerMode)
val seekVariation: SeekBar = findViewById(R.id.seekVariation)
val tvVariation: TextView = findViewById(R.id.tvVariation)
val etDpi: EditText = findViewById(R.id.etDpi)
val etBtn: EditText = findViewById(R.id.etBtn)
val btnGenerate: Button = findViewById(R.id.btnGenerate)
val tvResult: TextView = findViewById(R.id.tvResult)
val btnCopy: Button = findViewById(R.id.btnCopy)
val btnExport: Button = findViewById(R.id.btnExport)
val btnOpenDisplay: Button = findViewById(R.id.btnOpenDisplay)
val tvAdbCommand: TextView = findViewById(R.id.tvAdbCommand)
// fill model spinner
val modelNames = modelPresets.map { it.modelName }
spinnerModel.adapter = ArrayAdapter(this, android.R.layout.simple_spinner_dropdown_item, modelNames)
// mode spinner
val modes = listOf("equilibrada", "rápida", "extrema")
spinnerMode.adapter = ArrayAdapter(this, android.R.layout.simple_spinner_dropdown_item, modes)
seekVariation.setOnSeekBarChangeListener(object: SeekBar.OnSeekBarChangeListener{
override fun onProgressChanged(seek: SeekBar?, progress: Int, fromUser: Boolean) {
tvVariation.text = "Variação: ${progress}%"
}
override fun onStartTrackingTouch(seek: SeekBar?) {}
override fun onStopTrackingTouch(seek: SeekBar?) {}
})
// try show current DPI as hint
val metrics = DisplayMetrics()
@Suppress("DEPRECATION")
windowManager.defaultDisplay.getMetrics(metrics)
val densityDpi = metrics.densityDpi
etDpi.setText(densityDpi.toString())
btnGenerate.setOnClickListener {
val selectedIndex = spinnerModel.selectedItemPosition
val base = modelPresets.getOrNull(selectedIndex) ?: modelPresets\[0\]
val mode = spinnerMode.selectedItem as String
val variation = seekVariation.progress
val chosenDpi = try { etDpi.text.toString().toInt() } catch (e:Exception){ base.dpi }
val btnSize = try { etBtn.text.toString().toInt() } catch (e:Exception){ 42 }
val generated = generateForModel(base, mode, variation, chosenDpi, btnSize)
tvResult.text = generated
tvAdbCommand.text = "adb shell wm density $chosenDpi # opcional (requere adb)"
}
btnCopy.setOnClickListener {
val text = tvResult.text.toString()
val cm = getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
cm.setPrimaryClip(ClipData.newPlainText("sensi", text))
Toast.makeText(this, "Copiado!", Toast.LENGTH_SHORT).show()
}
btnExport.setOnClickListener {
val text = tvResult.text.toString()
try {
val file = File(getExternalFilesDir(null), "sensi-brayan.txt")
FileOutputStream(file).use { it.write(text.toByteArray()) }
Toast.makeText(this, "Exportado: ${file.absolutePath}", Toast.LENGTH_LONG).show()
} catch (e:Exception) {
Toast.makeText(this, "Erro: ${e.message}", Toast.LENGTH_LONG).show()
}
}
btnOpenDisplay.setOnClickListener {
try {
val i = Intent(Settings.ACTION_DISPLAY_SETTINGS)
startActivity(i)
} catch (e:Exception) {
Toast.makeText(this, "Não foi possível abrir configurações de tela.", Toast.LENGTH_SHORT).show()
}
}
}
// helper clamp & blend
private fun clamp(v:Int, minV:Int, maxV:Int) = max(minV, min(maxV, v))
private fun blend(a:Int, b:Int, alpha:Double) = (a\*(1-alpha) + b\*alpha).toInt()
private fun generateForModel(base: Preset, mode:String, variation:Int, dpiOverride:Int, btnSize:Int) : String {
val presets = modelPresets
val other = presets.random()
val baseBlendAlpha = 0.35
val blendedGeral = blend(base.geral, other.geral, baseBlendAlpha)
val blendedRed = blend(base.red, other.red, baseBlendAlpha)
val blended2x = blend(base.m2x, other.m2x, baseBlendAlpha)
val blended4x = blend(base.m4x, other.m4x, baseBlendAlpha)
val blendedAwm = blend(base.awm, other.awm, baseBlendAlpha)
val blendedDpi = blend(base.dpi, other.dpi, baseBlendAlpha)
val target = when(mode){
"rápida" -\> mapOf("g" to clamp(base.geral+4,1,100), "r" to clamp(base.red+4,1,100), "2x" to clamp(base.m2x+4,1,100), "4x" to clamp(base.m4x+4,1,100), "awm" to clamp(base.awm+2,1,100), "dpi" to max(480, dpiOverride + 20))
"extrema" -\> mapOf("g" to clamp(base.geral+6,1,100), "r" to clamp(base.red+8,1,100), "2x" to clamp(base.m2x+8,1,100), "4x" to clamp(base.m4x+8,1,100), "awm" to clamp(base.awm+5,1,100), "dpi" to max(520, dpiOverride + 40))
else -\> mapOf("g" to base.geral, "r" to base.red, "2x" to base.m2x, "4x" to base.m4x, "awm" to base.awm, "dpi" to dpiOverride)
}
val afterModeG = blend(blendedGeral, target\["g"\] as Int, 0.6)
val afterModeR = blend(blendedRed, target\["r"\] as Int, 0.6)
val afterMode2x = blend(blended2x, target\["2x"\] as Int, 0.6)
val afterMode4x = blend(blended4x, target\["4x"\] as Int, 0.6)
val afterModeAwm = blend(blendedAwm, target\["awm"\] as Int, 0.6)
val afterModeDpi = blend(blendedDpi, target\["dpi"\] as Int, 0.6)
fun noisy(value:Int, scale:Double=1.0):Int {
val noise = ((Random.nextDouble()\*2 - 1) \* (variation/100.0) \* scale \* 5.0)
return clamp((value + noise).toInt(), 1, 100)
}
var finalG = noisy(afterModeG, 1.0)
var finalR = noisy(afterModeR, 1.0)
var final2x = noisy(afterMode2x, 1.0)
var final4x = noisy(afterMode4x, 1.0)
var finalAwm = noisy(afterModeAwm, 1.0)
val finalDpi = clamp(afterModeDpi + ((Random.nextInt(-1,2)) \* (variation/10)), 200, 1200)
if(finalAwm \> finalG) finalAwm = max(10, (finalG \* 0.5))
return buildString {
append("Brayan — Sensi IA para ${base.modelName}\\n\\n")
append("CONFIGURAÇÃO (usar no jogo):\\n")
append("- Geral: $finalG\\n")
append("- Ponto Vermelho: $finalR\\n")
append("- 2x: $final2x\\n")
append("- 4x: $final4x\\n")
append("- AWM: $finalAwm\\n")
append("- DPI sugerido: $finalDpi\\n")
append("- Botão de tiro: ${btnSize}%\\n\\n")
append("DICAS:\\n- HUD: botão de tiro 38–45%\\n- Gráficos: Suave / FPS alto\\n- Treino: 15 min diário (peito + puxada curta)\\n\\n")
append("OBS: Aplicar DPI via ADB (opcional): adb shell wm density $finalDpi\\n")
append("Alterar DPI pode quebrar interface — use com cuidado.\\n")
}
}
// simple list of presets (reused)
companion object {
val modelPresets = listOf(
Preset("galaxy_a03","Samsung Galaxy A03",95,88,82,77,45,540),
Preset("galaxy_a12","Samsung Galaxy A12",96,89,83,78,46,548),
Preset("redmi_note10","Xiaomi Redmi Note 10",97,90,84,80,46,548),
Preset("moto_g_power","Motorola Moto G Poweplugins {
id 'com.android.application'
id 'kotlin-android'
}
android {
namespace 'com.brayan.app'
compileSdk 34
defaultConfig {
applicationId "com.brayan.app"
minSdk 21
targetSdk 34
versionCode 1
versionName "1.0"
}
compileOptions { sourceCompatibility JavaVersion.VERSION_1_8; targetCompatibility JavaVersion.VERSION_1_8 }
kotlinOptions { jvmTarget = "1.8" }
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.mat071025 #FFD54F #9FB0C8 #EAF2FF #0F1720 package com.brayan.app import android.content.ClipData import android.content.ClipboardManager import android.content.Context import android.content.Intent import android.os.Bundle import android.provider.Settings import android.util.DisplayMetrics import android.widget.\* import androidx.appcompat.app.AppCompatActivity import java.io.File import java.io.FileOutputStream import kotlin.math.max import kotlin.math.min import kotlin.random.Random class MainActivity : AppCompatActivity() { data class Preset(val modelKey:String, val modelName:String, val geral:Int, val red:Int, val m2x:Int, val m4x:Int, val awm:Int, val dpi:Int) // presets por modelo (exemplos atualizados) private val modelPresets = listOf( Preset("galaxy_a03","Samsung Galaxy A03",95,88,82,77,45,540), Preset("galaxy_a12","Samsung Galaxy A12",96,89,83,78,46,548), Preset("redmi_note10","Xiaomi Redmi Note 10",97,90,84,80,46,548), Preset("moto_g_power","Motorola Moto G Power",94,87,80,76,44,520), Preset("xiaomi_mi11","Xiaomi Mi 11",100,94,88,84,50,600), Preset("pixel_5","Google Pixel 5",98,92,86,82,48,560) ) override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) val spinnerModel: Spinner = findViewById(R.id.spinnerModel) val spinnerMode: Spinner = findViewById(R.id.spinnerMode) val seekVariation: SeekBar = findViewById(R.id.seekVariation) val tvVariation: TextView = findViewById(R.id.tvVariation) val etDpi: EditText = findViewById(R.id.etDpi) val etBtn: EditText = findViewById(R.id.etBtn) val btnGenerate: Button = findViewById(R.id.btnGenerate) val tvResult: TextView = findViewById(R.id.tvResult) val btnCopy: Button = findViewById(R.id.btnCopy) val btnExport: Button = findViewById(R.id.btnExport) val btnOpenDisplay: Button = findViewById(R.id.btnOpenDisplay) val tvAdbCommand: TextView = findViewById(R.id.tvAdbCommand) // fill model spinner val modelNames = modelPresets.map { it.modelName } spinnerModel.adapter = ArrayAdapter(this, android.R.layout.simple_spinner_dropdown_item, modelNames) // mode spinner val modes = listOf("equilibrada", "rápida", "extrema") spinnerMode.adapter = ArrayAdapter(this, android.R.layout.simple_spinner_dropdown_item, modes) seekVariation.setOnSeekBarChangeListener(object: SeekBar.OnSeekBarChangeListener{ override fun onProgressChanged(seek: SeekBar?, progress: Int, fromUser: Boolean) { tvVariation.text = "Variação: ${progress}%" } override fun onStartTrackingTouch(seek: SeekBar?) {} override fun onStopTrackingTouch(seek: SeekBar?) {} }) // try show current DPI as hint val metrics = DisplayMetrics() @Suppress("DEPRECATION") windowManager.defaultDisplay.getMetrics(metrics) val densityDpi = metrics.densityDpi etDpi.setText(densityDpi.toString()) btnGenerate.setOnClickListener { val selectedIndex = spinnerModel.selectedItemPosition val base = modelPresets.getOrNull(selectedIndex) ?: modelPresets\[0\] val mode = spinnerMode.selectedItem as String val variation = seekVariation.progress val chosenDpi = try { etDpi.text.toString().toInt() } catch (e:Exception){ base.dpi } val btnSize = try { etBtn.text.toString().toInt() } catch (e:Exception){ 42 } val generated = generateForModel(base, mode, variation, chosenDpi, btnSize) tvResult.text = generated tvAdbCommand.text = "adb shell wm density $chosenDpi # opcional (requere adb)" } btnCopy.setOnClickListener { val text = tvResult.text.toString() val cm = getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager cm.setPrimaryClip(ClipData.newPlainText("sensi", text)) Toast.makeText(this, "Copiado!", Toast.LENGTH_SHORT).show() } btnExport.setOnClickListener { val text = tvResult.text.toString() try { val file = File(getExternalFilesDir(null), "sensi-brayan.txt") FileOutputStream(file).use { it.write(text.toByteArray()) } Toast.makeText(this, "Exportado: ${file.absolutePath}", Toast.LENGTH_LONG).show() } catch (e:Exception) { Toast.makeText(this, "Erro: ${e.message}", Toast.LENGTH_LONG).show() } } btnOpenDisplay.setOnClickListener { try { val i = Intent(Settings.ACTION_DISPLAY_SETTINGS) startActivity(i) } catch (e:Exception) { Toast.makeText(this, "Não foi possível abrir configurações de tela.", Toast.LENGTH_SHORT).show() } } } // helper clamp & blend private fun clamp(v:Int, minV:Int, maxV:Int) = max(minV, min(maxV, v)) private fun blend(a:Int, b:Int, alpha:Double) = (a\*(1-alpha) + b\*alpha).toInt() private fun generateForModel(base: Preset, mode:String, variation:Int, dpiOverride:Int, btnSize:Int) : String { val presets = modelPresets val other = presets.random() val baseBlendAlpha = 0.35 val blendedGeral = blend(base.geral, other.geral, baseBlendAlpha) val blendedRed = blend(base.red, other.red, baseBlendAlpha) val blended2x = blend(base.m2x, other.m2x, baseBlendAlpha) val blended4x = blend(base.m4x, other.m4x, baseBlendAlpha) val blendedAwm = blend(base.awm, other.awm, baseBlendAlpha) val blendedDpi = blend(base.dpi, other.dpi, baseBlendAlpha) val target = when(mode){ "rápida" -\> mapOf("g" to clamp(base.geral+4,1,100), "r" to clamp(base.red+4,1,100), "2x" to clamp(base.m2x+4,1,100), "4x" to clamp(base.m4x+4,1,100), "awm" to clamp(base.awm+2,1,100), "dpi" to max(480, dpiOverride + 20)) "extrema" -\> mapOf("g" to clamp(base.geral+6,1,100), "r" to clamp(base.red+8,1,100), "2x" to clamp(base.m2x+8,1,100), "4x" to clamp(base.m4x+8,1,100), "awm" to clamp(base.awm+5,1,100), "dpi" to max(520, dpiOverride + 40)) else -\> mapOf("g" to base.geral, "r" to base.red, "2x" to base.m2x, "4x" to base.m4x, "awm" to base.awm, "dpi" to dpiOverride) } val afterModeG = blend(blendedGeral, target\["g"\] as Int, 0.6) val afterModeR = blend(blendedRed, target\["r"\] as Int, 0.6) val afterMode2x = blend(blended2x, target\["2x"\] as Int, 0.6) val afterMode4x = blend(blended4x, target\["4x"\] as Int, 0.6) val afterModeAwm = blend(blendedAwm, target\["awm"\] as Int, 0.6) val afterModeDpi = blend(blendedDpi, target\["dpi"\] as Int, 0.6) fun noisy(value:Int, scale:Double=1.0):Int { val noise = ((Random.nextDouble()\*2 - 1) \* (variation/100.0) \* scale \* 5.0) return clamp((value + noise).toInt(), 1, 100) } var finalG = noisy(afterModeG, 1.0) var finalR = noisy(afterModeR, 1.0) var final2x = noisy(afterMode2x, 1.0) var final4x = noisy(afterMode4x, 1.0) var finalAwm = noisy(afterModeAwm, 1.0) val finalDpi = clamp(afterModeDpi + ((Random.nextInt(-1,2)) \* (variation/10)), 200, 1200) if(finalAwm \> finalG) finalAwm = max(10, (finalG \* 0.5)) return buildString { append("Brayan — Sensi IA para ${base.modelName}\\n\\n") append("CONFIGURAÇÃO (usar no jogo):\\n") append("- Geral: $finalG\\n") append("- Ponto Vermelho: $finalR\\n") append("- 2x: $final2x\\n") append("- 4x: $final4x\\n") append("- AWM: $finalAwm\\n") append("- DPI sugerido: $finalDpi\\n") append("- Botão de tiro: ${btnSize}%\\n\\n") append("DICAS:\\n- HUD: botão de tiro 38–45%\\n- Gráficos: Suave / FPS alto\\n- Treino: 15 min diário (peito + puxada curta)\\n\\n") append("OBS: Aplicar DPI via ADB (opcional): adb shell wm density $finalDpi\\n") append("Alterar DPI pode quebrar interface — use com cuidado.\\n") } } // simple list of presets (reused) companion object { val modelPresets = listOf( Preset("galaxy_a03","Samsung Galaxy A03",95,88,82,77,45,540), Preset("galaxy_a12","Samsung Galaxy A12",96,89,83,78,46,548), Preset("redmi_note10","Xiaomi Redmi Note 10",97,90,84,80,46,548), Preset("moto_g_power","Motorola Moto G Power",94,87,80,76,44,520), Preset("xiaomi_mi11","Xiaomi Mi 11",100,94,88,84,50,600), Preset("pixel_5","Google Pixel 5",98,92,86,82,48,560) ) } }plugins { id 'com.android.application' id 'kotlin-android' } android { namespace 'com.brayan.app' compileSdk 34 defaultConfig { applicationId "com.brayan.app" minSdk 21 targetSdk 34 versionCode 1 versionName "1.0" } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8; targetCompatibility JavaVersion.VERSION_1_8 } kotlinOptions { jvmTarget = "1.8" } } dependencies { implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'com.google.android.material:material:1.9.0' }erial:material:1.9.0'
}r",94,87,80,76,44,520),
Preset("xiaomi_mi11","Xiaomi Mi 11",100,94,88,84,50,600),
Preset("pixel_5","Google Pixel 5",98,92,86,82,48,560)
)
}
}urces>uted"
android:layout_width="match_parent"
android:layout_height="wrap_content"/\>
\</LinearLayout\>
</ScrollView>on>
</manifest>