Windows Switch -> Linux switch
1
.idea/.name
Normal file
|
@ -0,0 +1 @@
|
|||
LinuxSwitch
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CompilerConfiguration">
|
||||
<bytecodeTargetLevel target="11" />
|
||||
<bytecodeTargetLevel target="17" />
|
||||
</component>
|
||||
</project>
|
10
.idea/deploymentTargetDropDown.xml
Normal file
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="deploymentTargetDropDown">
|
||||
<value>
|
||||
<entry key="app">
|
||||
<State />
|
||||
</entry>
|
||||
</value>
|
||||
</component>
|
||||
</project>
|
|
@ -4,15 +4,15 @@
|
|||
<component name="GradleSettings">
|
||||
<option name="linkedExternalProjectsSettings">
|
||||
<GradleProjectSettings>
|
||||
<option name="testRunner" value="GRADLE" />
|
||||
<option name="distributionType" value="DEFAULT_WRAPPED" />
|
||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||
<option name="gradleJvm" value="#GRADLE_LOCAL_JAVA_HOME" />
|
||||
<option name="modules">
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$" />
|
||||
<option value="$PROJECT_DIR$/app" />
|
||||
</set>
|
||||
</option>
|
||||
<option name="resolveExternalAnnotations" value="false" />
|
||||
</GradleProjectSettings>
|
||||
</option>
|
||||
</component>
|
||||
|
|
6
.idea/kotlinc.xml
Normal file
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="KotlinJpsPluginSettings">
|
||||
<option name="version" value="1.7.20" />
|
||||
</component>
|
||||
</project>
|
10
.idea/migrations.xml
Normal file
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectMigrations">
|
||||
<option name="MigrateToGradleLocalJavaHome">
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$" />
|
||||
</set>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
|
@ -1,7 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="Android Studio default JDK" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-17" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="ProjectType">
|
||||
|
|
6
.idea/vcs.xml
Normal file
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
|
@ -4,11 +4,11 @@ plugins {
|
|||
}
|
||||
|
||||
android {
|
||||
namespace 'me.entaromia.windowsswitch'
|
||||
namespace 'su.timoxa0.linuxswitch'
|
||||
compileSdk 33
|
||||
|
||||
defaultConfig {
|
||||
applicationId "me.entaromia.windowsswitch"
|
||||
applicationId "su.timoxa0.linuxswitch"
|
||||
minSdk 24
|
||||
targetSdk 33
|
||||
versionCode 1
|
||||
|
@ -21,6 +21,10 @@ android {
|
|||
release {
|
||||
minifyEnabled true
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
signingConfig signingConfigs.debug
|
||||
}
|
||||
debug {
|
||||
versionNameSuffix 'debug'
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.WindowsSwitch"
|
||||
android:theme="@style/Theme.LinuxSwitch"
|
||||
tools:targetApi="31">
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
|
@ -20,6 +20,16 @@
|
|||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<service android:name=".QSTile"
|
||||
android:exported="true"
|
||||
android:label="@string/qs_switch_text"
|
||||
android:icon="@drawable/ic_qs_tile"
|
||||
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
|
||||
<intent-filter>
|
||||
<action android:name="android.service.quicksettings.action.QS_TILE" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
|
||||
</application>
|
||||
|
||||
</manifest>
|
|
@ -1,36 +0,0 @@
|
|||
package me.entaromia.windowsswitch
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import android.widget.Button
|
||||
import com.topjohnwu.superuser.Shell
|
||||
|
||||
class MainActivity : AppCompatActivity() {
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(R.layout.activity_main)
|
||||
val buttonWindows = findViewById<Button>(R.id.buttonwindows)
|
||||
|
||||
Shell.getShell()
|
||||
|
||||
if (Shell.isAppGrantedRoot() == true) {
|
||||
buttonWindows.isEnabled = true
|
||||
} else {
|
||||
finish()
|
||||
}
|
||||
|
||||
|
||||
buttonWindows.setOnClickListener {
|
||||
Log.e("WindowsSwitch","switching to windows")
|
||||
|
||||
if (Shell.cmd("getprop ro.boot.slot_suffix").exec().out.contains("_a")) {
|
||||
Log.e("WindowsSwitch", "slot a")
|
||||
Shell.cmd("dd if=/sdcard/windows/boot.img of=/dev/block/sde14 bs=16M", "sleep 1", "svc power reboot").exec()
|
||||
} else if (Shell.cmd("getprop ro.boot.slot_suffix").exec().out.contains("_b")) {
|
||||
Log.e("WindowsSwitch", "slot b")
|
||||
Shell.cmd("dd if=/sdcard/windows/boot.img of=/dev/block/sde37 bs=16M", "sleep 1", "svc power reboot").exec()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
96
app/src/main/java/su/timoxa0/linuxswitch/MainActivity.kt
Normal file
|
@ -0,0 +1,96 @@
|
|||
package su.timoxa0.linuxswitch
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import android.widget.Button
|
||||
import android.widget.TextView
|
||||
import android.widget.Toast
|
||||
import com.topjohnwu.superuser.Shell
|
||||
|
||||
class MainActivity : AppCompatActivity() {
|
||||
companion object {
|
||||
fun showToast(text: String, applicationContext: Context) {
|
||||
Toast.makeText(applicationContext, text, Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
|
||||
fun switch(applicationContext: Context) {
|
||||
Log.i("SwitchToLinux", "switching to linux")
|
||||
|
||||
val suffix: String = Shell.cmd("getprop ro.boot.slot_suffix").exec().out[0].toString()
|
||||
|
||||
showToast("Switching!", applicationContext)
|
||||
|
||||
Shell.cmd(
|
||||
"dd if=/sdcard/linux/linux.dtbo.img of=/dev/block/bootdevice/by-name/dtbo$suffix",
|
||||
"dd if=/sdcard/linux/linux.boot.img of=/dev/block/bootdevice/by-name/boot$suffix",
|
||||
"dd if=/sdcard/linux/linux.vbmeta.img of=/dev/block/bootdevice/by-name/vbmeta$suffix",
|
||||
"sleep 1",
|
||||
"svc power reboot"
|
||||
).exec()
|
||||
}
|
||||
}
|
||||
private fun isFileExist(path: String): Boolean {
|
||||
return if (path.endsWith("/")) {
|
||||
Shell.cmd("test -d %s".format(path)).exec().isSuccess
|
||||
} else {
|
||||
Shell.cmd("test -f %s".format(path)).exec().isSuccess
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("SdCardPath", "SetTextI18n")
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(R.layout.activity_main)
|
||||
val buttonS2L = findViewById<Button>(R.id.button_switch)
|
||||
val buttonDump = findViewById<Button>(R.id.button_dump)
|
||||
val textSlot = findViewById<TextView>(R.id.text_slot)
|
||||
|
||||
Shell.getShell()
|
||||
|
||||
if (Shell.isAppGrantedRoot() == true) {
|
||||
|
||||
val suffix: String = Shell.cmd("getprop ro.boot.slot_suffix").exec().out[0].toString()
|
||||
|
||||
buttonS2L.isEnabled = true
|
||||
if (!isFileExist("/sdcard/linux/")) {
|
||||
Shell.cmd("mkdir /sdcard/linux/").exec()
|
||||
}
|
||||
if (!isFileExist("/sdcard/linux/linux.dtbo.img")) {
|
||||
showToast("linux.dtbo.img not found", applicationContext)
|
||||
finish()
|
||||
} else if (!isFileExist("/sdcard/linux/linux.vbmeta.img")) {
|
||||
showToast("linux.vbmeta.img bot found", applicationContext)
|
||||
finish()
|
||||
} else if (!isFileExist("/sdcard/linux/linux.boot.img")) {
|
||||
showToast("linux.boot.img not found", applicationContext)
|
||||
finish()
|
||||
}
|
||||
|
||||
textSlot.text = this.resources.getString(R.string.slot_text).format(suffix[1])
|
||||
|
||||
} else {
|
||||
finish()
|
||||
}
|
||||
|
||||
|
||||
buttonS2L.setOnClickListener {
|
||||
switch(applicationContext)
|
||||
finish()
|
||||
}
|
||||
|
||||
buttonDump.setOnClickListener {
|
||||
Log.i("SwitchToLinux","dumping images")
|
||||
val suffix: String = Shell.cmd("getprop ro.boot.slot_suffix").exec().out[0].toString()
|
||||
|
||||
Shell.cmd(
|
||||
"dd if=/dev/block/bootdevice/by-name/dtbo$suffix of=/sdcard/linux/android.dtbo.img ",
|
||||
"dd if=/dev/block/bootdevice/by-name/boot$suffix of=/sdcard/linux/android.boot.img",
|
||||
).exec()
|
||||
|
||||
showToast("Android images dumped to /sdcard/linux/", applicationContext)
|
||||
}
|
||||
}
|
||||
}
|
17
app/src/main/java/su/timoxa0/linuxswitch/QSTile.kt
Normal file
|
@ -0,0 +1,17 @@
|
|||
package su.timoxa0.linuxswitch
|
||||
|
||||
import android.service.quicksettings.TileService
|
||||
import com.topjohnwu.superuser.Shell
|
||||
|
||||
class QSTile: TileService() {
|
||||
override fun onClick() {
|
||||
super.onClick()
|
||||
Shell.getShell()
|
||||
|
||||
if (Shell.isAppGrantedRoot() == true) {
|
||||
MainActivity.switch(applicationContext)
|
||||
} else {
|
||||
MainActivity.showToast("No root", applicationContext)
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,170 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path
|
||||
android:fillColor="#3DDC84"
|
||||
android:pathData="M0,0h108v108h-108z" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M9,0L9,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,0L19,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,0L29,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,0L39,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,0L49,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,0L59,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,0L69,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,0L79,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M89,0L89,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M99,0L99,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,9L108,9"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,19L108,19"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,29L108,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,39L108,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,49L108,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,59L108,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,69L108,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,79L108,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,89L108,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,99L108,99"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,29L89,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,39L89,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,49L89,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,59L89,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,69L89,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,79L89,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,19L29,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,19L39,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,19L49,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,19L59,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,19L69,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,19L79,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
</vector>
|
|
@ -1,14 +1,14 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="4875"
|
||||
android:viewportHeight="4875">
|
||||
<group android:scaleX="0.43"
|
||||
android:scaleY="0.43"
|
||||
android:translateX="1389.375"
|
||||
android:translateY="1389.375">
|
||||
android:viewportWidth="1320"
|
||||
android:viewportHeight="1320">
|
||||
<group android:scaleX="0.8"
|
||||
android:scaleY="0.8"
|
||||
android:translateX="276"
|
||||
android:translateY="1044">
|
||||
<path
|
||||
android:pathData="M0,0h2311v2310L0,2310zM2564,0h2311v2310L2564,2310zM0,2564h2311v2311L0,4875zM2564,2564h2311v2311L2564,4875"
|
||||
android:fillColor="#0078d4"/>
|
||||
android:pathData="M200-120q-33 0-56.5-23.5T120-200v-400q0-100 70-170t170-70h240q100 0 170 70t70 170v400q0 33-23.5 56.5T760-120H200Zm0-80h560v-400q0-66-47-113t-113-47H360q-66 0-113 47t-47 113v400Zm160-280q-33 0-56.5-23.5T280-560q0-33 23.5-56.5T360-640q33 0 56.5 23.5T440-560q0 33-23.5 56.5T360-480Zm240 0q-33 0-56.5-23.5T520-560q0-33 23.5-56.5T600-640q33 0 56.5 23.5T680-560q0 33-23.5 56.5T600-480ZM280-200v-80q0-33 23.5-56.5T360-360h240q33 0 56.5 23.5T680-280v80h-80v-80h-80v80h-80v-80h-80v80h-80Zm-80 0h560-560Z"
|
||||
android:fillColor="@color/primary"/>
|
||||
</group>
|
||||
</vector>
|
||||
|
|
14
app/src/main/res/drawable/ic_qs_tile.xml
Normal file
|
@ -0,0 +1,14 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="960"
|
||||
android:viewportHeight="960">
|
||||
<group android:scaleX="1"
|
||||
android:scaleY="1"
|
||||
android:translateX="0"
|
||||
android:translateY="960">
|
||||
<path
|
||||
android:pathData="M200-120q-33 0-56.5-23.5T120-200v-400q0-100 70-170t170-70h240q100 0 170 70t70 170v400q0 33-23.5 56.5T760-120H200Zm0-80h560v-400q0-66-47-113t-113-47H360q-66 0-113 47t-47 113v400Zm160-280q-33 0-56.5-23.5T280-560q0-33 23.5-56.5T360-640q33 0 56.5 23.5T440-560q0 33-23.5 56.5T360-480Zm240 0q-33 0-56.5-23.5T520-560q0-33 23.5-56.5T600-640q33 0 56.5 23.5T680-560q0 33-23.5 56.5T600-480ZM280-200v-80q0-33 23.5-56.5T360-360h240q33 0 56.5 23.5T680-280v80h-80v-80h-80v80h-80v-80h-80v80h-80Zm-80 0h560-560Z"
|
||||
android:fillColor="@android:color/white"/>
|
||||
</group>
|
||||
</vector>
|
|
@ -1,16 +1,49 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/linearLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
tools:context=".MainActivity">
|
||||
|
||||
<Button
|
||||
android:id="@+id/buttonwindows"
|
||||
android:id="@+id/button_switch"
|
||||
style="@style/Widget.Material3.Button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:text="Switch to Windows"
|
||||
android:enabled="false"/>
|
||||
</FrameLayout>
|
||||
android:enabled="false"
|
||||
android:text="@string/button_switch_text"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.45" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/button_dump"
|
||||
style="@style/Widget.Material3.Button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="@string/button_dump_text"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/button_switch" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_slot"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:gravity="bottom|center_vertical"
|
||||
android:textSize="16sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.498"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
Before Width: | Height: | Size: 663 B |
Before Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 507 B |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 931 B |
Before Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 4.8 KiB |
Before Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 6.8 KiB |
|
@ -1,16 +1,16 @@
|
|||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- Base application theme. -->
|
||||
<style name="Theme.WindowsSwitch" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
|
||||
<style name="Theme.LinuxSwitch" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
|
||||
<!-- Primary brand color. -->
|
||||
<item name="colorPrimary">@color/purple_200</item>
|
||||
<item name="colorPrimaryVariant">@color/purple_700</item>
|
||||
<item name="colorOnPrimary">@color/black</item>
|
||||
<item name="colorPrimary">@color/primary</item>
|
||||
<item name="colorPrimaryVariant">@color/primary</item>
|
||||
<item name="colorOnPrimary">@color/white</item>
|
||||
<!-- Secondary brand color. -->
|
||||
<item name="colorSecondary">@color/teal_200</item>
|
||||
<item name="colorSecondaryVariant">@color/teal_200</item>
|
||||
<item name="colorSecondary">@color/secondary</item>
|
||||
<item name="colorSecondaryVariant">@color/secondary</item>
|
||||
<item name="colorOnSecondary">@color/black</item>
|
||||
<!-- Status bar color. -->
|
||||
<item name="android:statusBarColor">?attr/colorPrimaryVariant</item>
|
||||
<item name="android:statusBarColor">@android:color/background_dark</item>
|
||||
<!-- Customize your theme here. -->
|
||||
</style>
|
||||
</resources>
|
|
@ -1,10 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="purple_200">#FFBB86FC</color>
|
||||
<color name="purple_500">#FF6200EE</color>
|
||||
<color name="purple_700">#FF3700B3</color>
|
||||
<color name="teal_200">#FF03DAC5</color>
|
||||
<color name="teal_700">#FF018786</color>
|
||||
<color name="black">#FF000000</color>
|
||||
<color name="white">#FFFFFFFF</color>
|
||||
<color name="primary">#FF0eb245</color>
|
||||
<color name="secondary">#FF18DDBC</color>
|
||||
<color name="ic_launcher_background">#FFFFFFFF</color>
|
||||
</resources>
|
|
@ -1,4 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="ic_launcher_background">#000000</color>
|
||||
</resources>
|
|
@ -1,3 +1,7 @@
|
|||
<resources>
|
||||
<string name="app_name">Windows Switch</string>
|
||||
<string name="app_name">Switch to Linux</string>
|
||||
<string name="button_switch_text">Switch to Linux</string>
|
||||
<string name="qs_switch_text">Switch to Linux</string>
|
||||
<string name="button_dump_text">Dump android images</string>
|
||||
<string name="slot_text">Current slot: %s</string>
|
||||
</resources>
|
|
@ -1,16 +1,16 @@
|
|||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- Base application theme. -->
|
||||
<style name="Theme.WindowsSwitch" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
|
||||
<style name="Theme.LinuxSwitch" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
|
||||
<!-- Primary brand color. -->
|
||||
<item name="colorPrimary">@color/purple_500</item>
|
||||
<item name="colorPrimaryVariant">@color/purple_700</item>
|
||||
<item name="colorPrimary">@color/primary</item>
|
||||
<item name="colorPrimaryVariant">@color/primary</item>
|
||||
<item name="colorOnPrimary">@color/white</item>
|
||||
<!-- Secondary brand color. -->
|
||||
<item name="colorSecondary">@color/teal_200</item>
|
||||
<item name="colorSecondaryVariant">@color/teal_700</item>
|
||||
<item name="colorSecondary">@color/secondary</item>
|
||||
<item name="colorSecondaryVariant">@color/secondary</item>
|
||||
<item name="colorOnSecondary">@color/black</item>
|
||||
<!-- Status bar color. -->
|
||||
<item name="android:statusBarColor">?attr/colorPrimaryVariant</item>
|
||||
<item name="android:statusBarColor">@color/primary</item>
|
||||
<!-- Customize your theme here. -->
|
||||
</style>
|
||||
</resources>
|
|
@ -1,6 +1,6 @@
|
|||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
plugins {
|
||||
id 'com.android.application' version '7.4.0-beta03' apply false
|
||||
id 'com.android.library' version '7.4.0-beta03' apply false
|
||||
id 'com.android.application' version '8.2.1' apply false
|
||||
id 'com.android.library' version '8.2.1' apply false
|
||||
id 'org.jetbrains.kotlin.android' version '1.7.20' apply false
|
||||
}
|
|
@ -20,4 +20,6 @@ kotlin.code.style=official
|
|||
# Enables namespacing of each library's R class so that its R class includes only the
|
||||
# resources declared in the library itself and none from the library's dependencies,
|
||||
# thereby reducing the size of the R class for that library
|
||||
android.nonTransitiveRClass=true
|
||||
android.nonTransitiveRClass=true
|
||||
android.defaults.buildfeatures.buildconfig=true
|
||||
android.nonFinalResIds=false
|
2
gradle/wrapper/gradle-wrapper.properties
vendored
|
@ -1,6 +1,6 @@
|
|||
#Sun Dec 25 19:56:32 TRT 2022
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
|
||||
distributionPath=wrapper/dists
|
||||
zipStorePath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
|
|
@ -13,5 +13,5 @@ dependencyResolutionManagement {
|
|||
maven { url "https://jitpack.io" }
|
||||
}
|
||||
}
|
||||
rootProject.name = "WindowsSwitch"
|
||||
rootProject.name = "LinuxSwitch"
|
||||
include ':app'
|
||||
|
|