yashsingh1/xdaforums huggingface dataset:
[Android General] daxgirl:
Is that a question? Are you asking if I can help you with it? Because if you are, the answer is in the op. No theming questions allowed. No theming requests. This is not an application, this is a source code. It comes with no support and no warranty. Anything you do with it is your right and responsibility.

If you're telling me that I can help you with it, well... in that case... LOL
[Android General] daxgirl:
You're a noob with any language, my friend. Nevertheless, this is not a request thread. We gave you a code, you can do what you want with it. Including java edits. It is your right. So go ahead and make an edit to cross switch. Read on SO, read on documentation. You can do it.
[Android General] asc1977:
Please how i can call this in Rc?

<dashboard-tile android:icon="@drawable/ic_setting_grid_autostarts" android:id="@id/autostarts_settings" android:title="@string/autostarts_title" android:fragment="com.android.settings.autostarts.LewaManageAutostarts" settings:tilecategoryid="@id/system_section" settings:removetileapps="KIOSKCONTAINER" />
[Android General] asc1977:
Nobody a idea?
[Android General] Wuby986:
If it is an activity is eaay if not is not possible
[Android General] daxgirl:
Hello. Thanks for the info. This is not an app. It's an open source code project. It cannot and will not be monetized. Ever.
[Android General] rony raj:
nice get source to change
[Android General] #Henkate:
Just an idea :D

Im working on an app (made with Tasker) to install ROM/update, kernel, recovery, backup/restore ROM (in future i might add the possibility to choose custom time when to backup). Using OpenRecoveryScript, my app is able to write the OpenRecoveryScript commands based on user choices (e.g. automatically go to recovery with shell command and start to do a backup of the actual ROM, then install ROM and GAPPS and auto reboot once it is finished).

ROM Control can run scripts right? Then you might want to take a look at OpenRecoveryScript . You can make a backup menu in ROM Control to backup the ROM etc. It will be more wonderful :D

You can find these informations about how to use OpenRecoveryScript on xda/google, but i will tell you here too:

1) First you must set the right permission for /cache/recovery directory.

chmod 0777 /cache/recovery

2) Then write the commands you want to OpenRecoveryScript like this:

echo "%BACKUP_LOCATION\nbackup %BACKUP_OPTIONS %BACKUP_NAME\nwipe system\nwipe data\nwipe cache\nwipe dalvik\ncmd reboot" > /cache/recovery/openrecoveryscript

\n= new line (enter)

This is the code i use in Tasker.

3) Then i use a shell command to reboot to recovery:

reboot recovery
[Android General] Wuby986:
Thanks.. we already know that. We've been working on something similar on what you have. We actually even passed the idea to peppe and he actually used it. Our original idea was a bit more complex, and since we never released the rom we just left it apart
[Android General] asc1977:
Hi,

I have a question. I have a mod for choosing gifs for animation. I use it with RC with thumnailpreference. All is working but if i select a gif after 9 means 10 or 11 it shows me always first gif. All is right in smalis and keys and arrays. I checked 1000 times. Is it possible that that preference can only choose between 9 items?
[Android General] tdunham:
I don't think so. Show us your smali array/method.

---------- Post added at 12:12 PM ---------- Previous post was at 11:59 AM ----------

Not in RC, in systemui.
[Android General] thereassaad:
Yes td it's in systemui ,

Thanks , ?
[Android General] tdunham:
In array, the most common problem is hex doesn't go right from 9 to 10.

It goes from 9 to a, b, c, d, e, f --> then after f item it changes again.

So here is example:

const/16 v4, [COLOR="Blue"]0x9[/COLOR]

if-eq v3, v4, :cond_9

const/16 v4, [COLOR="blue"]0xa
[/COLOR]
if-eq v3, v4, :cond_10

const/16 v4, [COLOR="blue"]0xb
[/COLOR]
if-eq v3, v4, :cond_11

const/16 v4, [COLOR="blue"]0xc[/COLOR]

if-eq v3, v4, :cond_12

const/16 v4, [COLOR="blue"]0xd
[/COLOR]
if-eq v3, v4, :cond_13

const/16 v4, [COLOR="blue"]0xe[/COLOR]

if-eq v3, v4, :cond_14

const/16 v4, [COLOR="blue"][COLOR="blue"]0xf
[/COLOR][/COLOR]
if-eq v3, v4, :cond_15

const/16 v4, [COLOR="blue"]0x10[/COLOR]

if-eq v3, v4, :cond_16

const/16 v4, [COLOR="blue"]0x11[/COLOR]

if-eq v3, v4, :cond_17
[Android General] asc1977:
I get it. Thx. Was a thinking problem. I forgot that conds are hexadezimal so i made arraxys after 9 also to a and b.

BAD MISSTAKE !!!
[Android General] venkat kamesh:
hi bro

hello [MENTION=4714483]daxgirl[/MENTION] :)

Its a great source..

i had a small doubt, could you please look at his bro

I had started to make a new app of navigator view

When i try to apply the Theme Dark/Light (Styles) only dialog box text and background are changing

Not with navigator view

Any suggestions please

so that i can expose my code to you bro ;)

Thank you
[Android General] Wuby986:
You should first show the code then you can expect some suggestion. If we don't know what you did we cannot tell you what's wrong. Upload sources to git and post the link
[Android General] venkat kamesh:
here is the app source bro

https://github.com/venkatkamesh/BarolaAeroSports

i had implemented the theme dialog and style from Rom control v1 sources

dont know what i missed

what is did is

1. added styles and drawable

added themeselection java which was woke by mainActivity

hope you brothers can help me out of this :D

navigationview background was same not affected by theme.. dont know why :p

Thank you again and waiting bro ;)
[Android General] daxgirl:
Hey,

You're asking a question in general android development. The address for questions like that is Stackoverflow.

The code you linked has nothing to do with Rom control. It's your own android project. And I understand you come here looking for android developers to help you with your own code.

I am sure you will find a better suited answer on SO or if you open a question thread on xda. Here is not a proper place.

Sorry, mate.
[Android General] venkat kamesh:
oh got you bro

but i am asking for you cause

i used the code from rom control (Apply Theme dialog code)

Hope only you can suggest me about what i missed bro

even a small clue can help me out bro

Thank you

Edit: thank you brother

Found other solution solved it ?
[Android General] Finijumper:
Why my screen opens when I have closed it. But I can't click anything in my lock screen until I open my screen.
[Android General] Wuby986:
can you please upload your sources to git so i can look at it?

i have a doubt about the error in the log and i cannot solve it if i don't see the full sources
[Android General] asc1977:
hi

i am sucessfull now on nougat a have a big problem with romcontrol app. i builded last times 6 RC without any problem but nougat killing me.

I take old RC and also build new one but every time i use PreferendeScreen layout app fc if i click on it. same lines on UX or MM work

Here my logcat

11-23 03:33:33.053 13246-13246/com.wubydax.romcontrol.v2 E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.wubydax.romcontrol.v2, PID: 13246
java.lang.ClassCastException: android.widget.FrameLayout cannot be cast to android.widget.LinearLayout
at com.wubydax.romcontrol.v2.PrefsFragment.setUpNestedPreferenceLayout(PrefsFragment.java:128)
at com.wubydax.romcontrol.v2.PrefsFragment.onPreferenceClick(PrefsFragment.java:116)
at android.preference.Preference.performClick(Preference.java:1177)
at android.preference.PreferenceScreen.onItemClick(PreferenceScreen.java:289)
at android.widget.AdapterView.performItemClick(AdapterView.java:324)
at android.widget.AbsListView.performItemClick(AbsListView.java:1658)
at android.widget.AbsListView$PerformClick.run(AbsListView.java:4135)
at android.widget.AbsListView$13.run(AbsListView.java:6326)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6640)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1468)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1358)

RC lines as example

<PreferenceScreen android:title="Clock settings" android:key="normal_clock">
<com.wubydax.romcontrol.v2.prefs.MyListPreference android:entries="@array/clock_ampm_style" android:title="AM/PM style" android:key="ampm" android:entryValues="@array/lclock_ampm_style" />
<com.wubydax.romcontrol.v2.prefs.MyListPreference android:entries="@array/clock_day_style" android:title="Date style" android:key="day" android:entryValues="@array/lclock_day_style" />
<com.wubydax.romcontrol.v2.prefs.MyListPreference android:entries="@array/date_format" android:title="Date format" android:key="date_format" android:entryValues="@array/ldate_format" />
</PreferenceScreen>

Hope someone can help me

Also what not working is reboot in RC. No Reboot of all 3 work. i put app in Priv-app and also in data but same results
[Android General] abhijeet_11:
Stucked with APX Mode....Pls Help

Don't know how but I got stucked in

APX Mode

.....

No Recovery,Fastboot is working...Display is blank...even after connection the charger it's totally blank.. :(

Pls help me...:crying:

My Device is

XOLO Play T1000 (US9230)-(Nvidia Tegra3 Chipset)

:)

If wanna check the device info.... http://gadgets.ndtv.com/xolo-play-t1000-911
[Android General] daxgirl:
For the nested preference, go to PrefsFragment, find void method setUpNestedPreferenceLayout(PreferenceScreen preference), add the invocation in blue:

private void setUpNestedPreferenceLayout(PreferenceScreen preference) {
final Dialog dialog = preference.getDialog();
if (dialog != null) {
LinearLayout rootView = (LinearLayout) dialog.findViewById(android.R.id.list).getParent()[COLOR="Blue"][B].getParent()[/B][/COLOR];
View decorView = dialog.getWindow().getDecorView();
if (decorView != null && rootView != null) {
Toolbar toolbar = (Toolbar) LayoutInflater.from(getActivity()).inflate(R.layout.nested_preference_toolbar_layout, rootView, false);
toolbar.setTitle(preference.getTitle());
decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);
rootView.addView(toolbar, 0);
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
dialog.dismiss();
}
});
}
}
}

As for the reboot, I cannot help you. I have no rooted device on nougat. I only can run on nougat emulator. and there I can't push to priv-app. So I have no idea. Probably need to adjust to new api.

The code above for nested preference is for nougat only, they changed the layout structure.
[Android General] asc1977:
Hi daxgirl,

i confirm it work. Thank you very much. You safed my world :)

I try out again with reboot and reboot recovery. both work if in priv-app. Only thing which not work is reboot systemui. i get no fatal error but a small logcat. maybe it help you to find out what causing the problem

11-24 17:06:08.228 9759-9759/com.wubydax.romcontrolpro.v2 E/ViewRootImpl: sendUserActionEvent() mView == null
11-24 17:06:08.269 3040-3040/? E/audit: type=1400 audit(1480003568.259:360): avc: denied { getattr } for pid=10797 comm="pkill" path="/proc/2993" dev="proc" ino=14502 scontext=u:r:init:s0 tcontext=u:r:logd:s0 tclass=dir permissive=0 SEPF_SECMOBILE_7.0_0002
11-24 17:06:08.270 3040-3040/? E/audit: type=1300 audit(1480003568.259:360): arch=c00000b7 syscall=79 success=no exit=-13 a0=7 a1=7a8ae87aa3 a2=7fd5ad0e68 a3=100 items=0 ppid=9785 pid=10797 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="pkill" exe="/system/bin/toybox" subj=u:r:init:s0 key=(null)
11-24 17:06:08.271 3040-3040/? E/audit: type=1327 audit(1480003568.259:360): proctitle=706B696C6C00636F6D2E616E64726F69642E73797374656D7569
11-24 17:06:08.271 3040-3040/? E/audit: type=1320 audit(1480003568.259:360):
11-24 17:06:08.273 3665-3758/? E/ActivityManager: Sending non-protected broadcast samsung.intent.action.knox.DENIAL_NOTIFICATION from system 3665:system/1000 pkg android
java.lang.Throwable
at com.android.server.am.ActivityManagerService.broadcastIntentLocked(ActivityManagerService.java:21257)
at com.android.server.am.ActivityManagerService.broadcastIntent(ActivityManagerService.java:21855)
at android.app.ContextImpl.sendBroadcast(ContextImpl.java:901)
at com.android.server.SEDenialService$AuditFileObserver.onEvent(SEDenialService.java:84)
at android.os.FileObserver$ObserverThread.onEvent(FileObserver.java:122)
at android.os.FileObserver$ObserverThread.observe(Native Method)
at android.os.FileObserver$ObserverThread.run(FileObserver.java:85)
11-24 17:06:09.239 3665-4399/? E/Watchdog: !@Sync 7 [24_Nov._17_06_09.238]
[Android General] HaoZeke:
Hey, this might be a stupid question, but any hopes of an Android.mk file so I can build this inline with my rom?
[Android General] Wuby986:
imo is not stupid.. i am not very familiar with it, but we can think about it, althougt building it separated is perfectly fine, i can agree it might be easier for you building all inline

Inviato dal mio SM-G930F utilizzando Tapatalk
[Android General] niaboc79:
All my subscreens preferences are force closing on android 7.0

Is that already reported?
[Android General] Wuby986:
yes thanks..

in order to fix this you'll have to edit the PrefsFragment class since they added a new child view in 7.0 so we'll have to get the parent of the parent view to inflate the view for the toolbar.

so go to PrefsFragment and search for the setUpNestedPreferenceLayout method; there you'll see inside the first if clause a cast to LinearLayout with at the end of line the .getParent, here we'll add a new .getParent in order to get the parent of the parent as explained above. so line will look like:

LinearLayout rootView = (LinearLayout) preference.getDialog().findViewById(android.R.id.list).getParent().getParent();

edit! was already explained from dax in prev. page, i noticed it in most thanked section just now
[Android General] niaboc79:
Thanks, I will edit the code ;)
[Android General] niaboc79:
Could you please fix the kill package issue with android 7 ;)

Cheers
[Android General] Wuby986:
temporary fix is to edit the code to use busybox one

Inviato dal mio SM-G930F utilizzando Tapatalk
[Android General] niaboc79:
Could you show me these edits ;)

Envoyé de mon F8331 en utilisant Tapatalk
[Android General] Steve-luo:
Hello [MENTION=5493353]Wuby986[/MENTION] , our team is currently using this project. Recently we ran into some problems. Reboot SystemUI on this page does not work on Android 7.0 (specifically speaking HTC 10). Is there any solution? Thanks in advance.
[Android General] asc1977:
scroll up to lines and its explained there

Guys take a little time to read and use search function or isnt it so hard to do

guide:

utils.java class and it is in last method named killPackage

#change

Command command = new Command(0, "pkill " + packageNameToKill);

#to

Command command = new Command(0, "busybox pkill " + packageNameToKill);

But only work if busybox is installed
[Android General] Steve-luo:
Thanks for the reply! And sorry for not checking first
[Android General] varobejar:
Hello, suddenly the application, modifying a section that I created putting applications, to give you to try has given me this error:

Error:java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException:

Error:Execution failed for task ':app:mergeDebugResources'.

> Error: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException:

I already had 4 applications and everything is fine, because I'm testing the application every few days, but when I have the last one, it tells me the above. What can be? Because I have removed the lines and give me the same error.

---------- Post added at 12:21 AM ---------- Previous post was at 12:07 AM ----------

Solved, it has been an image that I have put in .png although I have more, that has given error, I have removed it and ready
[Android General] varobejar:
help me, I have a script, but rom control say 127

my line is:

<com.wubydax.romcontrol.v2.prefs.RunScriptPreference android:title="StockTw" app:packageNameToKill="com.android.launcher2" app:isSilent="false" app:scriptFileName="stocktw.sh" />

and my script is:

#!/system/bin/sh

export PATH=/system/bin:$PATH

mount -o rw,remount /system

cp -p /system/emotion/files/stocktw/TouchWizHome.apk /system/priv-app/TouchWizHome/TouchWizHome.apk

pkill zygote
[Android General] Wuby986:
you don't need to export path, nor to kill zigote, which is definitely not the best way to.. we provide the reboot prompt message.

also you might want to try "cp -f"

anyway this tread is dedicated to rom control app and not to fix the script problems, for which we don't provide support
[Android General] tdunham:
I recommend using a root explorer that has the ability to run scripts for testing.

Rom Toolbox root explorer has this ability and you will see exit code as well.

I agree with Wuby, do not use kill zygote. The commands you need are already integrated into RC.

Packagenametokill does not work for every situation but it is always very useful as well.

Here are a couple of examples of one of mine.

Some scripts I run, 'suggest' a reboot like this first example:

#!/system/bin/sh

mount -o rw,remount /system

cp -p /system/moar/files/sound/mild/mixer_gains_stereo.xml /system/etc/mixer_gains.xml
cp -p /system/moar/files/sound/mild/mixer_paths_stereo.xml /system/etc/mixer_paths.xml

<com.wubydax.romcontrol.v2.prefs.RunScriptPreference
android:title="Mild Volume with Surround Sound"
app:scriptFileName="volume_mild_stereo.sh"
app:rebootOptions="optional"
app:showConfirmDialog="false"
android:summary="Mild Level sound increase" />

This one requires a reboot so I use RC to require a reboot.

#!/system/bin/sh

mount -o rw,remount /system

cp -p /system/moar/files/contacts/SecContacts_M.green.apk /system/priv-app/SecContacts_M/SecContacts_M.apk

<com.wubydax.romcontrol.v2.prefs.RunScriptPreference
android:title="Stock Green"
app:scriptFileName="enable_green_fs_contacts.sh"
app:rebootOptions="imminent"
app:showConfirmDialog="false"
android:summary="Device will REBOOT" />

Edit:

Sorry, I do not use any scripts that would require the use of packageNameToKill so cannot provide an example of one of those.
[Android General] zaudy:
i have a russian romcontrol and i want to translate it to english , any help

by the way I'm Beginner
[Android General] MisterEvo:
Is it possible to execute java code when toggelling a switch like in old rom control?

To way it was done before is going into the public void onSharedPreferenceChanged method and switched the switch values and run java code , when the switch is triggered.. Is there a way to do so in this RC?
[Android General] Zidni:
many many thanks...... [MENTION=4714483]daxgirl[/MENTION] & [MENTION=5493353]Wuby986[/MENTION]

successfully built it for my rom ...
[Android General] tdunham:
java.lang.ClassCastException: android.widget.FrameLayout cannot be cast to android.widget.LinearLayout
at com.wubydax.romcontrol.v2.a.onPreferenceClick(Unknown Source)
at android.preference.Preference.performClick(Preference.java)
at android.preference.PreferenceScreen.onItemClick(PreferenceScreen.java)
at android.widget.AdapterView.performItemClick(AdapterView.java)
at android.widget.AbsListView.performItemClick(AbsListView.java)
at android.widget.AbsListView$PerformClick.run(AbsListView.java)
at android.widget.AbsListView$13.run(AbsListView.java)
at android.os.Handler.handleCallback(Handler.java)
at android.os.Handler.dispatchMessage(Handler.java)
at android.os.Looper.loop(Looper.java)
at android.app.ActivityThread.main(ActivityThread.java)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java)

Help please. :p

Running nougat stock and decided to see if the app would run and get this fatal error whenever I try to access most of the prefs.

I even updated and recompiled but still the same issue.
[Android General] Wuby986:
hy troy it's a N related issue, we posted fix for it a few pages back, since they nested it, we need to nest it as well, if i am not mistaken ? but anyway fix is written correctly, you also might need the reboot fix wich is using busybox instead built in binary

Inviato dal mio SM-G930F utilizzando Tapatalk
[Android General] tdunham:
Tnx Roberto. I'm severely behind and haven't seen anything recent so I'll browse back. We just got N a few weeks ago so I thought I'd tinker around with it for a while.
[Android General] Wuby986:
it's because of a framework edit they made in N, everything else is just fine except as i said the reboot

Inviato dal mio SM-G930F utilizzando Tapatalk
[Android General] millo1978:
Hello People :)

Is it possible to have a switch for SELinux?

0 = Permissive

1 = Enforcing

I have it on Kernel Adiutor and it works good.

But I'm not able to have it on Rom Control.

terminal command

setenforce 0

and

setenforce 1

work good.

In Kernel Adiutor I have:

#!/system/bin/sh

if [ 'getenforce' == "Enforcing" ]; then
echo 1
else
echo 0
fi

and

#!/system/bin/sh
setenforce $1

and the switch works good!

Have you Ideas?
[Android General] Wuby986:
you must run a script in rom control

Inviato dal mio SM-G930F utilizzando Tapatalk
[Android General] millo1978:
thanks :)

but could I have switch with script?

Switch have <com.wubydax.romcontrol.v2.prefs.MySwitchPreference

Script have <com.wubydax.romcontrol.v2.prefs.RunScriptPreference

What is correct?

Without MySwitchPreference can't I have a switch
[Android General] Wuby986:
you need run script but you cannot have a switch

Inviato dal mio SM-G930F utilizzando Tapatalk
[Android General] jmckeejr:
I have issue with CustomBg on nougat ROM. I implemented mod for custom power menu background and colors\gradient work but no image. I've triple checked keys and they match. Maybe need to change an array? When select image it goes to stock. Any help appreciated, trying to finish this up before have to leave to go out of town.

Edit: Further testing shows that if I use an external app like Mega to set background it works but not with gallery (v5.3.03 and v5.3.02} or with Google photos both built into ROM. I will have to find older version of gallery to test.

Also, if I set background image then update ROM control I need to run a script to clear background image setting or ROM control crashes every time open.
[Android General] sonnguyenpg:
Help me.

i get error when open source with android studio v.3 . i have to do to fix this?

https://uphinhnhanh.com/image/MDisCf
[Android General] millo1978:
I solved (?) with "//"...

no Variant = no error!

But this isn't a solution ... only a work-around.

I also want a right solution.

...
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.gearSigningConfig
// applicationVariants.all { variant ->
// variant.outputs.each { output ->
// output.outputFile = new File(output.outputFile.parent,
// output.outputFile.name.replace("-release", ""))
// }
// }
}
}
}

I have another issue...

Utils.killPackage

Utils.java

with pkill I can't reboot SystemUI...

I changed it with killall and it works...

but is it good?

public static void killPackage(String packageNameToKill) {
Command command = new Command(0, "[B]killall[/B] " + packageNameToKill);
try {
RootTools.getShell(true).add(command);
} catch (IOException | TimeoutException | RootDeniedException e) {
e.printStackTrace();
}
}

My phone: Huawei P9 lite VNS-L21C432B382 Nougat
[Android General] kep2008:
Reboot SystemUI can be see here.

About error, I did so

applicationVariants.all { variant ->
variant.outputs.[COLOR="Blue"]all {
outputFileName = "${variant.name}-${variant.versionName}.apk"[/COLOR]
}

truth is I do not know if it's right.... :D

You can see here.
[Android General] JonathanRAZ:
[MENTION=4948569]sieuan[/MENTION] i think xda labs is having trouble but i have answered you....i will have to re do it on a source it has bewn long time from that but will do it and help you